Updating room descriptions

New to Quest and have been playing around with the tutorial and stuff. But how do i update room descriptions to call the status of whether an object like blinds and/or a door has been opened? The blinds are just flavour and it would be nice to say if they are letting light in or not (i have them set as a open/close container) and the door is acting as a closed container since you don't really need to go into that room but it does contain an item (which i've got that part down).

Can the scripts for the blinds/door print it's status back to the parent? Or would i just add a script to the room description that would be looking to the door/blind status?

Programming is not my forte, hence using Quest which does help simplify things. :)

Thanks!


There are a couple of ways of doing this. If it's in the location description of the room you can put something like this in the description:

It is {either door.isopen:open|closed}.
The tap is turned {if bathroom.watersource:on, water gushes out into the bath}{if not bathroom.watersource:off}.

or a description I have in my game:

The bird cage is {either cage.isopen:open|closed}{if parrot.parent=cage:, with a{if parrot.dead: dead} parrot inside it}. 

More Information on the text processor can be found here:
http://docs.textadventures.co.uk/quest/text_processor.html

If you want to have the game update the room description as opposed to the player typing "look", then use the following:

HandleSingleCommand("look")

Hope this helps


J_J

I've been doing it by using an if. You can choose if object is open(choose door) have one description print. Else (description of room with door closed). This way you can have totally different descriptions print.

if (doorname.isopen) {
  msg ("BLA BLA BLA OPEN OPEN")
}
else {
  msg ("BLA BLA BLA CLOSED")
}

I think it's nice when there is a larger change to the description when you have made a change in the room. It feels satisfying as a player. Doctor Agon's way is awesome also.


Thanks Doctor Agon and J_J! That was what i needed to get rooms updated when things opened and/or closed affected the description! Onto my next hurtle!


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

Support

Forums