You can perfectly fine create a scenario that uses a specific GS such that the scenario will use that Game Script. But you will have to release the Game Script as a separate BaNaNaS-entry that is downloadable separate to the scenario. You can set a property in info.nut so that the game script will be hidden for all players except those who have ai_developer mode activated. And for them you provide a info-text that the GS is not general purpose.
I have created two such combos where there is both a GS and a Scenario that are meant to be used together. It is not the easiest thing to do and you will likely want to use musa when you upload the scenario so you can set up dependencies that are a bit more wild than the bananas web UI allows.
The two examples are:
- Split - a scenario and a GS - quite old and more a proof of concept than a very good scenario. When you complete a goal, the land will raise and connect the main land with an island
- Beginner tutorial - a in-game tutorial implemented using a scenario + GS and there is also an AI that can complete one of the chapters for you. More complex, but have all parts probably more well organized in its git repo at openttdcoop devzone.
_________________My OpenTTD contributions
(AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)Junctioneer
(a traffic intersection simulator)