Author Topic: Event- All players touching  (Read 1705 times)

    Okay, so. The idea is an iNput event for when all the players on a server are touching the brick. So, if there are eight players on a server, all eight would have to be on the plate to trigger the event. if there were three players, then all three would need to be on the plate, ect. This input event would also be more useful if it can be used with zonebricks, but i dont know if thats possible. This could be used for any sort of go from A to B game, IE running from a spawn point to a bunker being persued by renderman, or something.
Another useful variant of this would be on all living players touching, which would make it so that the number of people touching it does not include dead people. IE if there were eight players on a server, and three were dead, it would need all five remaining to be on the plate. if there were three players and one was dead, it would need two players. This would be necessary if you needed to use the event in a game where people who died didnt respawn until the next round, such as with lives or boss battles or with respawn disabled. Uses or this would be a plate at the end of a death run that all runners would need to be touching, said renderman survival if respawn were off, a falling platforms that would require everyone to be in the middle before it started, a jeep race requiring everyone to reach the finish (to rank people 1st, 2nd, 3rd) before it reset, a plate on the tallest point in a rising lava server that would trigger something when the remaining players are all on that spot, and so on.

Specifically, I need something like it for a zombie map i have. There is a point in the map where all players need to be in the elevator in order for the doors to close, and that's kinda tricky. right now, i have it so there's events on the floor of a big part of the room that prevent the doors from closing, but if someone is not in the room, the doors can close and leave them behind still. Also, at the final finale, i need to make it so that the zombie spawns are set to NONE and the minigame says "You've won!" and resets when all the players are inside the helicopter. Of course, you cant have the game ending without all the survivors having reached the chopper, so I kinda need this. I used to use bot events to make a bot that is enclosed in a box shoot a gun at the nearest player. The box would be far enough away that any player not in the chopper would be targetted as closest, and i put a brick between the bot and the chopper so that when the there was nobody closer than the chopper, the players would win. This ran into problems when V21 came out. I have a couple zombie maps that require something like this event in order to finish a round.

I'm looking for something identical to what ZAPT had with the safe house brick. When someone was on the brick, the bottom print would say "The generic army will leave behind 7 survivors (1 safe)". if all players were on the brick, it would automatically reset and display the names of the people who survived. if someone died, it would say "The generic army will leave behind 6 survivors (1 safe)" and only require the number of people alive to be standing on the plate.

(If something like this has already been made, please, by all means, put the link here)

TL;DR:
 An iNput event triggered when all players currently spawned in a server are touching the brick, and an imput for when all players who are not dead are touching the brick. Useful for games where everyone has a common goal of reaching one place, or to use as a safeguard to make sure that everybody is in one spot before the output. Specifically, I need it to make it so that an elevator in my zombie map does not depart without all the survivors being inside. I'd also use it to ensure that all the survivors are inside the chopper before they are declared victorious.
« Last Edit: March 13, 2014, 06:35:29 PM by K9 Kid »

use VCE and zonebricks

use VCE and zonebricks
How? Is there a value for number of players on a server?
There probably is, but then what? like, all i know is that you can use it to valuecheck the number of players and do a true/false event about a set number. like have one event for if theres more than 10 people and another for if there's less. how do you use it to determine if the number of people simultaneously touching a brick is equal to the number of players? and how do you then exclude the players who are dead?


Yes this would be very nice. Also have another alternate, AllMiniTouching and AllLivingMiniTouching, so that if admins needed to build onto the build, they could leave the minigame and the brick would not require them, it would only require the people that are in a minigame.

How? Is there a value for number of players on a server?
There probably is, but then what? like, all i know is that you can use it to valuecheck the number of players and do a true/false event about a set number. like have one event for if theres more than 10 people and another for if there's less. how do you use it to determine if the number of people simultaneously touching a brick is equal to the number of players? and how do you then exclude the players who are dead?
idk if there is one for the players on the server. if not you could just work something out with the spawns I guess, I feel that would be best, since you could make it work only within a minigame too, probably
but once you get that taken care of it's pretty simple
whatever brick it is you're wanting them to be touching (I'm going to pretend it's a baseplate for the sake of my explanation), ignore it. over it, place the same brick, but then make it a zonebrick instead. it'll be practically the same. zonebrick is so that you can use the events for when players enter and exit the zone. then what you'd do is make it so that every time a player enters it, they add 1 to a variable (let's call it "touching") that is on that zonebrick. every time a player exits the zone, they subtract 1 from "touching." then for whatever event you want the whole thing to activate, just do a check to make sure that "touching" = the number of players

The value for the number of players on the server is a good idea, and I like the zonebrick method, but there's still a few problems:

1: if there are six people playing and one is dead, it would fail because all five people in the zone =/= the number of players anymore. perhaps there is a way to do a thing where it subtracts a point from the value of players on the server when someone is dead?
2: if there are six people playing and two join. like, if at any point there are players loading, they would be counted. then when all six playing players were on the plate, it would not trigger because all six =/= the eight total players on the server. this would be especially problematic if someone joined just during the finale, and the players would have to wait for him to load. if he spawned, he'd have to make it, and if he didnt make it alone from the spawn to the finish, we run into the dead player problem #1. similiarly, if there are six players playing and all five are on the plate and the sixth disconnects, one person would have to leap off and re-enter to do another check on the number of players. that'd be difficult if the plate happens to be a helicopter.

