What is wrong with my lantern?
Deckrect
05 Jul 2016, 03:20I am having a problem with a lantern in my game. I set it up to be switched on and off and set most of the rooms to start game in darkness. When the game begins, naturally the lanterns illuminates the room. However, if i turn the lantern off, it does not makes the room dark and even moving to other rooms still illuminating rooms.
Could anyone please tell me what am i doing wrong here?
XanMag
05 Jul 2016, 05:11EDIT: And... WOW. There is a much easier way! lol... go figure. Check to make sure you that you run the 'set object brightness script' for your lantern when you turn it off to WEAK and 'set object brightness script' for your lantern to STRONG when you switch it on. That should fix your rooms I think! You may also need to run a script to set your room darkness to dark or light as well. If you want a crappy, unnecessary, and long-winded solution, continue reading! Let me know that the above worked please as I haven't tried it!
I've always had a bit of trouble with 'light sources' in Quest. Most of the time, if a room is dark and needs lit up, I simply make all object visible 'IF' player is carrying the light source AND 'IF' it is turned on. Easy for me because I have few rooms.
In your case, I made three quick rooms.
- I ticked each one as 'Room initially dark' and gave it a description in the box below.
- I created a 'flashlight off' object (turned off), named it flashlight off with alias flashlight, and selected it as switchable. I made this object a WEAK light source (so you don't get stuck in a room if you drop it!)
- I also created a 'flashlight on' object, named it flashlight on with alias flashlight, and selected it as switchable. This object I made a STRONG light source to illuminate the room.
- I paired the two together... so, when I took one of them, I ran a script to add both to the inventory. Same for dropping them - I moved both flashlight objects to the current room.
- For the 'flashlight off' object, under the after switching object on I added these scripts:
AddToInventory (flashlight off)
MakeObjectVisible (flashlight on)
MakeObjectInvisible (flashlight off)
SwitchOn (flashlight on)
This will make sure both flashlight objects are in your inventory, swap the on light with the off light.
- For the 'flashlight on' object I did the opposite as step #5.
AddToInventory (flashlight on)
MakeObjectInvisible (flashlight on)
MakeObjectVisible (flashlight off)
SwitchOff (flashlight off)
So that when the flashlight is switched off it reverse step #5.
This may not be the most efficient way to handle it, but it definitely works and you only have to set the drop, take, switch on, switch off scripts one time for each flashlight object.
The Pixie
05 Jul 2016, 07:05You might want to look at this tutorial too.
http://textadventures.co.uk/forum/samples/topic/5571/how-to-hande-light-and-darkness
Deckrect
06 Jul 2016, 17:30Thank you both! It is working fine now!
hegemonkhan
07 Jul 2016, 05:09don't know if you already know of it, but there's a 'lantern' library you can take a look at (not sure if it is what you need and/or will even be helpful for you, but meh whatever):
http://textadventures.co.uk/forum/samples/topic/3743/making-a-basic-brass-lantern-that
it may be of use/help for you... or not, lol
Deckrect
07 Jul 2016, 09:47I am looking the library, but I guess I will not need nothing too detailed. Using the weak and strong settings shall be enough. Thanks.