Please or Register to create posts and topics.

What are logic_relays for?

I've been thinking why the pros (and other mappers) use them. On the wiki it says they are message forwarders. Couldn't I just do this: Button(output) -> Door(input)

If at first you don't succeed, error check: http://www.interlopers.net/errors/

I've seen in the example maps that they relay the button outputs. I don't know either why do it that way. On some occasions though, you may have several entities making the same outputs. Then it is a good idea to place all those outputs in a single relay.

One of the major benefit of using a logic_relay is that they can be Enabled or Disabled, effectively cutting off the I/O flow when needed. So let's say that the door in question needs to be "powered up", or in some way is Disabled until some certain case applies. I could simply Disable the relay without having to worry about any other negative effects of Disabling the button.

I would like to make a point that, in the case of using multiple buttons to open a single door, a logic_relay is not the best solution. You would want to look into logic_branch and logic_branch_listener.

It's also a matter of neatness, so your entities aren't super cluttered with I/O. Using your example, when I push the button not only do I have the door open, but I also play a sound and toggle indicator strips and do any number of other things. I can put all of these effects into a single logic_relay, and tell my button to Trigger the relay, instead of each of the individual Outputs.

[Important Threads] Forum Rules | Welcome to the new Thinking With Portals
Please do not Private Message me for assistance. Post a thread if you have questions or concerns.
If you need to contact the staff privately, contact the Global Moderators via Discord.

I mainly use them to cut down the I/O clutter when you need a button or a trigger to fire multiple times and do the same thing.

Just like math_counter's logic_case's and logic_timer's: these are one of the most common entities you would be using for maps with loads of I/O and scripting.

?????????????????????????????TWP Releases | My Workshop
chickenmobile wrote:
I mainly use them to cut down the I/O clutter when you need a button or a trigger to fire multiple times and do the same thing...

Yup. It essentially does for source mapping what subroutines do for programming languages.

msleeper wrote:
It's also a matter of neatness, so your entities aren't super cluttered with I/O. Using your example, when I push the button not only do I have the door open, but I also play a sound and toggle indicator strips and do any number of other things. I can put all of these effects into a single logic_relay, and tell my button to Trigger the relay, instead of each of the individual Outputs.

Hmm, in the case of a button simply opening a door or similar cases, it would just add complexity to use a relay. So I'd rather say it's a matter of modularity rather than neatness.

You guys are so wise. Thanks for the info - I think I'm gonna use them from now on. :)

If at first you don't succeed, error check: http://www.interlopers.net/errors/
Sliipperi wrote:
You guys are so wise. Thanks for the info - I think I'm gonna use them from now on. :)

:potd:

"Games are made out of smaller games ? turtles all the way down, until you hit the game that is so trivial and stupid it isn?t deserving of the name." --Raph Koster