Author Topic: [Solved] VCE Variable for dead teammates in Slayer?  (Read 124 times)

Basically what the title says, I have a rescue system that checks if there are any dead players in the team in order to trigger an event. But it needs this variable.

Just like how there's <var:mg:teamliving1-6>, I'd like for there to be a variable like <var:mg:teamdead1-6>


I sort of solved it, check here.
https://forum.blockland.us/index.php?topic=324084.msg10003671#msg10003671
« Last Edit: August 09, 2019, 01:17:08 AM by Spartan224 »

Can't you just check if team living is false?

I could, but there needs to be at least one player alive to trigger the event I'm doing.

Code: [Select]
[x][0] onMinigameDeath -> Self -> VCE_modVariable("Brick", "<var:cl:teamname>", "Set", 1, 0, 0, 0, 0)
[x][0] onActivate -> Self -> VCE_ifVariable("<var:cl:teamname>", "==", 1, "2 4", 0, 0, 0, 0)
[x][0] onVariableTrue -> Client -> CenterPrint("There is a dead member of your team!", 3, 0, 0, 0, 0)
[x][0] onVariableTrue -> Self -> VCE_modVariable("Brick", "<var:cl:teamname>", "Set", 0, 0, 0, 0, 0)
[x][0] onVariableFalse -> Client -> CenterPrint("There isn't a dead member of your team!", 3, 0, 0, 0, 0)
This is a quick demo where someone can check if there is a dead team member on their team. This might not work depending on how your rescue system works though.

Code: [Select]
[x][0] onMinigameDeath -> Self -> VCE_modVariable("Brick", "<var:cl:teamname>", "Set", 1, 0, 0, 0, 0)
[x][0] onActivate -> Self -> VCE_ifVariable("<var:cl:teamname>", "==", 1, "2 4", 0, 0, 0, 0)
[x][0] onVariableTrue -> Client -> CenterPrint("There is a dead member of your team!", 3, 0, 0, 0, 0)
[x][0] onVariableTrue -> Self -> VCE_modVariable("Brick", "<var:cl:teamname>", "Set", 0, 0, 0, 0, 0)
[x][0] onVariableFalse -> Client -> CenterPrint("There isn't a dead member of your team!", 3, 0, 0, 0, 0)
This is a quick demo where someone can check if there is a dead team member on their team. This might not work depending on how your rescue system works though.
That might work, I'll try it out. I'm only using two teams which only one of them has players. Although if other people try out that system with players on both teams, it might not work for them since that deathcount is going to account for all teams. I think.

The way it's set up right now, when someone dies their team's special variable gets a flag turned on. In the demo it's set up were the only people who can see a team's variable is if they're on that team. This can be changed though if you hardcode each team's names in the check allowing you to know which one has dead players.
« Last Edit: August 09, 2019, 12:48:58 AM by Monoblaster4 »

Ah, I get it now. Thanks for clarifying.

EDIT: I also figured out another method that's easy enough for me, but it only works for one team only. I'm basically checking if the teammates alive are less than the number of players in the server. This probably won't work for multiple player teams since there'll be more players alive than the team. But this should work fine for me.

The two values I'm using are <var:mg:teamliving1> and <var:global:playercount> for those who are wondering.



But anyways, I'll keep your other solution in mind as well. Just in case I'll need it, thanks for the idea though Monoblaster. Locking the thread.
« Last Edit: August 09, 2019, 02:23:04 AM by Spartan224 »

I realized that there's another variable called <var:mg:teammembers[1-6]> that is way more efficient than checking if there are dead players or how many people are on the server. So I'm going to use that instead, locking the thread once more.

So I just replaced <var:global:playercount> with that new one if anyone's wondering.