Library: A rapid transit system

The Pixie
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.

Buddy Bishop
I'm having diffiuculty setting up an elevator using elevator.aslx, so this library looked like a potential alternative.
However, when trying to run the sample in Quest 5.6.2, I get this error:

Error running script: Unrecognised element 'span'
Error running script: Unrecognised element 'span'
Error running script: Unrecognised element 'div'
Error running script: Error compiling expression 'ListExclude(ScopeVisibleNotHeldNotScenery(), game.pov)': FunctionCallElement: Could find not function 'ListExclude(QuestList`1, Object)'
Sorry, an error occurred.
Object reference not set to an instance of an object. at TextAdventures.Quest.WorldModel.UpdateObjectsList(String scope, ListType listType) at TextAdventures.Quest.WorldModel.UpdateObjectsList() at TextAdventures.Quest.WorldModel.UpdateLists() at TextAdventures.Quest.WorldModel.b__100_0()

any suggestions?

The Pixie
The problem with both libraries is Quest saves string lists differently now, and so is confused because these use the old method. For this library, open it up in a text editor (eg Notepad), got to line 44, which looks like this:
    <destinations type="list"></destinations>

And change it to this:
    <destinations type="stringlist"></destinations>

To get the demo to work, also delete the walkthrough (bottom of the left pane).

For the other library the problem is similar, search for lines with type="list" and change it to type="stringlist" and it should work (not tried it myself though).

HegemonKhan
as Pixie already explained, a lot of the libraries are old, made using the syntaxes of the earlier versions of quest, which some of those syntaxes have changed with the newer versions of quest, so to get these old libraries to work, you just got to change the old syntaxes into the new ones. Sora's Stackable Library is a really useful library for a lot of people who're interested in using it, but we've not seen Sora since... so it remains not updated to the new syntaxes used, and no one has yet done the updating of it into the new syntaxes. We're all lazy (or too busy) to do it ourselves, laughs.

here's the (and a very useful at that) link:

http://docs.textadventures.co.uk/quest/ ... notes.html

(see the Upgrading from 5.3 to 5.4 section for the syntax changes)

Buddy Bishop
Thanks for the info!
As odd as it may sound, I was able to solve this by simply regenerating the GUID.
The transit sample (and other samples like janabonne's v.06/v.65 elevator library) played without issue afterwards.

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums