Is there anyone who have a smart way to make automatic sliding doors? I have this:
(if(== (send gEgo:onControl()) ctlNAVY)
...which obviously doesn't work, since the doors will open constantly while ego is on the Navy control color, and because of that goes into a loop :P
|Nychold||Keep an active record of what state the door is in: closed, opening, open, and closing. Then, when you hit the navy control line, you just need to examine the state, and change it if necessary. Exact source code would depend on your implementation and idea. ^^|
for this one i wouldnt use the door class at all. i would just set up a variable (local open = 0) and a view of a door with (for example) ctlGREY as the control color in front and ctlMAROON as the color behind and then do this:|
(if(== (send gEgo:onControl()) ctlGREY)
(aDoor:setCycle(End)cel(0)loop(0))//draw it to slide or open
= open 1
and then to close it, you could draw another control (for example) ctlSILVER around the ctlGREY and put in:
(if(== (send gEgo:onControl()) ctlSILVER)
(aDoor:setCycle(End)cel(0)loop(1))//this loop would need to be the opposite of the other.
= open 0
i think that would work...
|AndyPanda||Just a little misunderstanding from my part. It worked at last. Thanks guys!|