[Event] FireRelayNum v8.1 - Relay where no one has relayed before

Author Topic: [Event] FireRelayNum v8.1 - Relay where no one has relayed before  (Read 9465 times)


« Last Edit: August 28, 2017, 07:02:49 PM by Potatoh »

i've never known how do i use Relays, though....

i've never known how do i use Relays, though....
When you fire a relay on a brick, it triggers any and all events with onRelay.
Here's an example, it makes both of these things open a door.
onActivate -> Self -> fireRelay
onPlayerTouch -> Self -> fireRelay
onRelay -> Self -> door [OpenCCW]
fireRelay[direction] does the same thing, but in a direction. These're used to A. trigger the same events with different inputs (as above) and B. have multi-brick structures without named bricks (so you can, for instance, make TNT and a detonator without having all TNT on the map explode when the detonator for one is pushed.)

fireRelayNum does the same thing, but you specify what line numbers to fire, rather than all relays, meaning you can use relays to control multiple bricks.

Events are fun and someone should make an eventing tutorial save/mode/thing.

Events are fun and someone should make an eventing tutorial save/mode/thing.

https://forum.blockland.us/index.php?topic=55898.0
https://forum.blockland.us/index.php?topic=40983.0

Events are so special that if you get the basics going, you can understand everything from there. Just understand what each event does and you're good to go.

I've added fireRelayRandomNum, which will pick one of the relays at random. More info in OP. This was suggested by Trogtor.

Code: (Changelog v6) [Select]
Added fireRelayRandomNum
Fixed appended client
Removed redundant inputTarget
« Last Edit: September 15, 2017, 01:53:17 AM by mctwist »


Trivia: Version 5 was made within one hour. Testing, debugging and everything around it included.
« Last Edit: December 08, 2017, 06:36:49 AM by mctwist »

Code: (Changelog v7) [Select]
Fixed delay issue for fireRelayRandomNum
Performance and security improvements

OnActive < Self < FireRelay

Onrelay < Self < SpawnExplosion < jeepfinalExplosion

Onrely < Self < FireRelay

-event snip-

Code: [Select]
onActivate -> Self -> fireRelayNum ("1 2", Brick)
onRelay -> Self -> spawnExplosion (jeepfinalExplosion)
onRelay -> Self -> fireRelayNum ("1 2", Brick)

Is it possible to have this work on bots?

This works only with onRelay. However, I did made it in such a way that it should be possible if I called an another event for bots. If you tell me an event that should have this kind of functionality, I'll make an event that works with it like this event.

This works only with onRelay. However, I did made it in such a way that it should be possible if I called an another event for bots. If you tell me an event that should have this kind of functionality, I'll make an event that works with it like this event.

I have a modified version of onRelay so that I can use relays on bots, I can send this to you if it'll help in any way.

Like I said: the script is made in such a way that would you add more targets for onRelay, it would work out of the box. Try it and you'll see that it should work.

If not, then send me your add-on so I can have a look.