What are logic_relays for?
Quote from Sliipperi on May 20, 2011, 9:54 amI'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)
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)
Quote from Aldéz on May 20, 2011, 11:01 amI'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.
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.
Quote from msleeper on May 20, 2011, 12:03 pmOne 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.
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.
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.
Quote from ChickenMobile on May 20, 2011, 12:10 pmI 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.
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.
Quote from Nacimota on May 20, 2011, 12:25 pmchickenmobile 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.
Yup. It essentially does for source mapping what subroutines do for programming languages.
Quote from Aldéz on May 20, 2011, 1:57 pmmsleeper 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.
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.
Quote from Sliipperi on May 20, 2011, 2:48 pmYou guys are so wise. Thanks for the info - I think I'm gonna use them from now on.
You guys are so wise. Thanks for the info - I think I'm gonna use them from now on. ![]()
Quote from Hober on May 20, 2011, 10:47 pmSliipperi wrote:You guys are so wise. Thanks for the info - I think I'm gonna use them from now on.

