Light and Dark scripts don't work

OurJud
15 Dec 2015, 11:18Trying to set up a simple dark/light room, which will be illuminated on 'use torch'.
I've followed these instructions, but straight away it's not working as the tutorial says it will.
viewtopic.php?f=18&t=5571&p=38391&hilit=light+and+dark#p38391
I'm told to add a room description as normal, and set the light/dark tab to 'initially dark'. This should, according to the tutorial, put me in a room from which I can't get out (as the exit is invisible). But when I run the game it just throws up the illuminated description and allows me to use the exit as normal.
I then try adding a description for 'room is initially dark' which the game simply ignores.
This is one of those times when I wasn't encountered any problems whatsoever, but it's proving to be a royal pain!
I've followed these instructions, but straight away it's not working as the tutorial says it will.
viewtopic.php?f=18&t=5571&p=38391&hilit=light+and+dark#p38391
I'm told to add a room description as normal, and set the light/dark tab to 'initially dark'. This should, according to the tutorial, put me in a room from which I can't get out (as the exit is invisible). But when I run the game it just throws up the illuminated description and allows me to use the exit as normal.
I then try adding a description for 'room is initially dark' which the game simply ignores.
This is one of those times when I wasn't encountered any problems whatsoever, but it's proving to be a royal pain!

XanMag
15 Dec 2015, 11:40Agreed. I just ended up making everything invisible in my dark room. When the lights were turned on, I then made them visible. Also, when the lights were turned on, the room was given a flag. In the room description box, I used an 'If' statement to print two different descriptions. I know it doesn't really answer your initial question, but I too tried the 'light/dark' and 'objects are light sources' bit, and had no luck, so I resorted to a workable solution that really isn't any more work (just different). If you want to see the code I have for a dark room, I'll provide it, but I assume you already know how to manipulate my work-around.

OurJud
15 Dec 2015, 11:40Is it just me or does Quest have some really complex and convoluted (maybe even unnecessary) ways of doing simple things?
I've simplified the process now, by adding a default 'room is dark' description on a room called 'bunker'. Then on the 'use/give' tab for the 'torch' object, I simply run a script which checks if the player is in room 'bunker'. If they are, give the illuminated description, if not say, "No need for the torch here."
Even if I decide to have more dark rooms, I simply add another 'if in room' script to the torch.
Now does this or does this not remove the need for all that faffing about with 'light/dark/lightsource' scripts??
You got in a few seconds before me, xan. Yours is another workaround, and like mine far less complex than the designated functions.
I suspect it's simply a case of the functions being set up in earnest, but then as the game grew, it just so happens that easier ways of doing these things materialised. In fact, it just demonstrates the depth of the software.
I've simplified the process now, by adding a default 'room is dark' description on a room called 'bunker'. Then on the 'use/give' tab for the 'torch' object, I simply run a script which checks if the player is in room 'bunker'. If they are, give the illuminated description, if not say, "No need for the torch here."
Even if I decide to have more dark rooms, I simply add another 'if in room' script to the torch.
Now does this or does this not remove the need for all that faffing about with 'light/dark/lightsource' scripts??
You got in a few seconds before me, xan. Yours is another workaround, and like mine far less complex than the designated functions.
I suspect it's simply a case of the functions being set up in earnest, but then as the game grew, it just so happens that easier ways of doing these things materialised. In fact, it just demonstrates the depth of the software.
The Pixie
15 Dec 2015, 12:42Just tried following the tutorial in a new game (first section), and it works for me. I am using Quest 5.6.2, how about you?

OurJud
15 Dec 2015, 14:455.5.1
The Pixie
15 Dec 2015, 15:13Try pasting this into a blank game and going south. Tell me if you can see the exit or the room description "This is the lounge.".
<!--Saved by Quest 5.6.5783.24153-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="dark">
<gameid>aecbfb80-2d3c-403e-ade0-3d69e84f5d04</gameid>
<version>1.0</version>
<firstpublished>2015</firstpublished>
<feature_lightdark />
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
<exit alias="south" to="darkroom">
<inherit name="southdirection" />
</exit>
</object>
<object name="darkroom">
<inherit name="editor_room" />
<description>This is the lounge.</description>
<dark />
<exit alias="north" to="room">
<inherit name="northdirection" />
</exit>
</object>
</asl>
<!--Saved by Quest 5.6.5783.24153-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="dark">
<gameid>aecbfb80-2d3c-403e-ade0-3d69e84f5d04</gameid>
<version>1.0</version>
<firstpublished>2015</firstpublished>
<feature_lightdark />
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
<exit alias="south" to="darkroom">
<inherit name="southdirection" />
</exit>
</object>
<object name="darkroom">
<inherit name="editor_room" />
<description>This is the lounge.</description>
<dark />
<exit alias="north" to="room">
<inherit name="northdirection" />
</exit>
</object>
</asl>

OurJud
16 Dec 2015, 00:13'South' gives me, "You are in a dark room." No exits given after going south.
The Pixie
16 Dec 2015, 07:47That is what you should see; you cannot see the exit back north because the room is dark.
So let's check the basics. In your game:
Are you carrying anything that is a light source? Drop everything in another room and come back and check.
For the room that should be dark, do you have Room is initially dark ticked?
Do you have Description to display when room is dark: Use default description set?
On the exit from the room, on the Options tab, is light source unticked?
So let's check the basics. In your game:
Are you carrying anything that is a light source? Drop everything in another room and come back and check.
For the room that should be dark, do you have Room is initially dark ticked?
Do you have Description to display when room is dark: Use default description set?
On the exit from the room, on the Options tab, is light source unticked?

OurJud
16 Dec 2015, 10:48To prevent you going to any more work, TP, I'll have to say I can't rightly remember how I had things set. All I know is that I tried to follow the instructions and immediately hit a wall when the room and exits were shown on entry, even though I'd done as the tutorial said.
It could be down to a number of factors, or maybe something I was missing.
Anyway, I went down my usual unorthodox route to achieve the desired result, and eventually got it working how I want. It may have resulted in scripts that are five times as long as they need to be, but it works.
It could be down to a number of factors, or maybe something I was missing.
Anyway, I went down my usual unorthodox route to achieve the desired result, and eventually got it working how I want. It may have resulted in scripts that are five times as long as they need to be, but it works.