Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Triggers not Working
Triggers not Working
Jun 15 2016, 3:42 am
By: Dem0n  

Jun 15 2016, 3:42 am Dem0n Post #1

ᕕ( ᐛ )ᕗ

In my map, the players start off in a town with civilians. If you kill a civilian, you go to jail for 5 minutes. Likewise, if you kill a player, you go to jail for ten minutes. The triggers to send the players to jail if they kill civilians work fine, but the ones to send the players to jail if they kill each other don't. They work fine for player 1, but for any other player, the triggers only fire if player 1 kills them as well. By that I mean that if you kill player 1 and then player 1 respawns and kills you, you'll both go to jail. Here are my triggers:


Detecting civi kill/Sending player to jail:

Code
//-----------------------------------------------------------------//

Trigger("Player 1","Player 2","Player 3"){
Conditions:
 Score("Current Player", Kills, At least, 80);
 Deaths("Player 7", "Terran Civilian", At least, 8);

Actions:
 Set Score("Current Player", Subtract, 80, Kills);
 Set Deaths("Current Player", "Terran Civilian", Set To, 1);
 Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 1","Player 2","Player 3"){
Conditions:
 Score("Current Player", Kills, At least, 40);
 Deaths("Player 7", "Terran Civilian", At least, 4);

Actions:
 Set Score("Current Player", Subtract, 40, Kills);
 Set Deaths("Current Player", "Terran Civilian", Set To, 1);
 Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 1","Player 2","Player 3"){
Conditions:
 Score("Current Player", Kills, At least, 20);
 Deaths("Player 7", "Terran Civilian", At least, 2);

Actions:
 Set Score("Current Player", Subtract, 20, Kills);
 Set Deaths("Current Player", "Terran Civilian", Set To, 1);
 Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 1","Player 2","Player 3"){
Conditions:
 Score("Current Player", Kills, At least, 10);
 Deaths("Player 7", "Terran Civilian", At least, 1);

Actions:
 Set Score("Current Player", Subtract, 10, Kills);
 Set Deaths("Current Player", "Terran Civilian", Set To, 1);
 Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 1","Player 2","Player 3"){
Conditions:
 Deaths("Current Player", "Terran Civilian", At least, 1);

Actions:
 Set Deaths("Current Player", "Dark Swarm", Set To, 3600);
 Set Deaths("Current Player", "Terran Civilian", Set To, 0);
 Give Units to Player("Current Player", "Player 4", "Men", All, "player");
 Move Unit("Player 4", "Men", All, "player", "split");
 Create Unit("Current Player", "Protoss Probe", 1, "split");
 Set Deaths("Current Player", "Bengalaas (Jungle)", Set To, 1);
 Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 1","Player 2","Player 3"){
Conditions:
 Deaths("Current Player", "Vespene Geyser", Exactly, 1);

Actions:
 Set Deaths("Current Player", "Dark Swarm", Set To, 7200);
 Set Deaths("Current Player", "Vespene Geyser", Set To, 0);
 Give Units to Player("Current Player", "Player 4", "Men", All, "player");
 Move Unit("Player 4", "Men", All, "player", "split");
 Create Unit("Current Player", "Protoss Probe", 1, "split");
 Set Deaths("Current Player", "Bengalaas (Jungle)", Set To, 1);
 Preserve Trigger();
}

//-----------------------------------------------------------------//


Detecting team kill:

Code
//-----------------------------------------------------------------//

