Trigger_multiples for multiplayer activation

I wrote this tutorial because many people don't realize that just because when they test something in single player it works, that doesn't mean that it will work properly in multiplayer. If you are using the onstarttouch output to activate something and the onendtouch output to deactivate it, it will work perfectly when you test it yourself, but when it is played in multiplayer it won't work correctly. The reason for this is simple, you can have as many people as you want enter the trigger area and it will activate the light or whatever it is you are activating, but all it takes is one of those players to leave the trigger area for the light (or whatever) to be turned off. There is a simple solution for this problem which I will now explain.

This tutorial assumes you have a basic understanding of entities and using the I/O system.

In this case, we will be activating a light when players enter the trigger area, but the same setup can be used for anything you wish to activate with a triggermultiple. First we need our light, our triggermultiple, and a mathcounter. Now name the mathcounter and the light. Now we will add three outputs to the trigger_multiple.

My output named OnStartTouch Target entities named Light01 Via this input TurnOn

My output named OnStartTouch Target entities named Counter01 Via this input Add With a parameter override of 1

My output named OnEndTouch Target entities named Counter01 Via this input Subtract With a parameter override of 1

Now when a player enters the trigger area the light will be activated and 1 will be added to the mathcounter. When the player leaves the trigger area 1 will be subtracted from the mathcounter. However, with the current setup, the light will not turn off. To set it up to turn off, we need to add an output to the math_counter so that when it reaches its minimum value the light is turned off.

My output named OnHitMin Target entities named Light01 Via this input TurnOff

If you have any questions please fell free to ask.

Oh noes! You're not a Member!

Want access to cool stuff? As a member you can:

  • Post. Give the submitter your thoughts on this Tutorial.
  • Say Thanks. Show your appreciation by sending the submitter points.
  • Stamp Posts. Let other posters know what you think of their posts.
  • Rate. Give this Tutorial a rating out of 10.
  • Flag. Alert moderators and warn members of a problem with this Tutorial.
  • Vote. Vote the submitter for the Monthly Awards.
  • Subscribe. Get notified when this submitter submits again.

Interested? Register or Login

Comments

  • BarbaraWalters's Levels
    • P1: Beggar
      Points: 114
    • C1: Member
    • A5: Veteran
      Account Age: 6 years
    Posted 5 years ago

    Thank you for this tutorial, I had to smack myself in the head for making this mistake a few times.

    Bananite
  • lileazyian's Levels
    • P1: Beggar
      Points: 157
    • C1: Member
    • A5: Veteran
      Account Age: 6 years
    Posted 6 years ago

    Pros: great tut. clear very detailed, usefull^^ Improvements: none Notes: you should make some more entite tuts, for people unsure of those entites ^^

    goverment is nothing without a
  • Logan Dougall's Levels
    • P5: Peddler
      Points: 140,802
    • E6: Authority
      EF: 223
    • C5: Admin
    • A6: Elder
      Account Age: 7 years
    Posted 6 years ago

    Yea....I didn't realize this myself :( , thanks for helping me earlier, Its a handy entity for general mapping techniques. Glad to see your making it more widely available here.

Credits

Submitter
Crazypip666's Levels
  • P4: Worker
    Points: 35,876
  • E1: Helper
    EF: 11
  • C2: Treehouse Member
  • A6: Elder
    Account Age: 7 years
Username
Crazypip666
(Creator/Co-creator)
Key Authors
crazypip666
Unknown

Rating

10.0/10
Based off 3 rating(s)

Additional Info

Genre
Other/Misc
Difficulty Level
Intermediate

Stats

Post Count
5
ViewCount
2,046
Date Added
6 years ago
Date Modified
2 years ago

Share

Embed Code
Code to use:

More embeddable images

Bookmark and Share