Author Topic: on off event  (Read 1002 times)

hello every one! I have just got blockland, haveing a blast so far. I'm beginning to play with events. I'm no programmer by any stretch of the imagination. So I'm starting out simple.
 I want to make a block turn a light on and off. I got it to turn on, but I cant figure out how to get it to turn off and back on again. I got it to turn on then off. but then it just stays off... any help would be appreciated.

AHEM

(Check)On Activate>Self>SetLight>PlayerLight

(Check)On Activate>Self>Toggle event enabled>0 2

(Uncheck)On Activate>Self>SetLight>PlayerLight


0 [X] onActivate -> <NAMED BRICK> -> setLight [NONE]
                    light

1 [ ] onActivate -> <NAMED BRICK> -> setLight [Player's Light]
                    light

2 [X] onActivate -> Self -> toggleEventEnabled 0 1


I assume you want to have a toggle light.

AHEM

(Check)On Activate>Self>SetLight>PlayerLight

(Check)On Activate>Self>Toggle event enabled>0 2

(Uncheck)On Activate>Self>SetLight>PlayerLight
That doesn't make sense.  Please re-read what you posted.

AHEM

(Check)On Activate>Self>SetLight>PlayerLight

(Uncheck)On Activate>Self>SetLight>PlayerLight
Orly? that sounds like an infilight to me

NICE! it works... I dont know wy it works... But it dose. Hmmm any one know if there is some guide to events? Something that tells me what each of those commands do and why they do them? and thank you all for your help!

That doesn't make sense.  Please re-read what you posted.

Yes it does. Please actually test the events ingame.

Yes it does. Please actually test the events ingame.
Please, you do that.  Copy exactly what he said.

NICE! it works... I dont know wy it works... But it dose. Hmmm any one know if there is some guide to events? Something that tells me what each of those commands do and why they do them? and thank you all for your help!
setLight sets the light.  It is the equivalent of doing it with the wrench.  Setting it to none makes it so there is no light and player's light is usually a good choice for a light.  toggleEventEnabled toggles the event enabled.  If an even is toggled off (check the checkboxes) it will not run when that input is activated.  if onActivate -> Self -> setColor [ red ] is set to disabled it wont set the bricks color to red.  So when you toggle the first two (0 and 1) you get a different input being activated each time, setting the light on and off.

That's how I always do it, if it doesn't work, I'm seeing things :c

Please, you do that.  Copy exactly what he said.
it works, IF it's the first events on the brick, you test it

AHEM

(Check)On Activate>Self>SetLight>PlayerLight

(Check)On Activate>Self>Toggle event enabled>0 2

(Uncheck)On Activate>Self>SetLight>PlayerLight
Let me explain the logic of this.
Both of the setLight events set the light to Player's Light.
That does not make any sense.  The only reason it's probably working is because you corrected it without noticing.

Fun Fact:
When an event is toggled, the toggled options don't hold true or false until the cycle finished. For example, you could make an onActivate event 0 turn off onActivate event 1, but if event 1 is already enabled, it will still execute when you first activate it.
I'd advise you don't event things this way though, because it can get confusing later on.

Let me explain the logic of this.
Both of the setLight events set the light to Player's Light.
That does not make any sense.  The only reason it's probably working is because you corrected it without noticing.

I see it know, haha I forgeted up.

Double post,

I again forgeted up.