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.
[2026-6-23. : 3:29 am]
DarkenedFantasies -- Probably just didn't care. For example, at some point before release, they've updated the graphics of some of the Protoss buildings (Forge, CyberCore, Citadel, Observatory, Arbiter Tribunal), but instead of properly re-rendering them with edited 3D models, they did crappy copy-paste jobs on the rendered graphics.
[2026-6-22. : 8:35 pm]
Ultraviolet -- :wob:
[2026-6-21. : 11:38 pm]
Symmetry -- :wob:
[2026-6-21. : 4:56 am]
Ultraviolet -- I suppose we'll likely never know, but my guess would be that they already saw it operating successfully and there was no monetary incentive to finish the original work. And the dev cycle in old school Blizzard was so hectic, it's possible it just got forgotten about after the original game got released. Plus there's an element of existing MPQ files that were packaged with the original discs becoming outdated if they updated it. And it's not like they remade the original MPQs, they just made new ones for BW specifically
[2026-6-21. : 4:26 am]
Oh_Man -- so that makes me think maybe the theory they are unfinished is not true and its a deliberate design decision, coz why not finish them wen ur making brood war?
[2026-6-21. : 4:25 am]
Oh_Man -- the thing is thos buildings are from classic. that means they went ahead and made brood war without ever finishing the 'unfinished' buildings
[2026-6-20. : 6:15 pm]
Ultraviolet -- Yeah he's talked about a lot of that stuff in his casts before. It seems plausible. Especially knowing how Blizzard of yesteryear operated.
[2026-6-20. : 3:47 pm]
NudeRaider -- to clarify: couldn't recall the behavior for every single Protoss building but I was aware the disparity exists.
[2026-6-20. : 3:43 pm]
NudeRaider -- Contained nothing new for me. Didn't know all building's behavior, but very much all unit's. Also Terran balance whine - also nothing new :lol:
[2026-6-19. : 9:57 am]
Oh_Man -- makes me wonder if SEN knows anything about the topic
Please log in to shout.


Members Online: jun3hong