Darkness check

Tobio3630
25 Feb 2015, 05:12
Hi everybody, I'm new here. I can't for the life of me figure out how to create a script to check the darkness level in the room. I'm trying to create a turn script that checks if the room is dark, the idea being if it is it'd run one script, and if it isn't it'd run another one. There were a couple links in previous threads that seemed promising, but always got 404 errors. Apparently the Quest5 wiki doesn't exist anymore? Anyway, thanks in advance!

Alex
25 Feb 2015, 07:12
The old wiki is gone, documentation is here now: http://docs.textadventures.co.uk/quest/

Most of the old quest5.net links should still forward to the right place though - let me know if any don't.

HegemonKhan
25 Feb 2015, 07:25
the old wiki site (and their now dead links in our posts) was transfered over to new wiki site, here:

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

http://docs.textadventures.co.uk/quest/ ... notes.html
http://docs.textadventures.co.uk/quest/tutorial/
http://docs.textadventures.co.uk/quest/guides/

http://docs.textadventures.co.uk/quest/elements/
http://docs.textadventures.co.uk/quest/types/
http://docs.textadventures.co.uk/quest/scripts/

http://docs.textadventures.co.uk/quest/functions/
http://docs.textadventures.co.uk/quest/ ... tions.html

http://docs.textadventures.co.uk/quest/ ... kness.html
http://docs.textadventures.co.uk/quest/ ... tdark.html
http://docs.textadventures.co.uk/quest/ ... light.html
http://docs.textadventures.co.uk/quest/ ... ength.html
http://docs.textadventures.co.uk/quest/ ... ength.html

---------

I still haven't worked with this darkness~light feature yet, but I think this is the syntax that you want~need (hopefully, lol):

GUI~Editor:

run as script -> add a~new script -> scripts -> 'if' Script -> [EXPRESSION] -> type this in here: CheckDarkness ()
-> then, -> Add a script -> (whatever script)
else,
-> add a script -> (whatever script)

In-Code:

<turnscript name="turnscript_1">
<enabled />
<script>
if (CheckDarkness ()) {
// script 1
} else {
// script 2
}
</script>
</turnscript>


you also have to actually set the room's dark~light level (via 'SetDark' or 'SetLight' ), and~or its Objects~Exits light strength ("strong", "weak", or "(blank)", via 'SetObjectLightStrength' or 'SetExitLightStrength' )

Tobio3630
25 Feb 2015, 07:59
Wow, quick reply. Thanks so much you guys!