Vehicle - Move Object 'you' to 'room' and 'print message after 6 seconds'
Grids
20 Jul 2015, 10:05Hi,
I am creating an 80s-inspired, retro-future text adventure and was wondering if anyone could please help me out at all.
I am having trouble with using a vehicle in one instance within the game.
The vehicle (Lamborghini) is set up as a room but I don't have any exits listed. When I want the player to go somewhere I just use Move Object (You) and Move Object (Lamborghini) to whatever room I want them to go to. 'You' is the name for the player.
Essentially the player needs a large amethyst for a weird time machine thingy (as you do).
The player drives to the Jeweller Shop.
He must either talk to the man about the Amethyst or look in the casing to make the Amethyst visible in the room. Then he asks the Jeweller man about the prestige range of diamonds. The Jeweller man leaves for the backroom of the shop. You then have 6 seconds to quickly type - break glass. If you do this you run off with the Amethyst and get back into the car. If the man returns you cannot take the Amethyst.
In most scenes where I go back to the car I can press 'drive car to Jeweller' or 'drive car to Timephase Corp' or 'drive car to beach' and it will drive. But in this instance I cannot drive anywhere and I am wondering what is going on. I am wondering if there is something weird going on with the 'set timeout' and that script still running in the 'Jeweller' room whilst the player has moved to the 'Lamborghini' room
Here is a code snippet for the car:
<object name="Lamborghini">
<inherit name="editor_object" />
<alt type="stringlist">
<value>Car</value>
<value>Vehicle</value>
<value>Lamborgini</value>
</alt>
<look type="script">
msg ("You relax into the leather seat and put on a pair of Ray Bans sitting on the dash. ")
</look>
<drive type="script">
msg ("Turning the key in the ignition, the car purrs to life. Where would you like to drive?")
get input {
if (IsRegexMatch ("(xavier|timephase)", LCase (result))) {
MoveObject (Lamborghini, TP Corp Entrance)
MoveObject (You, TP Corp Entrance)
}
else if (IsRegexMatch ("(beach)", LCase (result))) {
MoveObject (Lamborghini, Beach)
MoveObject (You, Beach)
}
else if (IsRegexMatch ("(jeweller|captivate)", LCase (result))) {
MoveObject (Lamborghini, Jeweller)
MoveObject (You, Jeweller)
}
else {
msg ("You can't drive there. You step out of the vehicle and think about where you'd like to drive.")
}
}
</drive>
Here is a snippet of code for the Prestige Range of Diamonds
<item key="prestige Prestige ">
msg ("They are a simpy exquisite range of diamonds. I will go and get them for you now.")
MoveObject (Man, Jewellery Back Room)
SetTimeout (6) {
if (Got(Amethyst)) {
msg ("You see the man. He starts screaming as he sees you carrying the Amethyst")
MoveObject (You, Lamborghini)
}
else if (not Got(Amethyst)) {
msg ("The gentleman returns with a case containing dazzling diamonds")
MakeObjectVisible (prestige)
}
}
</item>
Here is the script for breaking the glass casing.
<alias>Glass Casing</alias>
<break type="script">
if (not ListContains(ScopeVisible(), Man)) {
msg ("\"I'm sorry but this is for the future of Planet Earth!\" you whisper to yourself.You raise your fist and pound it down upon the casing that is protecting the Amethyst. Shards of glass spray across the room. You clutch the heavy, purple stone in your hands and bolt for the door. You hear sirens blazing as you dive into the Lamborghini.")
MoveObject (You, Lamborghini)
}
else {
msg ("That would be crazy. The gentleman is in the same room as you, watching your every move.")
}
</break>
I am creating an 80s-inspired, retro-future text adventure and was wondering if anyone could please help me out at all.
I am having trouble with using a vehicle in one instance within the game.
The vehicle (Lamborghini) is set up as a room but I don't have any exits listed. When I want the player to go somewhere I just use Move Object (You) and Move Object (Lamborghini) to whatever room I want them to go to. 'You' is the name for the player.
Essentially the player needs a large amethyst for a weird time machine thingy (as you do).
The player drives to the Jeweller Shop.
He must either talk to the man about the Amethyst or look in the casing to make the Amethyst visible in the room. Then he asks the Jeweller man about the prestige range of diamonds. The Jeweller man leaves for the backroom of the shop. You then have 6 seconds to quickly type - break glass. If you do this you run off with the Amethyst and get back into the car. If the man returns you cannot take the Amethyst.
In most scenes where I go back to the car I can press 'drive car to Jeweller' or 'drive car to Timephase Corp' or 'drive car to beach' and it will drive. But in this instance I cannot drive anywhere and I am wondering what is going on. I am wondering if there is something weird going on with the 'set timeout' and that script still running in the 'Jeweller' room whilst the player has moved to the 'Lamborghini' room
Here is a code snippet for the car:
<object name="Lamborghini">
<inherit name="editor_object" />
<alt type="stringlist">
<value>Car</value>
<value>Vehicle</value>
<value>Lamborgini</value>
</alt>
<look type="script">
msg ("You relax into the leather seat and put on a pair of Ray Bans sitting on the dash. ")
</look>
<drive type="script">
msg ("Turning the key in the ignition, the car purrs to life. Where would you like to drive?")
get input {
if (IsRegexMatch ("(xavier|timephase)", LCase (result))) {
MoveObject (Lamborghini, TP Corp Entrance)
MoveObject (You, TP Corp Entrance)
}
else if (IsRegexMatch ("(beach)", LCase (result))) {
MoveObject (Lamborghini, Beach)
MoveObject (You, Beach)
}
else if (IsRegexMatch ("(jeweller|captivate)", LCase (result))) {
MoveObject (Lamborghini, Jeweller)
MoveObject (You, Jeweller)
}
else {
msg ("You can't drive there. You step out of the vehicle and think about where you'd like to drive.")
}
}
</drive>
Here is a snippet of code for the Prestige Range of Diamonds
<item key="prestige Prestige ">
msg ("They are a simpy exquisite range of diamonds. I will go and get them for you now.")
MoveObject (Man, Jewellery Back Room)
SetTimeout (6) {
if (Got(Amethyst)) {
msg ("You see the man. He starts screaming as he sees you carrying the Amethyst")
MoveObject (You, Lamborghini)
}
else if (not Got(Amethyst)) {
msg ("The gentleman returns with a case containing dazzling diamonds")
MakeObjectVisible (prestige)
}
}
</item>
Here is the script for breaking the glass casing.
<alias>Glass Casing</alias>
<break type="script">
if (not ListContains(ScopeVisible(), Man)) {
msg ("\"I'm sorry but this is for the future of Planet Earth!\" you whisper to yourself.You raise your fist and pound it down upon the casing that is protecting the Amethyst. Shards of glass spray across the room. You clutch the heavy, purple stone in your hands and bolt for the door. You hear sirens blazing as you dive into the Lamborghini.")
MoveObject (You, Lamborghini)
}
else {
msg ("That would be crazy. The gentleman is in the same room as you, watching your every move.")
}
</break>
The Pixie
20 Jul 2015, 10:44Grids wrote:The vehicle (Lamborghini) is set up as a room but I don't have any exits listed. When I want the player to go somewhere I just use Move Object (You) and Move Object (Lamborghini) to whatever room I want them to go to. 'You' is the name for the player.
Actually the car is set to be an object, which is what you want for how you have implemented, as the player does not really go inside the car. However, if you grab the gem, then the player is moved inside the car. When you are inside the car, the car is not visible as an object (which may seem strange, but if you are at the beach, Quest will not consider the beach to be an object that is there, so usually it makes sense).
I would create a command in the car. Set the car to be both an object and a room, then go to the scripts tab. Create a new command, and for the script, just call the "drive" script on the car:
do(Lamborghini, "drive")
Given what you have so far, I am guessing you can do it from there, but just say if you want more help.
Grids
20 Jul 2015, 11:42Thanks, that makes lots of sense now.