Login
Remember
IF Answers
Ask a Question

# How do I get the player out of a dark room if he unwittingly enters one without a light source?

0 votes
82 views
asked Aug 25 in Authoring by Robert GAC (3 points)
retagged Aug 25 by Dannii

I can't seem to find any tutorial or documentation that shows how quest handles light.

- quest
- light-and-dark

commented Aug 27 by TM123 (1 point)
In Quest, generally if something is not visible, then it does not exist for practical purposes. This makes a player trapped in a dark room.
The answer to your question is: you would need to write a script.
The script would either need to create a light source, switch the room from dark to light, or transport the player to a lighted room.
commented Aug 28 by hegemonkhan (161 points)
as TM123 already stated, with a bit extra comments of my own:
you can have scripts inside of a global Turnscript or have local Turnscripts for each~all of your dark rooms, which if you get trapped (the scripts check for if there's any lightsource object~exit, a means of lighting up ~ revealing the exit, in the room, and if not...), will rescue you.
-------
as for specifically how to do all of this... maybe I can do it, or maybe it'd be a bit beyond my ability, not sure as I've not tackled~tried it yet, but I just don't have the time, due to school work, but hopefully someone else can help you with it, if you want this method for dealing with possibly getting trapped in a dark room.

## 1 Answer

0 votes
answered Aug 26 by hegemonkhan (161 points)
selected Aug 27 by Robert GAC
Best answer

I've still not worked with the 'light~dark' feature yet, but...

here's the documentation:

http://docs.textadventures.co.uk/quest/functions/index_allfunctions.html
VVVVVV
http://docs.textadventures.co.uk/quest/functions/corelibrary/setdark.html

http://docs.textadventures.co.uk/quest/functions/corelibrary/setlight.html

http://docs.textadventures.co.uk/quest/functions/corelibrary/setobjectlightstrength.html (this is the important one: weak, strong, null~blank~empty)
---- and~or ------
http://docs.textadventures.co.uk/quest/functions/corelibrary/setexitlightstrength.html
(this is the important one: weak, strong, null~blank~empty)

http://docs.textadventures.co.uk/quest/functions/corelibrary/checkdarkness.html

and here's the tutorial, but I'm not sure if it covers the 'light~dark' feature (and am too lazy to look):

http://docs.textadventures.co.uk/quest/tutorial/

commented Aug 28 by hegemonkhan (161 points)
P.S.
there's also a 'lantern' (portable lightsource object) library by Darkweaver, here:
http://forum.textadventures.co.uk/viewtopic.php?f=18&t=4610

## Related questions

- Help! I need to use a candle as a light source in rooms in my Quest text adventure game
- How to get rid of a rule that's blocking what I want the player to do? (Inform 7)
- How do I set a variable by asking the player a question in Quest?
- In a Gamebook, how do I fix that the text processor is not working properly on my version of Quest (I think)?
- Inform: How do I get the player to input a name for themselves? The name keeps changing to whatever the player typed last!

...