Page 1 of 1
Question
Posted: Sat Feb 11, 2017 2:21 pm
by trancelistic
Hey all, I've noticed something or I'm just plain stupid as useal.
If I would type a simple check script like:
Code: Select all
function checkPlate()
if plate_1:isDown() == true
then
door1:open()
end
end
Works just fine.
How to do this with a light source like a ceiling lamp?
The following:
Code: Select all
function checkLamp()
if lamp_1:activated() == true
then
door_1:open()
end
end
simply does nothing. I also noticed if I ran this script once then I can't even disable the lamp anymore with a button who is on toggle mode.
So what am I doing wrong?
Thanks.
Re: Question
Posted: Sat Feb 11, 2017 2:45 pm
by Isaac
There was some kind of light tracking done in ORRR2 ~nothing by me. I think there wasn't really a lot of control or access to lights.

Until minmay replies, I would suggest recording the [assumed] state of any lights you are interested in when the game starts, and record whenever they are switched off, or reactivated; and hook into the light and darkness spells [ party:onCastSpell() ], so you can know when they are cast... and update your records.
Re: Question
Posted: Sat Feb 11, 2017 3:14 pm
by trancelistic
I'm a bit confused mate.
What do you mean by: Record it?
Re: Question
Posted: Sat Feb 11, 2017 4:05 pm
by Isaac
trancelistic wrote:I'm a bit confused mate.
What do you mean by: Record it?
I mean make a table of named true/false values that you manually update via script that connect with relevant triggers, and party hooks, so that later you can check to see if a light is on or off.
As in: [snippet]
Code: Select all
lights = {lamp_01 = true, lamp_02 = true, lamp_03 = true, lamp_04 = false, }
Done this way is a hassle, no doubt about it.
I haven't looked at the methods used in ORRR2, but I'd expect that it's something similar.
Re: Question
Posted: Sat Feb 11, 2017 4:23 pm
by trancelistic
Thanks, ill try it:)