-snip-

What could be done is:
onMinigameSpawn increment integer
onMinigameLeave decrement integer
onMinigameDeath decrement integer

5 minutes after the game is started:
OnMinigameSpawn player kill

1: if there are six people playing and one is dead, it would fail because all five people in the zone =/= the number of players anymore. perhaps there is a way to do a thing where it subtracts a point from the value of players on the server when someone is dead?
two possible solutions:
A: motivate them to use teamwork by simply requiring everyone to be alive
B: find some way to lower the variable for players each time one of them dies
2: if there are six people playing and two join. like, if at any point there are players loading, they would be counted. then when all six playing players were on the plate, it would not trigger because all six =/= the eight total players on the server. this would be especially problematic if someone joined just during the finale, and the players would have to wait for him to load. if he spawned, he'd have to make it, and if he didnt make it alone from the spawn to the finish, we run into the dead player problem #1. similiarly, if there are six players playing and all five are on the plate and the sixth disconnects, one person would have to leap off and re-enter to do another check on the number of players. that'd be difficult if the plate happens to be a helicopter.
this isn't a problem if you work out something with the spawns and deaths of players in the minigame to determine the number of players

What could be done is:
onMinigameSpawn increment integer
onMinigameLeave decrement integer
onMinigameDeath decrement integer

5 minutes after the game is started:
OnMinigameSpawn player kill
Okay, i see what your saying. So, the order of events would be like this:
-Assume that respawn is off, and each player can only spawn and die once-

When the minigame resets, a variable called "playing" would be set to 0
have that onminigamespawn event incriment "playing" by one, to set the variable equal to the number of players playing
have that onminigamedeath event decriment "playing" by one, to set the variable equal to the number of players subtracted by the dead ones.
have that onminigamedeath event decriment "playing" by one, to set the variable equal to the number of players subtracted by the disconnected ones.

Have a zone/plate at the elevator/helicopter/boat/safehouse
have Onplayerenterzone incriment a variable called "touching" by one, to set the variable equal to the number of players inside/touching the brick
have Onplayerleavezone decriment "touching" by one, to set the variable equal to the number of players inside/touching the brick subtracted by the ones who walked out.
have onplayerenterzone check to see if the variable "touching" is equal to the variable "playing"
have onvariable true set server music to http://www.youtube.com/watch?v=SRnYnggDHHk
have onvariable true set zombie spawns to "NONE"
have onvariable true set minigame center print "You've escaped!"

Excellent idea, but i think there are a few small issues:
Firstly and most importantly, if a player dies, then disconnects, this subtracts two from the variable "playing".
If there were five players, , and one dies before he reaches the finish and quits (or ragequits), "playing" would be set to 3
Then when the four remaining players approached the finish, the game would end when only 3 entered the elevator/helicopter/boat/safehouse
Secondly, as i mentioned before, if four of the five players are inside the chopper and the fifth is killed, a player needs to re-enter the chopper to do another check.
I could make a brick that checks if "playing" = "touching" whenever a player dies to solve that, never mind
Thirdly, I have no idea why you suggested putting an event to kill players 5 minutes after they spawn

ALSO:
two possible solutions:
A: motivate them to use teamwork by simply requiring everyone to be alive
B: you work out something with the spawns and deaths of players in the mini game to determine the number of players
A: you can have the most functional, supportive team and still lose someone at the last hurdle. "simply requiring them to be alive" wont make them immortal.
B: work out something        ....Thanks for the tip.
« Last Edit: March 12, 2014, 06:11:42 PM by K9 Kid »

Thirdly, I have no idea why you suggested putting an event to kill players 5 minutes after they spawn
this would be especially problematic if someone joined just during the finale, and the players would have to wait for him

B: work out something        ....Thanks for the tip.
so you're just wanting someone else to do the work for you?

so you're just wanting someone else to do the work for you?
I posted the request because I could use something that does this.
If I knew what I needed to do to event it, I'd gladly do it myself.
But if I knew how to do it, I wouldnt be requesting a brick that does it, now would I?

If you know how to do it, please exlain it to me more specifically than
you could just work "something" out with the spawns I guess, I feel that would be best, since you could "make it work" only within a minigame too, probably
use VCE and zonebricks "somehow"
two possible solutions:
A: require everyone to be alive
B: find "some way"
work out "something"

Not to say you've been of no help. Your zonebrick method with the "touching" variable is very helpful, but it would break easily with dieing and joining/disconnecting players (see my replies). If a fully functional solution isnt found, I suppose I can still use what you've told me on my zombie townhall holdout server, in which players respawn after 15 seconds and I password the server during the finale. But for all my other maps, players dont respawn, and it would never be passworded, so a solution is yet to be found/brought up.


Also, tony:
-snip-
this would be especially problematic if someone joined just during the finale, and the players would have to wait for him.
5 minutes after the players spawn in the minigame:
Kill them
This still doesnt make sense...
if a player joins before the team finishes, the round doesnt finish without him, and the team dies if they wait?

Regardless, I've solved the problem by making a kill event at the spawn that is enabled after the survivors playing have reached a point. that way the team doesnt need to wait for him to catch up or die. His death would subtract his point from the "playing" variable, so the team can finish without him.
« Last Edit: March 13, 2014, 04:08:43 PM by K9 Kid »

Eh. I think I'll try making this.