Author Topic: [Event Tutorial] toggleEventEnabled  (Read 4956 times)


I already know this Make a relay tutorial

I already know this Make a relay tutorial
Relays are easy. :3

Also, suggestion, make a thread '►►►Tutorial: Events' and it be a tutorial on all default events in one thread on the first post. It'd be easier for people to find. (And have a index on top of post of course.)

Relays are easy. :3

Also, suggestion, make a thread '►►►Tutorial: Events' and it be a tutorial on all default events in one thread on the first post. It'd be easier for people to find. (And have a index on top of post of course.)
Good idea.

You don't even need to name anything [X] is ticked and [ ] is unticked.

On bulb

0 [X] onRelay > Self > setLight > [Insert Light Here]
1 [  ] onRelay > Self > setLight > None
2 [X] onRelay > Self > toggleEventEnable { 0 1 }

and have the brick under it be the switch and have it's events be

0 [X] onActivate > Self > fireRelay {Up}

and if you did his method, there is no reason to name the switch.

Edit: If you don't want a separate brick for the switch, replace onRelay with onActivate.
« Last Edit: February 21, 2009, 12:22:36 PM by jirue »

What if I were to make a door that toggles without JVS? I've seen someone do that with 9 events + toggle.

Create bricks:
 Hinges (no brick name, no events)
 doorBricksA - door in closed position + handle
 doorBricksB - door in open position + handle

Handle of doorBricksA:
onActivate -> <NAMED BRICK: doorBricksA> -> disappear [ -1 ]
onActivate -> <NAMED BRICK: doorBricksB> -> disappear [ 0 ]

Handle of doorBricksB:
onActivate -> <NAMED BRICK: doorBricksA> -> disappear [ 0 ]
onActivate -> <NAMED BRICK: doorBricksB> -> disappear [ -1 ]

edit: fix for weird dot signs
« Last Edit: February 22, 2009, 06:49:21 AM by Space Guy »

You don't even need to name anything [X] is ticked and [ ] is unticked.

On bulb

0 [X] onRelay > Self > setLight > [Insert Light Here]
1 [  ] onRelay > Self > setLight > None
2 [X] onRelay > Self > toggleEventEnable { 0 1 }

and have the brick under it be the switch and have it's events be

0 [X] onActivate > Self > fireRelay {Up}

and if you did his method, there is no reason to name the switch.

Edit: If you don't want a separate brick for the switch, replace onRelay with onActivate.
That could be quite a difficult way to do it. Also if you have other bricks that use relays above it, won't this stuff up them too?