A very simple module that lets you easily put a transit system in your game.
This could be buses, underground railway (subway), trams or teleportation booths.
The player is moved to the destination in one turn. Only one transit system can be used.
To use:
1. Set up a command with the relevent phrases, which calls a function "Transit".
2. For each of your stations/stops/etc. set a bolean attribute "transit_stop" to true.
3. You also need to register each destination with the AddDestination function.
This takes the display name of the station/stop as the first parameter,
and the station/stop (as an object) as the second parameter.
You can add some station/stops in the start script on game, and add further destinations
as the player progresses through the game. For example:
AddDestination ("Bus Stop One", bus_stop_one)
Optionally, you can have the player charged for using the system.
4. Add a "money" attribute to the player, set to be an integer.
5. The fare defaults to 5, but you can change it using the SetFare function.
A flat fare applies.
Optionally you may want to replace the templates (if, for example, you are building a bus route)
6. Copy the four templates into your own code.
7. Modify the text accordingly.
See the included demo to see it in action.
Feel free to modify this code as you wish.