when dark room lights up, it doesn't show the lit room description.

onesock
30 Dec 2020, 19:42

I am trying to make a flashlight work. whenever i us the flashlight, it says the that it is turned on, but the room doesn't give the description I put for if the room is lit. I am kind of a noob at this, so help me out.


mrangel
30 Dec 2020, 22:25

Do you mean that entering look still says it's dark; or that it doesn't show the description until you look?

I assume you have a script set to run when the flashlight is switched on. If you want to show the room description, you'll need to have something like:

msg ("You turn it on.")
this.lightsource = true
ShowRoomDescription

or, if you only want to show the description when you turn it on in a dark room:

wasdark = CheckDarkness()
this.lightsource = true
if (wasdark) {
  msg ("You turn on the torch, illuminating the room.")
  ShowRoomDescription
}
else {
  msg ("You turn it on.")
}

onesock
31 Dec 2020, 00:28

thanks, I am a complete beginner.