Dark Room Variable Doesn't Change
GAGE HOLSTON
20 Apr 2020, 20:56In my game, there are some dark rooms. The player acquires a flashlight item that, after finding the batteries and turning it on, will illuminate those rooms. It does seem to work in that the normal room description appears in those rooms, instead of the "It's too dark" text I added.
The problem comes in that there is a particular room where the player is supposed to enter a certain action. I made it so that if it the game detects the room is dark, it will throw up the text: "That would be hard to do in the dark!"
When I test out the action, the game throws that up despite me having the Flashlight on and the brightness set to strong. I used devmode and checked that (room name).dark is still set to true even with the flashlight, making progression impossible.
mrangel
20 Apr 2020, 21:49You're checking the wrong attribute.
isdark
- "Is this room dark?"
dark
- "Does the player need a lightsource in order to see here?"
GAGE HOLSTON
20 Apr 2020, 22:31I don't see an isdark attribute.
When I use devmode to check it: Error running script: The attribute with the name 'isdark' cannot be found.
When I try changing the if, I get: Error running script: Error compiling expression 'room.isdark = False': CompareElement: Operation 'Equal' is not defined for types 'Object' and 'Boolean'
mrangel
20 Apr 2020, 23:00Sorry, my mistake. Was typing on mobile; must have been thinking of a different engine.
The attribute you want is called darklevel
(although it will still be undefined if the player hasn't been in that room; it is only updated for the room the player is in)
GAGE HOLSTON
20 Apr 2020, 23:04Yep, that seems to have done it! Can't believe I missed such a simple answer.