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.
[03:20 am]
Symmetry -- Dang I'm up to 155 minerals gambling really pays off guys
[2026-10-11. : 6:02 am]
Donald -- Samase
[2026-10-09. : 2:53 am]
Mr.BurnLiquid -- Symmetry
Symmetry shouted: I'll check it out this weekend!
Thanks
[2026-10-09. : 2:47 am]
Symmetry -- I'll check it out this weekend!
[2026-10-09. : 2:40 am]
Mr.BurnLiquid -- Symmetry
Symmetry shouted: Another map maker? Damn we really ARE back
I invite you to try out the map I modified. I don't have the creativity to create maps from scratch, but I do have the know-how to modify existing ones; my project is to tweak community campaigns (specifically those with errors—to make them playable.
[2026-10-09. : 2:27 am]
Symmetry -- Another map maker? Damn we really ARE back
[2026-10-09. : 1:51 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
Now that I wanted to change my avatar, the error image is showing up, haha.
[2026-10-09. : 1:34 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
Mr.BurnLiquid
Mr.BurnLiquid shouted: Ultraviolet Thanks; I'm new to the site and a Spanish speaker. I must have missed the part where it was prohibited—I'll change it now.
I invite you to try out a mission I'm modifying from *StarCraft Reversed*; I'm trying to make it more playable and challenging.
[2026-10-09. : 1:33 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
Thanks; I'm new to the site and a Spanish speaker. I must have missed the part where it was prohibited—I'll change it now.
Please log in to shout.


Members Online: NudeRaider, DarkenedFantasies