Run print room description again.

Hi guys,

I know you can type 'look' to show the room description again, but I'd like it so when you pick up an object it shows the room description automatically again. I can't figure this one out. I found an old post from 2004 but I'm not sure if it's outdated. It basically says to do this;

msg <#(quest.currentroom):look#>

or (In QDK, put #(quest.currentroom):look# in the parameter for the print command).

is this code still valid? I tried it and I get an error:

Error running script: Error compiling expression 'quest.currentroom': Unknown object or variable 'quest'

I'm using Quest 5.8.


Depending on your situation, there's a few different options.

  1. (most likely option) If you want to show the description and also the "You can see:" and "You can go:" lines
ShowRoomDescription()

  1. If you just want to show the description:
msg (GetRoomDescription())

  1. If you just want to show the description, but the room might have a script for its description:
if (HasScript (game.pov.parent, "description")) {
  do (game.pov.parent, "description")
}
else {
  msg (GetRoomDescription())
}

  1. If the description might be a script, and the room might be dark:
if (CheckDarkness()) {
  field = "darkdescription"
}
else {
  field = "description"
}
if (HasScript (game.pov.parent, field)) {
  do (game.pov.parent, field)
}
else {
  msg (GetRoomDescription())
}

  1. If you want to show the description and run the room's "on enter" scripts again (because some people seem to put part of the description in those scripts):
OnRoomEnter (null)

Thanks for the reply.

I'm basically trying to implement special glasses in my game. When the player doesn't have the glasses, he/she just reads the normal room description with whatever objects are in the room. Then when the player puts on the special glasses, he/she can see hidden objects/spirits in the room. To distinguish it better that the player indeed wears the special glasses I changed the background color when she is wearing them.

When I put the glasses on it changes automatically to 'orange' but no room description shows unless I type in 'look', then it displays the 'alternate' room description I have set for when the player puts on the glasses.

The script I did in 'After Wearing':

SetBackgroundColour ("Orange")
SetObjectFlagOn (Glasses, "puton")
msg (GetRoomDescription())

but the line remains empty when I run it.


Never mind, I figured it out. My room has a script description, that's why it didn't work in the first place. Works like a charm now! The correct code should have been:

SetBackgroundColour ("Orange")
SetObjectFlagOn (Glasses, "puton")
if (HasScript (game.pov.parent, "description")) {
  do (game.pov.parent, "description")
}
else {
  msg (GetRoomDescription())
}

Thanks for the help!


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

Support

Forums