Hello,
I got some partial work laying around which is a starting point for using the StoryBook. However, it really need some interactive API for the StoryBook which I have not had time to implement for OpenTTD 1.4. I've attached this partial work here if anyone wants too look at it.
However, if you want to contribute a rail chapter and aim to get something done before OpenTTD 1.5, you could start by cloning
the HG repository which contains current version 17. My changes above are mostly in the core infrastructure and are easy to apply later on even if changes are made with the current code base to add new chapters. Because so far, I've really only worked on converting the introduction chapter which already give the problem that I don't know when the user is done reading the 3 story pages.
Sorry for mixing both current state and StoryBook stuff. But basically. Grab version 17,
create open a file called chapter_trains.nut and look how the other chapter_*.nut files are done. English strings goes into lang/english.txt and follow the pattern there for how strings are named.
A chapter is described as a series of steps. The code infrastructure provides a set of different step types for showing messages, highlight buttons, close window, wait on window (close/open), executing code. A function in the chapter is called when the chapter is loaded and will setup/return a list of all steps. The main code then will call methods in the step instances to execute them and wait for them to finish, then continue to the next step and so on. Each chapter have a table for storage which code steps have access to. For strings you will usually want to refer to data in this table which is possible using a special text class which allow not just default GSText parameters but also references to members of the storage table which will allow to delay reading from the table until the step is actually executed.
Save/load will remember the step you are at and the table. However, save/load is not really working yet as it needs more care to rewind in some places where it depends on windows being open etc. I don't consider save/load the most important for the moment, but still try to write chapters using the step infrastructure.
When you download Tutorial via Bananas or clone the repository you also get the scenario file. If you need to modify it to add industries it is OK. Try to not use a higher OpenTTD version than necessary though. 1.4 is OK but don't use a newer nightly. If you need to start the game and then go back to scenario editor, you will want to make some temporary hacks in TileLabels library so that signs are not removed from the map when starting the game. Using TileLabels signs rather than hard coding coordinates is recommended if you want to refer to some tile in the game.
Now I've written a lot and still probably forgot some. Keep asking if you wonder something I didn't explain.
Edit: The file chapter_trains.nut already exist