Trigger("Player 1","Player 2","Player 3"){
Conditions:
 Score("Current Player", Kills, At least, 100);
 Deaths("Force 1", "Terran Marine", At least, 1);

Actions:
 Set Score("Current Player", Subtract, 100, Kills);
 Set Deaths("Current Player", "Vespene Geyser", Set To, 1);
 Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 1","Player 2","Player 3"){
Conditions:
 Score("Current Player", Kills, At least, 350);
 Deaths("Force 1", "Terran Ghost", At least, 1);

Actions:
 Set Score("Current Player", Subtract, 350, Kills);
 Set Deaths("Current Player", "Vespene Geyser", Set To, 1);
 Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 1","Player 2","Player 3"){
Conditions:
 Score("Current Player", Kills, At least, 400);
 Deaths("Force 1", "Terran Goliath", At least, 1);

Actions:
 Set Score("Current Player", Subtract, 400, Kills);
 Set Deaths("Current Player", "Vespene Geyser", Set To, 1);
 Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 1","Player 2","Player 3"){
Conditions:
 Score("Current Player", Kills, At least, 1400);
 Deaths("Force 1", "Protoss Archon", At least, 1);

Actions:
 Set Score("Current Player", Subtract, 1400, Kills);
 Set Deaths("Current Player", "Vespene Geyser", Set To, 1);
 Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 1","Player 2","Player 3"){
Conditions:
 Score("Current Player", Kills, At least, 650);
 Deaths("Force 1", "Protoss Dark Templar", At least, 1);

Actions:
 Set Score("Current Player", Subtract, 650, Kills);
 Set Deaths("Current Player", "Vespene Geyser", Set To, 1);
 Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 1","Player 2","Player 3"){
Conditions:
 Score("Current Player", Kills, At least, 700);
 Deaths("Force 1", "Protoss High Templar", At least, 1);

Actions:
 Set Score("Current Player", Subtract, 700, Kills);
 Set Deaths("Current Player", "Vespene Geyser", Set To, 1);
 Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 1","Player 2","Player 3"){
Conditions:
 Score("Current Player", Kills, At least, 200);
 Deaths("Force 1", "Jim Raynor (Marine)", At least, 1);

Actions:
 Set Score("Current Player", Subtract, 200, Kills);
 Set Deaths("Current Player", "Vespene Geyser", Set To, 1);
 Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 1","Player 2","Player 3"){
Conditions:
 Score("Current Player", Kills, At least, 700);
 Deaths("Force 1", "Alexei Stukov (Ghost)", At least, 1);

Actions:
 Set Score("Current Player", Subtract, 700, Kills);
 Set Deaths("Current Player", "Vespene Geyser", Set To, 1);
 Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 1","Player 2","Player 3"){
Conditions:
 Score("Current Player", Kills, At least, 800);
 Deaths("Force 1", "Alan Schezar (Goliath)", At least, 1);

Actions:
 Set Score("Current Player", Subtract, 800, Kills);
 Set Deaths("Current Player", "Vespene Geyser", Set To, 1);
 Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 1","Player 2","Player 3"){
Conditions:
 Score("Current Player", Kills, At least, 2800);
 Deaths("Force 1", "Tassadar/Zeratul (Archon)", At least, 1);

Actions:
 Set Score("Current Player", Subtract, 2800, Kills);
 Set Deaths("Current Player", "Vespene Geyser", Set To, 1);
 Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 1","Player 2","Player 3"){
Conditions:
 Score("Current Player", Kills, At least, 800);
 Deaths("Force 1", "Zeratul (Dark Templar)", At least, 1);

Actions:
 Set Score("Current Player", Subtract, 800, Kills);
 Set Deaths("Current Player", "Vespene Geyser", Set To, 1);
 Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 1","Player 2","Player 3"){
Conditions:
 Score("Current Player", Kills, At least, 1400);
 Deaths("Force 1", "Tassadar (Templar)", At least, 1);

Actions:
 Set Score("Current Player", Subtract, 1400, Kills);
 Set Deaths("Current Player", "Vespene Geyser", Set To, 1);
 Preserve Trigger();
}

//-----------------------------------------------------------------//


I'm using binary countoffs to track when the players kill civilians in case there's any splash kills, so that's why there are four of those. I've checked everywhere, and this is the only time I use Vespene Geyser as a death count, so I'm not sure what's going on. I assume it has something to do with trigger order, and since player 1 fires first, that's why the triggers work fine for them, but I'm not seeing anything that could cause problems.

Post has been edited 1 time(s), last time on Jun 15 2016, 3:50 am by Dem0n.




Jun 15 2016, 9:12 am lil-Inferno Post #2

Just here for the pie

Try subtracting the deaths.




Jun 15 2016, 4:10 pm Dem0n Post #3

ᕕ( ᐛ )ᕗ

I have a separate trigger beneath the respawn triggers that subtract the deaths, so I don't think that's the problem.




Jun 16 2016, 2:33 am Roy Post #4

An artist's depiction of an Extended Unit Death

Quote from Dem0n
I have a separate trigger beneath the respawn triggers that subtract the deaths, so I don't think that's the problem.
That's exactly the problem: Player 1 subtracts the deaths before Player 2's triggers run.




Jun 16 2016, 2:46 am jjf28 Post #5

Cartography Artisan

Quote from Roy
Quote from Dem0n
I have a separate trigger beneath the respawn triggers that subtract the deaths, so I don't think that's the problem.
That's exactly the problem: Player 1 subtracts the deaths before Player 2's triggers run.


Every Set Deaths is for current player...? Right still grouped conditions.

Post has been edited 1 time(s), last time on Jun 16 2016, 3:21 am by jjf28.



TheNitesWhoSay - Clan Aura - github

Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

Jun 16 2016, 3:20 am Dem0n Post #6

ᕕ( ᐛ )ᕗ

Quote from Roy
Quote from Dem0n
I have a separate trigger beneath the respawn triggers that subtract the deaths, so I don't think that's the problem.
That's exactly the problem: Player 1 subtracts the deaths before Player 2's triggers run.
Ya you're right. I forgot that the players won't have any deaths of their unit by the time the game checks to see if the next player killed an ally. I moved the team kill triggers above the jail triggers and made a trigger for player 4 to set the deaths 0, which runs after players 1-3.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:24 pm]
Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
[2024-4-30. : 5:08 pm]
Oh_Man -- https://youtu.be/lGxUOgfmUCQ
[2024-4-30. : 7:43 am]
NudeRaider -- Vrael
Vrael shouted: if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
Yeah I'm not a big fan of Westernhagen either, Fanta vier much better! But they didn't drop the lyrics that fit the situation. Farty: Ich bin wieder hier; nobody: in meinem Revier; Me: war nie wirklich weg
[2024-4-29. : 6:36 pm]
RIVE -- Nah, I'm still on Orange Box.
[2024-4-29. : 4:36 pm]
Oh_Man -- anyone play Outside the Box yet? it was a fun time
[2024-4-29. : 12:52 pm]
Vrael -- if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
[2024-4-29. : 11:17 am]
Zycorax -- :wob:
[2024-4-27. : 9:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[2024-4-27. : 7:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[2024-4-27. : 6:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
Please log in to shout.


Members Online: Roy