Trigger_Multiple and all entities touching

  • If you're asking a question make sure to set the thread type to be a question!

JrTheDragon01

L1: Registered
Jan 13, 2012
20
1
In a level, I have a trigger_multiple affecting a gamerules logic, and I thought the OnStartTouchAll command fired once all entities that the filter applied to were within the trigger_multiple.
However, it turns out this just fires when any entity enters the trigger_multiple.
What I want to achieve, is that once ALL player entities enter the trigger, the command is fired.
I had the vague idea of using some logic and a trigger in all other areas of the map, but that would be complicated and messy, so I was wondering if anyone knew of or could think of a better way to do this.
Thanks.
 

Micnax

Back from the dead (again)
aa
Apr 25, 2009
2,109
1,585
Do a math counter, so that when a player enters and activates, it adds 1 to the counter (and removes one when they exit), so when all the players are in, it'll reach the maximum count needed and do the trigger you want.

The hard part is finding out how many players are on a team, which you'd need to set your max value on the counter, which I'm unsure how you'd do.

What is it for, anyway?
 

henke37

aa
Sep 23, 2011
2,075
515
Uhm, the counter solution has a loophole: death. Death and disconnections.
 

JrTheDragon01

L1: Registered
Jan 13, 2012
20
1
What is it for, anyway?
Well, it's for a map I'm making for me and my friends, and it's MvM, but designed so that an alternate method of failing is if all players die at around the same time (if all players are within the spawn area)
 

JrTheDragon01

L1: Registered
Jan 13, 2012
20
1
Oh, and
The hard part is finding out how many players are on a team, which you'd need to set your max value on the counter, which I'm unsure how you'd do.
you could do it by having another trigger, which added to another math_counter, which was only enabled before the game start, and sent to the math_counter every time a player passed through it. A logic_compare could compare the values on each math_counter, and send the signal if they became the same. It's not flawless, there are a lot of loopholes, but it's closer to being perfect.
 

Bloodhound

L6: Sharp Member
Jan 3, 2011
316
489
What is if everybody is just upgrading weapons, or is still in respawn but already alive?

Beside I dislike this idea because it's not explaining itself, and players will ask themselves what happened.
You should create a trigger in the entire map, except the spawn area. Then toggle the trigger turn on and off by counting spawn uses.

This might not work and would be hell of entity work. Which is, to be honest, unnecessary.
 

Egan

aa
Feb 14, 2010
1,375
1,720
Well, it's for a map I'm making for me and my friends, and it's MvM, but designed so that an alternate method of failing is if all players die at around the same time (if all players are within the spawn area)

Ignoring that this is the opposite of what your original post asked, just make a trigger only activate once the round starts, that surrounds the entire map, and make it so if OnEndTouchAll is fired, end the round or whatever.
 

JrTheDragon01

L1: Registered
Jan 13, 2012
20
1
Ignoring that this is the opposite of what your original post asked, just make a trigger only activate once the round starts, that surrounds the entire map, and make it so if OnEndTouchAll is fired, end the round or whatever.
This seems like it's a good idea, but just to make sure it worked when all players died and not just one, I might use the trigger with a couple of counters just to make sure that all players are dead.
 

Seba

DR. BIG FUCKER, PHD
aa
Jun 9, 2009
2,364
2,728
That's why you're to use OnEndTouchAll, not OnEndTouch. The former fires only when all appropriate entities exit the trigger while the latter fires when any appropriate entity leaves. I think.
 

JrTheDragon01

L1: Registered
Jan 13, 2012
20
1
That's why you're to use OnEndTouchAll, not OnEndTouch. The former fires only when all appropriate entities exit the trigger while the latter fires when any appropriate entity leaves. I think.
Well I thought that was the same with OnStartTouchAll, but it turned out not, so I'm gonna use a math counter just to be safe.
 

Fish 2.0

L6: Sharp Member
Nov 22, 2012
324
262
No, don't use a math counter. What if there are only 5 people playing your map?

It would be a lot like making a door - when everyone leaves the door area, OnEndTouchAll, the door closes. If you surround your playing area with a trigger_multiple have an output that OnEndTouchAll (when every player is out of the playing area) the trigger is fired sending the output to where ever you want it to go to.

If need be have them spawn at one set of spawns then when they die they respawn somewhere else. Not hard with logic.