First, looks like an interesting project you got.
# staring before 1930
In order to make the game start in 1914 some existing newgrf content such as "Earlier_Road_Vehicles-1.0" and "Early_Houses-2.0" must be included or supplied as automatic download dependencies. I am not sure how this can be done.
Add the NewGRF to your main game NewGRF dialog before creating the scenario. This is the safest way to include NewGRFs in scenarios and save games. A scenario is basically a save game with a different file extension.
If you just upload this to bananas, if users doesn't have the added NewGRFs, they can download it using the button to find missing NewGRFs via online content. But you can also make it better. If you upload your scenario using musa
, you can mark that your scenario depend on the NewGRF so that the NewGRF will automatically be downloaded when users click to download your scenario in the in-game online content list. Since you are going to use a Game Script too, you rather like to go the musa-way as currently OpenTTD doesn't support automatically finding missing Game Scripts from online content.
I have published both the Split scenario and Beginner Tutorial the musa way with dependencies set. In the musa thread there is a post on how I have set up the musa configuration for the Beginner Tutorial which is a more complex case than yours.
# game script
(waiting for your help)
If you want to announce that the game was completed when two oil refineries has been built, then that is not so complicated. There is an event
for when an industry opens.
If you however also want to announce who did fund the oil refineries, then that is not possible to do reliably. The API for Game Scripts doesn't convey which company that did fund an industry in the event. Industries doesn't have owners, so it is also not possible to query that from the industry after it was built.
A not so reliable method is to monitor the finances of players from day to day. But even if you can use the industry open event, and with that check if it is the right industry type, you would between two checks of bank balance have the noise of all income and costs between those two moments.
An alternative path is to via NewGRF make it impossible to fund the industry as player, but instead provide a interface via the GS to tell the GS where to build the oil refinery. The GS would check that you have sufficent funds, reduce the cost from your bank balance and then build it for free. At the same time, it would record which company asked for and paid for it. The user interface would consist of perhaps that you place a sign with some code on the tile you like to build the oil refinery. You get a blue OK/cancel dialog where you can confirm. It is possible to include documentation in the story book on how this works and also auto-display this to companies when they join the game.
# making AI understand the goal
(waiting for your help)
The GS can use the [url]SCP library[/url] which allow AIs to communicate with the GS. This way the GS can expose that it is exactly your GS the AI plays against, and perhaps make it that generic that it give the AIs the industry type ID of oil refinery and the count required to complete the game. This will pollute the tile 1,0 (or was it 0,1?) with some signs as AI and GS talk with each other.
Adding SCP to GS is however only giving AIs the possibility to detect your GS. Each AI also need to be updated with code to handle your GS specifically. All AIs doing that will hardly happen. But one or two might do it.
_________________My OpenTTD contributions
(AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)Junctioneer
(a traffic intersection simulator)