Simulator Text Adventure

KTwiss
30 Dec 2014, 03:01
Hi!
This is my first game I've learned a tiny bit of coding, i'm making a transit simulator for a program I'm helping run about the transit system here in Toronto teaching people how to get around using public transit. I've got quite a few coding situations figured out but this whole timer situation is a bit confusing for me. I was hoping I can simulate the transit system by having a timer between each subway stop because as it is right now you can just get on and off the subway like there is no travel time. Can I make this happen? I'm finding all of this information explaining other situations a bit overwhelming on how to make it work for my situation.
please help!

HegemonKhan
30 Dec 2014, 03:15
you just want time while on the transit, correct?

A -> (1 hr) -> B -> (5 hrs) -> C

or, do you want time to exist within the game (on transit AND while you're not in transit, such as when the transit is operational and when it is not) ???

can you give more details about what you want with this use of time?

what is the time for ?, what do you want to achieve via this use of time?

(then, we can better help with implementing what you want, as it's useful to know what exactly you want, before we can help with helping you have what you want)

KTwiss
30 Dec 2014, 03:33
I want to use time to make things more realistic so say it takes 30 seconds to get to each stop giving them an opportunity to get off or stay on, I hope that makes sense because like I said at the moment you get on and off like it's instantanious which is super unrealistic.

HegemonKhan
30 Dec 2014, 06:23
you can simply add a 'msg' script saying that, to give more realism, or do you want the person playing the game to actually have to wait a certain amount of time before they get off the transit (for example: in~after 30 seconds, the game prompts the player that they've arrived at station X, asking them if they want to get off or to stay on until station X2 for another 30 seconds or if you want, a different amount~interval of time, and etc etc etc) ?? Or, do you want the time to do something else?

KTwiss
30 Dec 2014, 06:26
I want them to wait say 30 seconds before being able to do something, so are you saying that it isn't possible?

HegemonKhan
30 Dec 2014, 07:07
it is very possible, and a way of doing it, is to use:

Timers ( http://docs.textadventures.co.uk/quest/ ... timer.html )

a way of doing this:

make your transit vehicle, a 'Room' Object, you'll need to make~add scripts (such as a 'lockable~locked' and 'openable: open~close' Attributes) that prevents you from leaving the Room (preventing you from using the Exit or the 'door' object which is tied to the Exit), upon entering the Room enable the Timer, upon leaving the Room disable the Timer, create~add a Timer to that room, and make~add scripts to that Timer.

doing this, is actually quite complex... laughs... I'm going to struggle with this... haha

for example (in code: sorry it's much quicker for me to do, lol):

I'll need to look up Exits, open~close, and locked~unlocked ... I haven't used the built-in quest stuff for quite some time (lol), so it'll take me some time (haha, a pun) to do this in code...

so... here's my work thus far for now:

<asl version="550">

<include ref="English.aslx" />
<include ref="Core.aslx" />

<game name="xxx">
<gameid>xxx</gameid>
<attr name="train_current_stop" type="object">train_station_1</attr>
<attr name="train_variable_x" type="int">0</attr>
</game>

<object name="train_station_1">

<inherit name="editor_room" />
<alias>train station 1</alias>

<object name="train_1">

<inherit name="editor_room" />
<alias>train</alias>
<onenter type="script">
// this syntax, and~or script name, for this script block may be incorrect, as I haven't looked it up, just guessing
EnableTimer (train_1_timer)
</onenter>

<timer name="train_1_timer">

<attr name="enabled" type="boolean">false</attr>
<attr name="interval" type="int">30</attr>

<script>
game.train_variable_x = game.train_variable_x + 1
game.train_current_stop = "train_station_" + game.train_variable_x
msg ("We've arrived at " + game.train_current_stop.alias)
ask ("Do you want to get off?") {
if (result = true) {
player.parent = game.train_current_stop.name
msg ("You get off the train.")
// the below code line's syntax, and~or script name, may be incorrect, as I haven't looked it up, just guessing:
DisableTimer (train_1_timer)
} else if (result = false) {
msg ("You stay on the train, waiting for the next stop.")
}
}
</script>

</timer>

</object>

</object>

<object name="train_station_2">
<inherit name="editor_room" />
<alias>train station 2</alias>
</object>

</asl>


others, who're good at coding, can do this much better, and~or can help you directly doing this, via the GUI~Editor, as well.

-------------------

there's also these links (libraries: 'code patches ~ mods ~ xpacs' that you can add to your game) too:

viewtopic.php?f=18&t=2649
viewtopic.php?f=18&t=3212&hilit=elevator

if you need help, ask, hehe :D

Silver
30 Dec 2014, 08:27
You could check out Moquette by Alex as that includes a simulation of the London Underground.
http://textadventures.co.uk/games/view/ ... w/moquette

He also made it open source so you could look at how he coded it.

Silver
30 Dec 2014, 08:30
KTwiss wrote:I want them to wait say 30 seconds before being able to do something, so are you saying that it isn't possible?


It's possible using timers yes. You might want to consider what happens in those thirty seconds though. It'd be a bit boring to just wait for that time.

jaynabonne
30 Dec 2014, 11:22
If you just want to keep the player from being able to do something for 30 seconds, then you can hide the command bar, delay for 30 seconds, and then turn the command bar back on. The script looks like this:

      request (Hide, "Command")
SetTimeout (8) {
request (Show, "Command")
}

Unfortunately, you can't do this via the Quest GUI because the "request" command is hidden by default. So you'd have to add it in Code View. That also assumes you don't have any mouse clickable links, as those will still be enabled.

To echo Silver's concern, doing nothing for 30 seconds, while perhaps a poor simulation of reality, would not make for an enjoyable *game* experience. In fact, I'd say it's even worse than reality, because while you're riding a subway, you can at least look around, see the outside world going by, watch people, mess with your phone, etc. Being unable to interact with the game for a fixed (and actually quite large) period of time seems like a good reason to walk away from the game. Life is tedious enough without having to live it as well in a game that you're using to escape from life! :lol:

You might be better off allowing the player to continue to interact with the game, but just not allow them off the train until the doors open, which would happen after X moves (as opposed to fixed length time).

Silver
30 Dec 2014, 11:30
I think Alex solved it by having other people in the carriage to look at. These actions triggered turn timers (IIRC) and after so many you reached your next destination.

Silver
30 Dec 2014, 11:32
Not sure how well that would work with a parser though (Moquette utilised hyperlinks).

Marzipan
30 Dec 2014, 15:09
jaynabonne wrote:To echo Silver's concern, doing nothing for 30 seconds, while perhaps a poor simulation of reality, would not make for an enjoyable *game* experience. In fact, I'd say it's even worse than reality, because while you're riding a subway, you can at least look around, see the outside world going by, watch people, mess with your phone, etc. Being unable to interact with the game for a fixed (and actually quite large) period of time seems like a good reason to walk away from the game. Life is tedious enough without having to live it as well in a game that you're using to escape from life! :lol:

You might be better off allowing the player to continue to interact with the game, but just not allow them off the train until the doors open, which would happen after X moves (as opposed to fixed length time).



This a thousand times. Exactly what I was thinking reading the OP. :P

KTwiss
30 Dec 2014, 17:23
Thanks so much for your input and assistance! I do agree that maybe 30 seconds would be a lot of time maybe shortening the time to 10 seconds might be better. I did look at Alex's moquette it is quite cool but a bit too much reading for my audience

Silver
30 Dec 2014, 17:31
Well it was more how he handled a subway in game terms rather than narrative that I meant to look at.

The Pixie
30 Dec 2014, 17:51
Ignoring the game play issues...

I agree with HegemonKhan that timers is the way to do it - and that is is pretty complicated (and the documentation for timers is not at all helpful!). I would have two attributes on the train, the first tracking its current state (in station, travelling to a station, including which station), and the second as a countdown. Have the timer reduce the countdown, and when it reaches zero, move to a new state with a new countdown.

Have an exit on the train that is set to locked when between stations. When it arrives, set it to be unlocked, and set its "to" attribute to the station.

KTwiss
30 Dec 2014, 17:58
Pixie,
I feel like you understand I am still super confused as to how to make this time stuff happen what steps do I need to take using which menus and such or do I have to enter the actual code?

HegemonKhan
30 Dec 2014, 19:27
@KTwiss:

right now, we're mostly giving you conceptually of what you want done, entails. I think we know that you're at a lost, not knowing what we're talking about, nor how to do it in the GUI~Editor (and~or with code), right now (though with time, you'll start to understand, we're trying to start that knowledge gaining, even if it doesn't make sense right now to you). We're getting towards actually helping you, but we need to do some groundwork first.

Even what seems a super simple thing to do, can be actually quite complex in terms of actually implementing it in game making (either via code or the GUI~Editor).

'time' usage is actually quite a complex thing to start with, laughs (I'm still greatly struggling with 'time' usage, sighs). But, it'll quicken your progress, but it'll be difficult to grasp, so quickly.

I think we understand that you're new to quest and to programming~coding, and will need help, step by step guidance, via using the GUI~Editor (and maybe some code usage, if you can handle it), Jay and Pixie are quite good at this, whereas I struggle with helping with using the GUI~Editor, as I mostly just try to work with code (and I'm a noob at coding too, whereas Jay and Pixie are good at coding), though I still try to help as I can... laughs.

So, I think we'll get to actually helping you very soon, but right now, we're more in the mode of explaining the concepts and gathering information about what exactly you want done, to determine how best to do it, which then we'll be able to guide you in doing step by step via the GUI~Editor (and~or some coding too).

Silver
30 Dec 2014, 20:02
Rather than hit him with everything, why not just explain timers? I might do a quick test game just for that purpose. Then new problems will surface and so forth and so on.

Silver
30 Dec 2014, 21:03
Okay, here's a rough-around-the-edges example of how I'd take the player from A to B in 30 seconds using timers. Basically it's three rooms: the first being the station you start, the second the tunnel and the third your destination. I've disabled the parser And there's six timers each with five second intervals. Um, any questions gizza shout.

http://textadventures.co.uk/games/view/ ... r-tutorial

If you plan on making your subway big then this method might constitute a LOT of work so you may want to run with one of the other suggestions. This is just to show you (hopefully) how timers can be utilised. Game file attached.

HegemonKhan
30 Dec 2014, 21:03
a Timer is like a stopwatch (except that it counts up from zero), you can 'click' to start it (EnableTimer) and 'click' it again to stop it (DisableTimer), or you can have it already running (it runs as soon as the game begins or as soon as you enter its room). Timers can be global (game-wide) or local (when in a specific Room). The 'interval' is the time intervals of when the 'script' is activated:

enabled (boolean attribute) = (true or false)

interval (integer attribute): 30
script: msg ("hi")

every 30 seconds, the Timer outputs: hi

0 seconds: (nothing)
0-29 seconds: (nothing)
30 seconds: hi
31-59 seconds: (nothing)
60 seconds: hi
61-89 seconds: (nothing)
90 seconds: hi
etc etc etc

-----------------

I'm not sure how a countdown timer is done... I'm still a noob with this 'time' stuff, laughs. I did make a very indirect convoluted 'countdown' coding, but it didn't use a Timer directly to do it (as it used very convoluted scripting within the Timer).

--------------

a different approach, as using actual 'time' can be buggy (ever played an online game... lag? And~or just in designing it into all working correctly), is to use an 'action count', which can be done via:

Turnscripts

(you can use a 'turn' attribute, or not, as it works with actions, I'd have to find the thread~post that Jay delved into the order of operations of its core coding, to explain the 'actions' that are involved with it, but this is more complex stuff, Turnscripts for basic usage are actually quite simple to use).

Silver
30 Dec 2014, 21:19
Timers still seem to be a bit dicky online. The first one in my test game seems to alternate between the five seconds its supposed to last for and almost immediately.

The Pixie
30 Dec 2014, 21:27
KTwiss wrote:Pixie,
I feel like you understand I am still super confused as to how to make this time stuff happen what steps do I need to take using which menus and such or do I have to enter the actual code?

Here is what I would do.

Timers are at the bottom of the left pane. Click it, then click Add, and give it name. Your new timer will appear. Click to have it enabled at the start, and set the interval to 5 seconds. In the script part, click on the seventh icon, Code view, and paste this in:
train.countdown = train.countdown - 1
if (train.countdown = 0) {
if (exit_train.locked) {
exit_train.locked = false
exit_train.to = second_destination
train.countdown = 10
}
else {
exit_train.locked = true
train.countdown = 3
}
}

You will also need to set up a room called "train" with an integer attribute called "countdown", set to 3 (in all this, do not type the quotes by the way) (there is a tab for attributes for everything in Quest; new attributes are set in the lower half; note there are various types, string, integer, boolean, object). Give it an exit called "exit_train". Set the exit to be locked. Add a second room called "second_destination".

The timer will fire every five seconds, reducing the value of "train.countdown". When it hits zero, it will do stuff. If the door is locked, it will unlock the door, set the destination of the door to the room called "second_destination". If the door is already unlocked, the door will be locked. Eitherway, countdown is reset.

As set up this will take you to the "second_destination" for every station, but that is at least a starting point; make sure that works first.
____________

For stage two set up a series of rooms to be each station. For each room, create an object attribute called "nextstation", and set it to be the next room in the sequence (if this is a a linear line, you will need to differentiate between platforms so it goes to different rooms on the return route). Then change the fifth line of the timer code (exit_train.to = second_destination) to this:
 exit_train.to = exit_train.to.nextstation

So now what it will do when unlocking the doors is set the exit to go to the next station in the sequence.

I think it will miss the first station; it is probably easiest to set up a dummy (call it "depot" perhaps). Have the exit "exit_train" go there at first, and set its "nextstation" attribute to be the first station.

Let me know how it goes!

Silver
30 Dec 2014, 21:47
If you want to build a big subway you really need to get your head around what The Pixie is saying. Because it's far less work in the long run than my example and makes it a more functioning system.

KTwiss
31 Dec 2014, 00:14
Ok so I sort of get what you guys are saying I tried to input that code, I guess I hadn't mentioned that I have already done a lot work and have done some cool things like adding sounds and pictures the one thing i'm most proud of is not being able to leave the room without all of your stuff. So my trains already have names and I created a bunch of different ones obviously because you need to go more than one direction. So I took the code and input the names of the location and subway and played it and i got this error
Error running script: Error compiling expression 'Subway Car HP EB.countdown - 1': ArithmeticElement: Operation 'Subtract' is not defined for types 'Object' and 'Int32'
Error running script: Object reference not set to an instance of an object.
Error running script: Object reference not set to an instance of an object.
Error running script: Object reference not set to an instance of an object.
Error running script: Object reference not set to an instance of an object.
Error running script: Object reference not set to an instance of an object.

this is the code I have in
if (exit_Subway Car HP EB.locked) {
exit_Subway Car HP EB.locked = false
exit_Subway Car HP EB.to = St George Station Bloor Danforth Level
Subway Car HP EB.countdown = 10
}
else {
exit_Subway Car HP EB.locked = true
Subway Car HP EB.countdown = 3

jaynabonne
31 Dec 2014, 00:27
I think you missed this part:

You will also need to set up a room called "train" with an integer attribute called "countdown", set to 3


You need to create the "countdown" attribute on your train as an integer and set it to some initial value.

KTwiss
31 Dec 2014, 01:09
I changed the train for what I named the subway car. How do I create the countdown attribute?

jaynabonne
31 Dec 2014, 01:17
In the editor, click on your "Subway Car HP EB", then click on the Attributes tab. Then at the bottom, in the Attributes list, click Add, give it the name "countdown" (and hit OK), and then change its type to Integer. Then change the 0 to 3.

KTwiss
31 Dec 2014, 01:27
I'm using the online version I don't see an attributes tab and i'm not in simple mode

Marzipan
31 Dec 2014, 05:03
I'd recommend switching to offline...the online version is convenient and a great way to try the program out but IMO it has too many issues to rely on it for a serious WIP. You can go to the 'My Games' section on the site and download the file onto your computer from there.

KTwiss
31 Dec 2014, 05:16
I have a mac, so there isn't a offline version for it is there?

HegemonKhan
31 Dec 2014, 06:31
the most recent version of quest has so many tabs added, that toggle options have been added to hide them, so in the GUI~Editor, you got to find those toggle options (likely under 'game' ~ the special Game Object, but I'm not sure), and I'm not sure if the Attribute tab even gets hidden or not, so maybe it's an issue with your web browser (safari, right, if you're using a mac?) ... is it updated to the most current version?, is there compatibility issues with quest and safari (even its most current version) ??? etc etc etc

The Pixie
31 Dec 2014, 09:54
As an alternative to seting attributes on the atributes tab, you can set them up in a start script. Go to the game object, and the Script tab. Go to Start script, and click Code view. You can then type in attributes and initial values like this:

train.count = 3

When setting up stations, put them in here too, like this:

second_destination.nextstation = third_destination

KTwiss
31 Dec 2014, 19:09
I did use safari it was a bit glitchy I am using firefox right now and I believe it is up to date, I believe I can use my boyfriend's computer to download quest and do some stuff on there.

KTwiss
01 Jan 2015, 23:08
ok I downloaded quest and added the integer I still have this error
Error running script: Object reference not set to an instance of an object.

jaynabonne
01 Jan 2015, 23:25
Could you post your game file here? Just reply and attach it in the "Full Editor & Preview" view. That will be easiest to debug. Otherwise, it's all down to guessing, which can take forever.

(You could also just copy and paste the Code View script in a reply.)

KTwiss
01 Jan 2015, 23:29
this is what you want?

<!--Saved by Quest 5.5.5328.26617-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="TTC Adventure">
<gameid>0ed9fa3a-79d3-4dd5-b2ee-6ada3ac07ea5</gameid>
<version>1.0</version>
<firstpublished>2014</firstpublished>
<subtitle>Delays and Detours</subtitle>
<author>Krystal Twiss</author>
<category>Simulation</category>
<cover>images.png</cover>
<menufont>Georgia, serif</menufont>
<description>About making different choices on TTC when faced with delays or detours</description>
<difficulty>Medium</difficulty>
<feature_pictureframe />
<menufontsize type="int">15</menufontsize>
<gridmap type="boolean">false</gridmap>
<cruelty>Polite</cruelty>
<appendobjectdescription />
<mapsize type="int">150</mapsize>
<showlocation />
<attr name="autodescription_youarein_useprefix" type="boolean">false</attr>
<autodescription />
</game>
<object name="Friends room">
<inherit name="editor_room" />
<description>Your friend's room is a bit messy, your stuff is all packed up to head home because you need to go and help family. You live at Gerard and Greenwood and your friend lives near High Park Station.</description>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
<object name="computer">
<inherit name="editor_object" />
<checkttcwebsite>The Bloor Danforth Line isn't operating between St George and Broadview due to track maintenance. 504 King Street Car is diverting westbound up church along queen down york back to king due to a collision Eastbound Elevator at Jane station is out of order</checkttcwebsite>
<checkfacebook>Facebook Message From Mom: Come Home Soon</checkfacebook>
</object>
<exit name="leave friends" alias="down" to="High Park Station">
<inherit name="southdirection" />
<locked />
<lockmessage>Make sure I have everything</lockmessage>
</exit>
<object name="your cellphone">
<inherit name="editor_object" />
<inherit name="switchable" />
<take />
<textmom>I'm on my way</textmom>
<feature_switchable />
<switchonmsg>your cellphone is on</switchonmsg>
<switchoffmsg>your cellphone is off</switchoffmsg>
<ontake type="script">
if (Got(Backpack)) {
}
UnlockExit (leave friends)
</ontake>
</object>
<object name="Backpack">
<inherit name="editor_object" />
<take />
<takemsg>Don't want to forget my stuff</takemsg>
<dropmsg>that was heavy</dropmsg>
<ontake type="script">
if (Got(your cellphone)) {
}
UnlockExit (leave friends)
</ontake>
<object name="clothes">
<inherit name="editor_object" />
</object>
<object name="MP3 Player">
<inherit name="editor_object" />
</object>
<object name="metropass">
<inherit name="editor_object" />
</object>
<object name="granola bar">
<inherit name="editor_object" />
<feature_edible />
</object>
</object>
</object>
<verb>
<property>checkttcwebsite</property>
<pattern>check ttc website</pattern>
<defaultexpression>"You can't check ttc website " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>checkfacebook</property>
<pattern>check facebook</pattern>
<defaultexpression>"You can't check facebook " + object.article + "."</defaultexpression>
</verb>
<object name="High Park Station">
<inherit name="editor_room" />
<picture>300px-Highparkstation1.jpg</picture>
<exit alias="up" to="Friends room">
<inherit name="updirection" />
</exit>
<exit alias="east" to="High Park Eastbound Subway Platform">
<inherit name="eastdirection" />
</exit>
<object name="Service Alert Board">
<inherit name="editor_object" />
<look><![CDATA[The Bloor Danforth Line isn't operating between St George and Broadview due to track maintenance.<br/>504 King Street Car is diverting westbound up church along queen down york back to king due to a collision<br/>Eastbound Elevator at Jane station is out of order]]></look>
</object>
<object name="TTC Worker">
<inherit name="editor_object" />
<inherit name="male" />
<drop type="boolean">false</drop>
<feature_usegive />
<givesingle type="boolean">false</givesingle>
<speak>Do you need any help?</speak>
<look type="script">
picture ("cust.jpg")
</look>
<takemap type="script">
AddToInventory (TTC Map)
</takemap>
<giveto type="scriptdictionary" />
<give type="scriptdictionary">
<item key="TTC Map">
</item>
</give>
<object name="TTC Map">
<inherit name="editor_object" />
<listalias>TTC Map</listalias>
<take />
<takemsg>Here, Just in case</takemsg>
<dropmsg>I dropped my map</dropmsg>
<look type="script">
picture ("Subway_Map.jpg")
</look>
</object>
</object>
<exit alias="west" to="High Park Westbound Subway" />
</object>
<object name="High Park Eastbound Subway Platform">
<inherit name="editor_room" />
<description>A bunch of other people are waiting for the subway with you</description>
<picture>ls.jpg</picture>
<object name="Service Alert Board2">
<inherit name="editor_object" />
<alias>Service Alert Board</alias>
<look><![CDATA[The Bloor Danforth Line isn't operating between St George and Broadview due to track maintenance.<br/>504 King Street Car is diverting westbound up church along queen down york back to king due to a collision<br/>Eastbound Elevator at Jane station is out of order<br/>Estimated wait time for subway is 1 minute,The Bloor Danforth Line isn't operating between St George and Broadview due to track maintenance.<br/>504 King Street Car is diverting westbound up church along queen down york back to king due to a collision<br/>Eastbound Elevator at Jane station is out of order<br/>Estimated wait time for subway is 1 minute]]></look>
</object>
<object name="Bench">
<inherit name="editor_object" />
<sit type="string"></sit>
</object>
<exit alias="in" to="Subway Car HP EB">
<inherit name="indirection" />
</exit>
</object>
<verb>
<property>callmom</property>
<pattern>call mom</pattern>
<defaultexpression>"You can't call mom " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>textmom</property>
<pattern>text mom</pattern>
<defaultexpression>"You can't text mom " + object.article + "."</defaultexpression>
</verb>
<object name="Subway Car HP EB">
<inherit name="editor_room" />
<description>The subway isn't too busy there are plenty of seats available.</description>
<enter type="script">
play sound ("TTC Subway Chime Ringtone.mp3", false, false)
msg ("Announcement: Due to track construction the subway will only go as far as St George Station where you can transfer to a shuttle bus to go further east")
EnableTimer (Transportation Time)
Subway Car HP EB.countdown = Subway Car HP EB.countdown - 1
if (Subway Car HP EB.countdown = 3) {
if (exit_Subway Car HP EB.locked) {
exit_Subway Car HP EB.locked = false
exit_Subway Car HP EB.to = St George Station Bloor Danforth Level
Subway Car HP EB.countdown = 10
}
else {
exit_Subway Car HP EB.locked = true
Subway Car HP EB.countdown = 3
}
}
</enter>
<beforeenter type="script">
picture ("6-1.1400800383.what-a-long-subway-car.jpg")
</beforeenter>
<countdown type="int">3</countdown>
<onexit type="script">
play sound ("TTC Subway Chime Ringtone.mp3", false, false)
</onexit>
<object name="Seat">
<inherit name="editor_object" />
<sit type="string"></sit>
</object>
<exit alias="out" to="St George Station Bloor Danforth Level">
<inherit name="outdirection" />
</exit>
</object>
<object name="St George Station Bloor Danforth Level">
<inherit name="editor_room" />
<picture>images.jpeg</picture>
<description>You can use the stairs to go up to go to the yonge university spadina line and go south or you can go up another flight of stairs and take the shuttle bus</description>
<exit alias="up" to="St George Station YUS Level South">
<inherit name="updirection" />
</exit>
<object name="Detour Assistant">
<inherit name="editor_object" />
<inherit name="female" />
<ask>If you want to get to greenwood and gerard you can take the shuttle bus from here to broadview and continue the subway to greenwood or you could go south to Queen's Park and take the streetcar to gerard and greenwood</ask>
<help>If you want to get to greenwood and gerard you can take the shuttle bus from here to broadview and continue the subway to greenwood or you could go south to Queen's Park and take the streetcar to gerard and greenwood</help>
</object>
<exit alias="out" to="Subway Car K EB">
<inherit name="outdirection" />
</exit>
</object>
<object name="Shuttle Bus">
<inherit name="editor_room" />
<picture>Ill-woman-not-let-off-TTC-bus-473x315.jpg</picture>
<description>You are stuffed into the shuttle bus. Hold on tight and don't fall over when the bus starts to move.</description>
<exit alias="out" to="Broadview Station Street Level">
<inherit name="outdirection" />
</exit>
</object>
<object name="High Park Westbound Subway">
<inherit name="editor_room" />
<picture>ls.jpg</picture>
<description>You are waiting for the subway with some other people the subway should be along shortly.</description>
<exit alias="in" to="Subway Car HP WB">
<inherit name="indirection" />
</exit>
</object>
<verb>
<property>look</property>
<pattern>look</pattern>
<defaultexpression>"You can't look " + object.article + "."</defaultexpression>
</verb>
<command />
<object name="St George Station YUS Level South">
<inherit name="editor_room" />
<picture>images-1.jpeg</picture>
<description>This subway platform is pretty busy due to the subway closure as well as it is a station you can transfer to another subway line.</description>
<exit alias="down" to="St George Station Bloor Danforth Level">
<inherit name="downdirection" />
</exit>
<exit alias="up" to="St George Street Level">
<inherit name="updirection" />
</exit>
<exit alias="in" to="Subway Car ST SB">
<inherit name="indirection" />
</exit>
</object>
<object name="St George Street Level">
<inherit name="editor_room" />
<picture>shuttlebus.jpeg</picture>
<description>You see the long line up for a shuttle bus but there is also a line up of buses waiting to pick people up.</description>
<exit alias="down" to="St George Station YUS Level South">
<inherit name="downdirection" />
</exit>
<exit alias="out" to="Shuttle Bus">
<inherit name="outdirection" />
</exit>
</object>
<verb>
<property>ask</property>
<pattern>ask</pattern>
<defaultexpression>"You can't ask " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>help</property>
<pattern>help</pattern>
<defaultexpression>"You can't help " + object.article + "."</defaultexpression>
</verb>
<object name="Broadview Station Street Level">
<inherit name="editor_room" />
<picture>images-6.jpeg</picture>
<description>You arrive at Broadview Station and pile out of the bus with along with everyone else and slowly make your way down to the subway.</description>
<exit alias="east" to="Broadview Station Eastbound">
<inherit name="eastdirection" />
</exit>
<exit alias="west" to="Broadview Station Westbound">
<inherit name="westdirection" />
<locked />
<lockmessage>This way is under constriuction no trains are going west</lockmessage>
<lookonly type="boolean">false</lookonly>
</exit>
</object>
<object name="Broadview Station Eastbound">
<inherit name="editor_room" />
<picture>Unknown-2.jpeg</picture>
<description>You wait for the subway along with a large amount of people.</description>
<exit alias="up" to="Broadview Station Street Level">
<inherit name="updirection" />
</exit>
<exit alias="east" to="Subway Car BV EB">
<inherit name="eastdirection" />
</exit>
</object>
<object name="Broadview Station Westbound">
<inherit name="editor_room" />
<picture>59St.stairs.jpg</picture>
<beforeenter type="script">
picture ("59St.stairs.jpg")
</beforeenter>
<exit alias="east" to="Broadview Station Street Level">
<inherit name="eastdirection" />
</exit>
</object>
<object name="Greenwood Station Subway Level">
<inherit name="editor_room" />
<picture>images-4.jpeg</picture>
<exit alias="west" to="Subway Car ST SB">
<inherit name="westdirection" />
</exit>
<exit alias="up" to="Greenwood Bus Level">
<inherit name="updirection" />
</exit>
</object>
<object name="Greenwood Bus Level">
<inherit name="editor_room" />
<picture>images-5.jpeg</picture>
<exit alias="out" to="Thirty One Greenwood Bus">
<inherit name="outdirection" />
</exit>
<exit alias="down" to="Greenwood Station Subway Level">
<inherit name="downdirection" />
</exit>
<exit alias="south" to="Gerard Greenwood">
<inherit name="southdirection" />
</exit>
</object>
<object name="Thirty One Greenwood Bus">
<inherit name="editor_room" />
<description>You get on the bus, it isn't too busy you grab a seat and wait for your stop.</description>
<exit alias="in" to="Greenwood Bus Level">
<inherit name="indirection" />
</exit>
<object name="Bus Seat">
<inherit name="editor_object" />
<alias>Seat</alias>
<sit>Ah, it's nice to sit down</sit>
<look type="script">
picture ("inside bus.jpeg")
</look>
</object>
</object>
<object name="Subway Car BV EB">
<inherit name="editor_room" />
<picture>ttc-subway-5.jpg</picture>
<enter type="script">
play sound ("TTC Subway Chime Ringtone.mp3", false, false)
</enter>
<exit alias="east" to="Greenwood Station Subway Level">
<inherit name="eastdirection" />
</exit>
</object>
<object name="Subway Car ST SB">
<inherit name="editor_room" />
<picture>TTC-5411-TR-interior-StGeorgeSubway-MrDanMofo.jpg</picture>
<enter type="script">
play sound ("TTC Subway Chime Ringtone.mp3", false, false)
</enter>
<exit alias="south" to="Queens Park Station Subway Level">
<inherit name="southdirection" />
</exit>
</object>
<object name="Queens Park Station Subway Level">
<inherit name="editor_room" />
<picture>images-3.jpeg</picture>
<exit alias="up" to="Queens Park Station Street Level">
<inherit name="updirection" />
</exit>
</object>
<object name="FiveZeroSix Main Street Station Street Car">
<inherit name="editor_room" />
<picture>Unknown-1.jpeg</picture>
<enter type="script">
msg ("ANNOUNCEMENT: This streetcar will be short turning at Coxwell and Gerard going south to Queen")
</enter>
<exit alias="out" to="Gerard Greenwood">
<inherit name="outdirection" />
</exit>
</object>
<object name="FiveZeroSix High Park Street Car">
<inherit name="editor_room" />
<picture>2801885108_c3e7a706d5.jpg</picture>
</object>
<object name="Queens Park Station Street Level">
<inherit name="editor_room" />
<picture>220px-QP_TTC_NE_entrance.jpg</picture>
<exit alias="east" to="FiveZeroSix Main Street Station Street Car">
<inherit name="eastdirection" />
</exit>
<exit alias="west" to="FiveZeroSix High Park Street Car">
<inherit name="westdirection" />
</exit>
<exit alias="down" to="Queens Park Station Subway Level">
<inherit name="downdirection" />
</exit>
</object>
<object name="Gerard Greenwood">
<inherit name="editor_room" />
<enter type="script">
finish
msg ("You've made it home!")
picture ("exterior-2.jpg")
if (not IsSwitchedOn(your cellphone)) {
msg ("Mom: Why didn't you let me know you left?")
}
else if (IsSwitchedOn(your cellphone)) {
msg ("Mom: I'm so glad you made it home safe!")
}
</enter>
</object>
<verb>
<property>takemap</property>
<pattern>take map</pattern>
<defaultexpression>"You can't take map " + object.article + "."</defaultexpression>
</verb>
<object name="Kipling Station Subway Platform">
<inherit name="editor_room" />
<picture>68575641_78e18e4290.jpg</picture>
<description>You've reached Kipling Station! You have come all the way west when you wanted to go east, why not ask someone for help you see a TTC Employee.</description>
<exit alias="in" to="Subway Car HP WB">
<inherit name="indirection" />
</exit>
<object name="TTC Employee">
<inherit name="editor_object" />
<inherit name="male" />
<ask>If you want to go to Gerard and Greenwood you need to take the subway east but you are going to have to take the shuttle bus at St George due to construction on the tracks.</ask>
</object>
</object>
<object name="Subway Car K EB">
<inherit name="editor_room" />
<enter type="script">
play sound ("TTC Subway Chime Ringtone.mp3", false, false)
</enter>
<exit alias="in" to="St George Station Bloor Danforth Level">
<inherit name="indirection" />
</exit>
</object>
<object name="Subway Car HP WB">
<inherit name="editor_room" />
<enter type="script">
play sound ("TTC Subway Chime Ringtone.mp3", false, false)
</enter>
<exit alias="out" to="Kipling Station Subway Platform">
<inherit name="outdirection" />
</exit>
</object>
<function name="countdown" parameters="3" type="int">
</function>
<walkthrough name="win game" />
<timer name="Transportation Time">
<interval>10</interval>
</timer>
</asl>

jaynabonne
01 Jan 2015, 23:39
Yep, that was it. And it helps.

The reason you're getting that error is because your Transportation Timer has no script. So when Quest goes to run it, it generates that error when it tries to access the script. You need to go in and create the script that you want it to run. (I suspect it's the code that's in the "enter" script for the Subway Car HP EB room following the "EnableTimer" call, but I'm not sure.)

KTwiss
01 Jan 2015, 23:45
what is the script I'm suppose to put in there?

jaynabonne
01 Jan 2015, 23:52
Right now, your "enter" script for the room looks like this:

    <enter type="script">
play sound ("TTC Subway Chime Ringtone.mp3", false, false)
msg ("Announcement: Due to track construction the subway will only go as far as St George Station where you can transfer to a shuttle bus to go further east")
EnableTimer (Transportation Time)
Subway Car HP EB.countdown = Subway Car HP EB.countdown - 1
if (Subway Car HP EB.countdown = 3) {
if (exit_Subway Car HP EB.locked) {
exit_Subway Car HP EB.locked = false
exit_Subway Car HP EB.to = St George Station Bloor Danforth Level
Subway Car HP EB.countdown = 10
}
else {
exit_Subway Car HP EB.locked = true
Subway Car HP EB.countdown = 3
}
}
</enter>

I think you want to take all the code after the EnableTimer and put it in the timer itself. This:
     Subway Car HP EB.countdown = Subway Car HP EB.countdown - 1
if (Subway Car HP EB.countdown = 3) {
if (exit_Subway Car HP EB.locked) {
exit_Subway Car HP EB.locked = false
exit_Subway Car HP EB.to = St George Station Bloor Danforth Level
Subway Car HP EB.countdown = 10
}
else {
exit_Subway Car HP EB.locked = true
Subway Car HP EB.countdown = 3
}
}

So the enter script would just end up being:
    <enter type="script">
play sound ("TTC Subway Chime Ringtone.mp3", false, false)
msg ("Announcement: Due to track construction the subway will only go as far as St George Station where you can transfer to a shuttle bus to go further east")
EnableTimer (Transportation Time)
</enter>

KTwiss
01 Jan 2015, 23:59
this feels so super complicated!!! still getting this error Error running script: Error compiling expression 'exit_Subway Car HP EB.locked': Unknown object or variable 'exit_Subway Car HP EB'
I feel lost not sure what to do

jaynabonne
02 Jan 2015, 00:03
You need to have an exit with that name. There is an exit leading out of the car to "St George Station Bloor Danforth Level". If you click on that exit and give it the name "exit_Subway Car HP EB" (enter it in the "Name" field under Suffix), then it might work better. (I'm sorry I'm being vague, but I'm coming into this code a little cold myself.)

KTwiss
02 Jan 2015, 00:05
some help is better than none, a coworker said he was going to help yesterday but never got to me

KTwiss
02 Jan 2015, 00:06
does the lock box need to be checked or is that what the timer is doing?

KTwiss
02 Jan 2015, 00:09
didn't work still have Error running script: Error compiling expression 'exit_Subway Car HP EB.locked': Unknown object or variable 'exit_Subway Car HP EB'
even with the locked box checked

jaynabonne
02 Jan 2015, 00:14
It's not the locked part. It can't find an exit with that name. Have you given the exit that name? If you think so, then it might help to post the code again.

KTwiss
02 Jan 2015, 00:16
on the screen it says exit: Subway Car HP EB

KTwiss
02 Jan 2015, 00:16
<!--Saved by Quest 5.5.5328.26617-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="TTC Adventure">
<gameid>0ed9fa3a-79d3-4dd5-b2ee-6ada3ac07ea5</gameid>
<version>1.0</version>
<firstpublished>2014</firstpublished>
<subtitle>Delays and Detours</subtitle>
<author>Krystal Twiss</author>
<category>Simulation</category>
<cover>images.png</cover>
<menufont>Georgia, serif</menufont>
<description>About making different choices on TTC when faced with delays or detours</description>
<difficulty>Medium</difficulty>
<feature_pictureframe />
<menufontsize type="int">15</menufontsize>
<gridmap type="boolean">false</gridmap>
<cruelty>Polite</cruelty>
<appendobjectdescription />
<mapsize type="int">150</mapsize>
<showlocation />
<attr name="autodescription_youarein_useprefix" type="boolean">false</attr>
<autodescription />
</game>
<object name="Friends room">
<inherit name="editor_room" />
<description>Your friend's room is a bit messy, your stuff is all packed up to head home because you need to go and help family. You live at Gerard and Greenwood and your friend lives near High Park Station.</description>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
<object name="computer">
<inherit name="editor_object" />
<checkttcwebsite>The Bloor Danforth Line isn't operating between St George and Broadview due to track maintenance. 504 King Street Car is diverting westbound up church along queen down york back to king due to a collision Eastbound Elevator at Jane station is out of order</checkttcwebsite>
<checkfacebook>Facebook Message From Mom: Come Home Soon</checkfacebook>
</object>
<exit name="leave friends" alias="down" to="High Park Station">
<inherit name="southdirection" />
<locked />
<lockmessage>Make sure I have everything</lockmessage>
</exit>
<object name="your cellphone">
<inherit name="editor_object" />
<inherit name="switchable" />
<take />
<textmom>I'm on my way</textmom>
<feature_switchable />
<switchonmsg>your cellphone is on</switchonmsg>
<switchoffmsg>your cellphone is off</switchoffmsg>
<ontake type="script">
if (Got(Backpack)) {
}
UnlockExit (leave friends)
</ontake>
</object>
<object name="Backpack">
<inherit name="editor_object" />
<take />
<takemsg>Don't want to forget my stuff</takemsg>
<dropmsg>that was heavy</dropmsg>
<ontake type="script">
if (Got(your cellphone)) {
}
UnlockExit (leave friends)
</ontake>
<object name="clothes">
<inherit name="editor_object" />
</object>
<object name="MP3 Player">
<inherit name="editor_object" />
</object>
<object name="metropass">
<inherit name="editor_object" />
</object>
<object name="granola bar">
<inherit name="editor_object" />
<feature_edible />
</object>
</object>
</object>
<verb>
<property>checkttcwebsite</property>
<pattern>check ttc website</pattern>
<defaultexpression>"You can't check ttc website " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>checkfacebook</property>
<pattern>check facebook</pattern>
<defaultexpression>"You can't check facebook " + object.article + "."</defaultexpression>
</verb>
<object name="High Park Station">
<inherit name="editor_room" />
<picture>300px-Highparkstation1.jpg</picture>
<exit alias="up" to="Friends room">
<inherit name="updirection" />
</exit>
<exit alias="east" to="High Park Eastbound Subway Platform">
<inherit name="eastdirection" />
</exit>
<object name="Service Alert Board">
<inherit name="editor_object" />
<look><![CDATA[The Bloor Danforth Line isn't operating between St George and Broadview due to track maintenance.<br/>504 King Street Car is diverting westbound up church along queen down york back to king due to a collision<br/>Eastbound Elevator at Jane station is out of order]]></look>
</object>
<object name="TTC Worker">
<inherit name="editor_object" />
<inherit name="male" />
<drop type="boolean">false</drop>
<feature_usegive />
<givesingle type="boolean">false</givesingle>
<speak>Do you need any help?</speak>
<look type="script">
picture ("cust.jpg")
</look>
<takemap type="script">
AddToInventory (TTC Map)
</takemap>
<giveto type="scriptdictionary" />
<give type="scriptdictionary">
<item key="TTC Map">
</item>
</give>
<object name="TTC Map">
<inherit name="editor_object" />
<listalias>TTC Map</listalias>
<take />
<takemsg>Here, Just in case</takemsg>
<dropmsg>I dropped my map</dropmsg>
<look type="script">
picture ("Subway_Map.jpg")
</look>
</object>
</object>
<exit alias="west" to="High Park Westbound Subway" />
</object>
<object name="High Park Eastbound Subway Platform">
<inherit name="editor_room" />
<description>A bunch of other people are waiting for the subway with you</description>
<picture>ls.jpg</picture>
<enter type="script">
</enter>
<onexit type="script">
</onexit>
<object name="Service Alert Board2">
<inherit name="editor_object" />
<alias>Service Alert Board</alias>
<look><![CDATA[The Bloor Danforth Line isn't operating between St George and Broadview due to track maintenance.<br/>504 King Street Car is diverting westbound up church along queen down york back to king due to a collision<br/>Eastbound Elevator at Jane station is out of order<br/>Estimated wait time for subway is 1 minute,The Bloor Danforth Line isn't operating between St George and Broadview due to track maintenance.<br/>504 King Street Car is diverting westbound up church along queen down york back to king due to a collision<br/>Eastbound Elevator at Jane station is out of order<br/>Estimated wait time for subway is 1 minute]]></look>
</object>
<object name="Bench">
<inherit name="editor_object" />
<sit type="string"></sit>
</object>
<exit alias="in" to="Subway Car HP EB">
<inherit name="indirection" />
</exit>
</object>
<verb>
<property>callmom</property>
<pattern>call mom</pattern>
<defaultexpression>"You can't call mom " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>textmom</property>
<pattern>text mom</pattern>
<defaultexpression>"You can't text mom " + object.article + "."</defaultexpression>
</verb>
<object name="Subway Car HP EB">
<inherit name="editor_room" />
<description>The subway isn't too busy there are plenty of seats available.</description>
<countdown type="int">3</countdown>
<enter type="script">
play sound ("TTC Subway Chime Ringtone.mp3", false, false)
EnableTimer (Transportation Time)
msg ("Announcement: Due to track construction the subway will only go as far as St George Station where you can transfer to a shuttle bus to go further east")
Subway Car HP EB.countdown = Subway Car HP EB.countdown - 1
if (Subway Car HP EB.countdown = 3) {
if (exit_Subway Car HP EB.locked) {
exit_Subway Car HP EB.locked = false
exit_Subway Car HP EB.to = St George Station Bloor Danforth Level
Subway Car HP EB.countdown = 10
}
else {
exit_Subway Car HP EB.locked = true
Subway Car HP EB.countdown = 3
}
}
</enter>
<beforeenter type="script">
picture ("6-1.1400800383.what-a-long-subway-car.jpg")
</beforeenter>
<onexit type="script">
play sound ("TTC Subway Chime Ringtone.mp3", false, false)
</onexit>
<object name="Seat">
<inherit name="editor_object" />
<sit type="string"></sit>
</object>
<exit alias="out" to="St George Station Bloor Danforth Level">
<inherit name="outdirection" />
<suffix>exit_Subway Car HP EB</suffix>
<locked type="boolean">false</locked>
</exit>
</object>
<object name="St George Station Bloor Danforth Level">
<inherit name="editor_room" />
<picture>images.jpeg</picture>
<description>You can use the stairs to go up to go to the yonge university spadina line and go south or you can go up another flight of stairs and take the shuttle bus</description>
<exit alias="up" to="St George Station YUS Level South">
<inherit name="updirection" />
</exit>
<object name="Detour Assistant">
<inherit name="editor_object" />
<inherit name="female" />
<ask>If you want to get to greenwood and gerard you can take the shuttle bus from here to broadview and continue the subway to greenwood or you could go south to Queen's Park and take the streetcar to gerard and greenwood</ask>
<help>If you want to get to greenwood and gerard you can take the shuttle bus from here to broadview and continue the subway to greenwood or you could go south to Queen's Park and take the streetcar to gerard and greenwood</help>
</object>
<exit alias="out" to="Subway Car K EB">
<inherit name="outdirection" />
</exit>
</object>
<object name="Shuttle Bus">
<inherit name="editor_room" />
<picture>Ill-woman-not-let-off-TTC-bus-473x315.jpg</picture>
<description>You are stuffed into the shuttle bus. Hold on tight and don't fall over when the bus starts to move.</description>
<exit alias="out" to="Broadview Station Street Level">
<inherit name="outdirection" />
</exit>
</object>
<object name="High Park Westbound Subway">
<inherit name="editor_room" />
<picture>ls.jpg</picture>
<description>You are waiting for the subway with some other people the subway should be along shortly.</description>
<enter type="script">
play sound ("TTC Subway Chime Ringtone.mp3", false, false)
</enter>
<onexit type="script">
play sound ("TTC Subway Chime Ringtone.mp3", false, false)
</onexit>
<exit alias="in" to="Subway Car HP WB">
<inherit name="indirection" />
</exit>
</object>
<verb>
<property>look</property>
<pattern>look</pattern>
<defaultexpression>"You can't look " + object.article + "."</defaultexpression>
</verb>
<command />
<object name="St George Station YUS Level South">
<inherit name="editor_room" />
<picture>images-1.jpeg</picture>
<description>This subway platform is pretty busy due to the subway closure as well as it is a station you can transfer to another subway line.</description>
<exit alias="down" to="St George Station Bloor Danforth Level">
<inherit name="downdirection" />
</exit>
<exit alias="up" to="St George Street Level">
<inherit name="updirection" />
</exit>
<exit alias="in" to="Subway Car ST SB">
<inherit name="indirection" />
</exit>
</object>
<object name="St George Street Level">
<inherit name="editor_room" />
<picture>shuttlebus.jpeg</picture>
<description>You see the long line up for a shuttle bus but there is also a line up of buses waiting to pick people up.</description>
<exit alias="down" to="St George Station YUS Level South">
<inherit name="downdirection" />
</exit>
<exit alias="out" to="Shuttle Bus">
<inherit name="outdirection" />
</exit>
</object>
<verb>
<property>ask</property>
<pattern>ask</pattern>
<defaultexpression>"You can't ask " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>help</property>
<pattern>help</pattern>
<defaultexpression>"You can't help " + object.article + "."</defaultexpression>
</verb>
<object name="Broadview Station Street Level">
<inherit name="editor_room" />
<picture>images-6.jpeg</picture>
<description>You arrive at Broadview Station and pile out of the bus with along with everyone else and slowly make your way down to the subway.</description>
<exit alias="east" to="Broadview Station Eastbound">
<inherit name="eastdirection" />
</exit>
<exit alias="west" to="Broadview Station Westbound">
<inherit name="westdirection" />
<locked />
<lockmessage>This way is under constriuction no trains are going west</lockmessage>
<lookonly type="boolean">false</lookonly>
</exit>
</object>
<object name="Broadview Station Eastbound">
<inherit name="editor_room" />
<picture>Unknown-2.jpeg</picture>
<description>You wait for the subway along with a large amount of people.</description>
<exit alias="up" to="Broadview Station Street Level">
<inherit name="updirection" />
</exit>
<exit alias="east" to="Subway Car BV EB">
<inherit name="eastdirection" />
</exit>
</object>
<object name="Broadview Station Westbound">
<inherit name="editor_room" />
<picture>59St.stairs.jpg</picture>
<beforeenter type="script">
picture ("59St.stairs.jpg")
</beforeenter>
<exit alias="east" to="Broadview Station Street Level">
<inherit name="eastdirection" />
</exit>
</object>
<object name="Greenwood Station Subway Level">
<inherit name="editor_room" />
<picture>images-4.jpeg</picture>
<exit alias="west" to="Subway Car ST SB">
<inherit name="westdirection" />
</exit>
<exit alias="up" to="Greenwood Bus Level">
<inherit name="updirection" />
</exit>
</object>
<object name="Greenwood Bus Level">
<inherit name="editor_room" />
<picture>images-5.jpeg</picture>
<exit alias="out" to="Thirty One Greenwood Bus">
<inherit name="outdirection" />
</exit>
<exit alias="down" to="Greenwood Station Subway Level">
<inherit name="downdirection" />
</exit>
<exit alias="south" to="Gerard Greenwood">
<inherit name="southdirection" />
</exit>
</object>
<object name="Thirty One Greenwood Bus">
<inherit name="editor_room" />
<description>You get on the bus, it isn't too busy you grab a seat and wait for your stop.</description>
<exit alias="in" to="Greenwood Bus Level">
<inherit name="indirection" />
</exit>
<object name="Bus Seat">
<inherit name="editor_object" />
<alias>Seat</alias>
<sit>Ah, it's nice to sit down</sit>
<look type="script">
picture ("inside bus.jpeg")
</look>
</object>
</object>
<object name="Subway Car BV EB">
<inherit name="editor_room" />
<picture>ttc-subway-5.jpg</picture>
<enter type="script">
play sound ("TTC Subway Chime Ringtone.mp3", false, false)
</enter>
<onexit type="script">
play sound ("TTC Subway Chime Ringtone.mp3", false, false)
</onexit>
<exit alias="east" to="Greenwood Station Subway Level">
<inherit name="eastdirection" />
</exit>
</object>
<object name="Subway Car ST SB">
<inherit name="editor_room" />
<picture>TTC-5411-TR-interior-StGeorgeSubway-MrDanMofo.jpg</picture>
<enter type="script">
play sound ("TTC Subway Chime Ringtone.mp3", false, false)
</enter>
<exit alias="south" to="Queens Park Station Subway Level">
<inherit name="southdirection" />
</exit>
</object>
<object name="Queens Park Station Subway Level">
<inherit name="editor_room" />
<picture>images-3.jpeg</picture>
<exit alias="up" to="Queens Park Station Street Level">
<inherit name="updirection" />
</exit>
</object>
<object name="FiveZeroSix Main Street Station Street Car">
<inherit name="editor_room" />
<picture>Unknown-1.jpeg</picture>
<enter type="script">
msg ("ANNOUNCEMENT: This streetcar will be short turning at Coxwell and Gerard going south to Queen")
</enter>
<exit alias="out" to="Gerard Greenwood">
<inherit name="outdirection" />
</exit>
</object>
<object name="FiveZeroSix High Park Street Car">
<inherit name="editor_room" />
<picture>2801885108_c3e7a706d5.jpg</picture>
</object>
<object name="Queens Park Station Street Level">
<inherit name="editor_room" />
<picture>220px-QP_TTC_NE_entrance.jpg</picture>
<exit alias="east" to="FiveZeroSix Main Street Station Street Car">
<inherit name="eastdirection" />
</exit>
<exit alias="west" to="FiveZeroSix High Park Street Car">
<inherit name="westdirection" />
</exit>
<exit alias="down" to="Queens Park Station Subway Level">
<inherit name="downdirection" />
</exit>
</object>
<object name="Gerard Greenwood">
<inherit name="editor_room" />
<enter type="script">
finish
msg ("You've made it home!")
picture ("exterior-2.jpg")
if (not IsSwitchedOn(your cellphone)) {
msg ("Mom: Why didn't you let me know you left?")
}
else if (IsSwitchedOn(your cellphone)) {
msg ("Mom: I'm so glad you made it home safe!")
}
</enter>
</object>
<verb>
<property>takemap</property>
<pattern>take map</pattern>
<defaultexpression>"You can't take map " + object.article + "."</defaultexpression>
</verb>
<object name="Kipling Station Subway Platform">
<inherit name="editor_room" />
<picture>68575641_78e18e4290.jpg</picture>
<description>You've reached Kipling Station! You have come all the way west when you wanted to go east, why not ask someone for help you see a TTC Employee.</description>
<exit alias="in" to="Subway Car HP WB">
<inherit name="indirection" />
</exit>
<object name="TTC Employee">
<inherit name="editor_object" />
<inherit name="male" />
<ask>If you want to go to Gerard and Greenwood you need to take the subway east but you are going to have to take the shuttle bus at St George due to construction on the tracks.</ask>
</object>
</object>
<object name="Subway Car K EB">
<inherit name="editor_room" />
<enter type="script">
play sound ("TTC Subway Chime Ringtone.mp3", false, false)
</enter>
<onexit type="script">
play sound ("TTC Subway Chime Ringtone.mp3", false, false)
</onexit>
<exit alias="in" to="St George Station Bloor Danforth Level">
<inherit name="indirection" />
</exit>
</object>
<object name="Subway Car HP WB">
<inherit name="editor_room" />
<enter type="script">
play sound ("TTC Subway Chime Ringtone.mp3", false, false)
</enter>
<onexit type="script">
play sound ("TTC Subway Chime Ringtone.mp3", false, false)
</onexit>
<exit alias="out" to="Kipling Station Subway Platform">
<inherit name="outdirection" />
</exit>
</object>
<function name="countdown" parameters="3" type="int">
</function>
<walkthrough name="win game" />
<timer name="Transportation Time">
<interval>10</interval>
<script>
if (exit_Subway Car HP EB.locked) {
exit_Subway Car HP EB.locked = false
exit_Subway Car HP EB.to = St George Station Bloor Danforth Level
Subway Car HP EB.countdown = 10
}
else {
exit_Subway Car HP EB.locked = true
Subway Car HP EB.countdown = 3
}
</script>
</timer>
</asl>

jaynabonne
02 Jan 2015, 00:23
I see I confused you. Let me try again, but clearer:

Put the name "exit_Subway Car HP EB" in the *Name* field. (I only mentioned Suffix to help you locate the Name field. But you need to put the name in the Name field. :) You put it in the Suffix field.)

KTwiss
02 Jan 2015, 00:26
ok so no errors are popping up but it isn't locked

jaynabonne
02 Jan 2015, 00:33
Assuming I've read the code right... it should lock the exit after 30 seconds (3 countdown * 10 seconds). Then it will unlock the exit again after 100 more seconds (10*10 seconds). You can adjust that by either changing the countdown values or by changing the timer interval.

KTwiss
02 Jan 2015, 00:40
there aren't any *s in my code are there?

jaynabonne
02 Jan 2015, 00:52
I was looking at the wrong piece of code. The idea is that the code counts down (or should). But what's in your timer script doesn't even bother with the counter. So basically, it locks and unlocks the exit every 10 seconds. You might want to put some print messages in the "if" and "else" for the timer script so you can know when the exit locks and unlocks. In the "if" case, you could say something like "The doors open.", and in the else "The doors close."

I see this code as just being a really rudimentary beginning. I doubt you want the doors to just open and close over and over without some more descriptive text (e.g. that the train actually begins motion, comes to a stop, etc).

KTwiss
02 Jan 2015, 00:59
i'm still really confused as what to put where i get what the else and else if is about as you can see from my backpack and cellphone at the beginning I still don't get how to use the timer or why this isn't working I'm going to take a break now and try again tomorrow. Thanks for trying Jaynabonne

HegemonKhan
02 Jan 2015, 04:40
the 'else if' and 'else' are actually a part of the 'if' Script:

run as script -> add a~new script -> scripts -> 'if' Script -> (choose what choice in the drop down box) -> (see below)*
-> then, -> add a script
else if, -> (choose what choice in the drop down box) -> (see below)*
-> then, -> add a script
else,
-> add a script

* if you choose (if) [EXPRESSION] for your drop down box choice, then you can type in what you want (if you're not afraid of code), see below:

Object_name.Attribute_name = Value_or_Expression

example1: player.strength_integer = 5
example2: orc.dead_boolean = false
example3: HK.hair_color_string = "dark brown"

Object (Name): orc
Verb: fight
if [EXPRESSION] orc.dead = false
-> orc.dead = true
-> msg ("You attack and kill the orc.")
else if [EXPRESSION] orc.dead = true
-> msg ("The orc is already dead, silly.")

if (xxx) {
// script1
} else if (xxx) {
// script2
] else if (xxx) {
// script3
] else if (xxx) {
// script4
] else if (xxx) {
// script5
// etc more or less: 'else ifs'
} else {
// script6
}


------------------

these two SUPER scripts, especially when used together, let's you do 90% of what you want:

1. Attributes: the 'set a variable or attribute' Script

run as script -> add a~new script -> variables -> 'set a variable or attribute' -> (see below)

Object_name.Attribute_name = Value_or_Expression

example1: player.strength_integer = 5
example2: orc.dead_boolean = false
example3: HK.hair_color_string = "dark brown"
example4: player.damage = player.weapon_damage + player.weapon_damage * player.strength / 100 - orc.defense - orc.defense * orc.endurance / 100
example5: HK.favorite_colors_stringlist = split ("black;red", ";")
example:6: player.damage_double = 29.1391

2. the 'if' script (if~else if~else):

run as script -> add a~new script -> scripts -> 'if' Script -> [EXPRESSION] -> Object_name.Attribute_name = Value_or_Expression

------

show menu ("What do you want to eat?", split ("apple;banana;other", ";"), false) {
// for the 'show menu' Script, the quest engine automatically (hidden from you) sets: result = your_selected_choice
// conceptually (algebra): game.food = result = your_selected_choice -> game.food = your_selected_choice
game.food = result
if (game.food = "apple") {
msg ("You eat the red apple.")
} else if (game.food = "banana") {
msg ("You eat the yellow banana.")
} else {
msg ("You eat a hamburger.")
}
}


------

hopefully this helps some, and ask if you got any questions! :D

------

P.S.

don't worry about all the error messages you're getting, as most of the time, they're just simple small mistakes you made when trying to script or code. Easy to fix, but hard to spot~find, lol.

think of scripting~coding as a book, and if that book has a single typo in it, you'll get an error message, and be unable to open and read the book, lol.

-------

p.s.s.

when you post code, use this posting code tag:

[code.](your pasted code)[/code.]

but without the dots~periods in the brackets, which will create this text box in your post:

(your pasted code)


as, otherwise, as you can see from your posts, they're very long... lol.

jaynabonne
02 Jan 2015, 10:32
To answer your question, I'm referring to the script in your timer. It's quite possible it is actually working (or doing something), but you're not printing anything, so it's hard to tell. It's just silently locking and unlocking the exit. Putting some text in will help you to at least see what the code is doing. (I often do that temporarily in code and then take the prints back out later. It just allows you to visualize the paths the code is taking.)

if (exit_Subway Car HP EB.locked) {
exit_Subway Car HP EB.locked = false
exit_Subway Car HP EB.to = St George Station Bloor Danforth Level
Subway Car HP EB.countdown = 10
}
else {
exit_Subway Car HP EB.locked = true
Subway Car HP EB.countdown = 3
}

The "if" here has code that is run when the exit is locked. It then unlocks the exit. I was saying you might want to put a message in there to the effect of "The doors are opening", so that the player (and you) will know the exit can now be traversed.

Similarly, the "else" is what happens when the exit is not locked ("if locked do this, else do that"). In that case, the script locks the exit. So you probably want a print message in there as well letting the player know the world state has changed and the train doors are now closed.

if (exit_Subway Car HP EB.locked) {
exit_Subway Car HP EB.locked = false
exit_Subway Car HP EB.to = St George Station Bloor Danforth Level
Subway Car HP EB.countdown = 10
msg("The doors slide open with a soft hiss.")
}
else {
exit_Subway Car HP EB.locked = true
Subway Car HP EB.countdown = 3
msg("The train doors slide shut.")
}


Keep in mind that trying to simulate a train is not a trivial thing. You need to deal with things on a lower level (locking/unlocking exits, reassigning exits to new stations when you arrive, tracking which stations are in which order, etc.) The PIxie has given you some initial code, but you're going to need to take it from there to fully flesh it out. One thing that would help would be for you to have a complete design at least in your head of what you're trying to do. For example, knowing what you want the player to see at what time and all that would be a big help. (I've attempted to guide you toward at least getting some text output when the doors open and close. But does the player see that the train is moving, etc?)