Staredit Network > Forums > SC1 Melee Map Projects > Topic: Replacement to Default Melee Triggers
Replacement to Default Melee Triggers
Jul 1 2009, 8:21 pm
By: flagitious  

Jul 1 2009, 8:21 pm flagitious Post #1



Edit: the triggers have been updated, see post #5

The default melee triggers work fine for most cases, but there are a few flaws with them and a few handy things you can add to make them better without any drawbacks (you can just copy/paste). This stuff is nothing revolutionary, but it certainly is an improvement to the defaults.

Command("Non Allied Victory Players", "Buildings", At most, 0);
This trigger is fundamentally flawed. Non allied victory players refers to all the players which have mutual allied victory status with the current player. But what if there are 3 players, A, B and C. A and B are not allied, but both of them are mutually allied to C. When the triggers get to C, Victory will trigger because as far as C is concerned everyone is allied victory, even though this would not happen (and should not) in melee. This actually happened to me in a game once and it confused me a great deal since I thought there could not possibly be a problem with the default melee triggers.

Wormer pointed out that you can use Opponents at most 0, but this is of no use for maps with observers, because they count as opponents. I will paste all the triggers at the end, but here is a brief description of how to do this trigger properly: each trigger cycle check if any player has buildings and non allied victory players with buildings. At next trigger cycle check if none of the players met this criteria and if so then run victory for players with buildings.

In melee when you kill someone, it beeps and displays a <player> eliminated message. This is handy and should be in obs maps too.

Also if you are eliminated in a 2v2 for example, it is annoying that you can't stay and watch your partner. The best thing to do is allow players to stay (but don't automatically give them enemy vision).

Sometimes you want to have more observers than there are observer slots (especially true for 6+ player maps). What people do then is pick terran, lift and hide their cc. What the kespa version of hunters map did is, when they lift cc in first 10 seconds, just make them an observer and remove their units/buildings. This is a good idea and no reason not to have it on non 8 player maps.

Lastly I suggest you organize your melee map to always have these triggers. And then when you want to make it an obs map all you have to do is add the start locations. Or if you want to go from obs map to normal map all you have to do is delete the obs start locations. Remember to create a location covering the entire map called ground (which is only for ground units), this is used for the cc lift detect. You might also want to add the transmission sound into the sound editor. These triggers are for 4 player maps, if your map is a different amount you should also add/remove the +vision for the correct number of players (actually there is no harm in having +vision for all 8 even if only 4 players).

Here are the triggers (note hyper triggers are recommended, just so it is more responsive, but they have been omitted for conciseness):
Code
Trigger("all players"){
Conditions:
   Deaths("all players", "Khaydarin Crystal", at most, 0);
Actions:
   Set Deaths("current player", "Khaydarin Crystal", set to, 1);
}

Trigger("Players"){
Conditions:
   Always();
Actions:
   Set Resources("current player", set to, 50, ore);
}

Trigger("Players"){
Conditions:
   Command("current player", "buildings", at most, 0);
   Deaths("current player", "Ruins", at most, 0);
Actions:
   Give Units To Player("current player", "player 12", "any unit", All, "Anywhere");
   Set Deaths("all players", "Jump Gate", add, 1);
}

Trigger("all players"){
Conditions:
   Deaths("current player", "Jump Gate", at least, 1);
Actions:
   Set Deaths("current player", "Jump Gate", subtract, 1);
   Display Text Message(always display, "<3>Player eliminated.");
   Play WAV("sound\\Misc\\Transmission.wav", 0);
   Preserve Trigger();
}

Trigger("Players"){
Conditions:
   Deaths("current player", "Khaydarin Crystal", at least, 1);
   Switch("switch1", set);
Actions:
   Set Switch("switch2", set);
}

Trigger("Players"){
Conditions:
   Switch("switch2", set);
   Command("current player", "buildings", at least, 1);
Actions:
   Wait(1200);
   Victory();
}

Trigger("Players"){
Conditions:
   Deaths("current player", "Khaydarin Crystal", at least, 1);
Actions:
   Preserve Trigger();
   Set Switch("switch1", set);
}

Trigger("Players"){
Conditions:
   Command("current player", "buildings", at least, 1);
   Command("Non Allied Victory Players", "buildings", at least, 1);
Actions:
   Preserve Trigger();
   Set Switch("switch1", clear);
}

Trigger("all players"){
Conditions:
   Elapsed Time(at most, 9);
   Bring("current player", "buildings", "ground", at most, 0);
Actions:
   Run AI Script("+Vi0");
   Run AI Script("+Vi1");
   Run AI Script("+Vi2");
   Run AI Script("+Vi3");
   Set Deaths("current player", "Ruins", set to, 1);
   Remove Unit("current player", "any unit");
}


Note that this is automatically generated using http://www.staredit.net/topic/7600/ here is the source for that:
Code
require'abstractions.rb'

alertElim=var
isObserver=var
allAllied=switch
doVictory=switch


section "Players"
trig(Ore.set(50))

trig(AnyBuilding.off?, isObserver.off?) {
 give(Neutral)
 runall(All) {
   display '<3>Player eliminated.'
   playwav 'Misc\Transmission', true
   pt
 }
}

#trig(AnyBuilding[NonAlliedVictoryPlayers].off?) { victory }
trig(firstplayer.on?, allAllied.on?) {
 doVictory.set
}
trig(doVictory.on?,AnyBuilding.on?) {
 wait(1200)
 victory
}
ponce(allAllied.set)
ptrig(AnyBuilding.on?, AnyBuilding[NonAlliedVictoryPlayers].on?) {
 allAllied.clear
}
 

section All
trig(ElapsedTime<10, AnyBuilding.at("ground").off?) {
 1.upto(4) {|i|
   Vision+i
 }
 isObserver.set
 clear
}

hypertriggers


You can download an example map here: http://golfscript.com/temp/bbobs.scm

I wrote this in hopes that it will be useful for melee map makers. Not enough content here to warrant a sticky but I would greatly appreciate it if the http://www.staredit.net/topic/378/ could edit in a link to this topic. Or maybe I should look into how to add things to the wiki.

Post has been edited 1 time(s), last time on Dec 5 2009, 10:11 pm by flagitious.



None.

Jul 1 2009, 8:42 pm ClansAreForGays Post #2



SI should definitely replace his default triggers with yours in his next SCMDraft version.




Jul 20 2009, 3:24 am Moon)SHieLD( Post #3



Where can I get these triggers?



None.

Jul 23 2009, 11:23 pm Vi3t-X Post #4



He posted the triggers.



None.

Dec 5 2009, 10:14 pm flagitious Post #5



I was playing and found a bug in my triggers, apparently commands at least 1 building does not count buildings that are under construction, while commands at most 1 building does. This is fixed now. Also added it so that if a player lifts cc to become obs, it auto allies and receives alliance from the other observers (for ac talking).

Quote
Trigger("all players"){
Conditions:
Deaths("all players", "Khaydarin Crystal", at most, 0);
Actions:
Set Deaths("current player", "Khaydarin Crystal", set to, 1);
}

Trigger("all players"){
Conditions:
Deaths("current player", "Khaydarin Crystal", at least, 1);
Deaths("all players", "Ruins", at most, 0);
Deaths("all players", "Jump Gate", at least, 1);
Actions:
Set Switch("switch1", set);
}

Trigger("Players"){
Conditions:
Always();
Actions:
Set Resources("current player", set to, 50, ore);
Set Deaths("current player", "Jump Gate", set to, 1);
}

Trigger("Players"){
Conditions:
Command("current player", "buildings", at most, 0);
Deaths("current player", "Independent Starport", at most, 0);
Actions:
Give Units To Player("current player", "player 12", "any unit", All, "Anywhere");
Set Deaths("current player", "Jump Gate", set to, 0);
Set Deaths("current player", "Ruins", set to, 0);
Set Deaths("all players", "Independent Command Center", add, 1);
}

Trigger("all players"){
Conditions:
Deaths("current player", "Independent Command Center", at least, 1);
Actions:
Set Deaths("current player", "Independent Command Center", subtract, 1);
Display Text Message(always display, "<3>Player eliminated.");
Play WAV("sound\\Misc\\Transmission.wav", 0);
Preserve Trigger();
}

Trigger("Players"){
Conditions:
Switch("switch1", set);
Deaths("current player", "Jump Gate", at least, 1);
Actions:
Wait(1000);
Victory();
}

Trigger("Players"){
Conditions:
Deaths("current player", "Jump Gate", at least, 1);
Actions:
Preserve Trigger();
Set Deaths("current player", "Ruins", set to, 1);
}

Trigger("Players"){
Conditions:
Command("Non Allied Victory Players", "buildings", at most, 0);
Actions:
Preserve Trigger();
Set Deaths("current player", "Ruins", set to, 0);
}

Trigger("all players"){
Conditions:
Elapsed Time(at most, 9);
Bring("current player", "buildings", "ground", at most, 0);
Actions:
Run AI Script("+Vi0");
Run AI Script("+Vi1");
Run AI Script("+Vi2");
Run AI Script("+Vi3");
Run AI Script("+Vi4");
Run AI Script("+Vi5");
Run AI Script("+Vi6");
Run AI Script("+Vi7");
Set Deaths("current player", "Independent Starport", set to, 1);
Set Deaths("current player", "Jump Gate", set to, 0);
Set Deaths("current player", "Ruins", set to, 0);
Remove Unit("current player", "any unit");
}

Trigger("all players"){
Conditions:
Deaths("current player", "Independent Starport", at least, 1);
Deaths("player 1", "Independent Starport", at least, 1);
Actions:
Set Alliance Status("player 1", Allied Victory);
}

Trigger("all players"){
Conditions:
Deaths("current player", "Independent Starport", at least, 1);
Deaths("player 2", "Independent Starport", at least, 1);
Actions:
Set Alliance Status("player 2", Allied Victory);
}

Trigger("all players"){
Conditions:
Deaths("current player", "Independent Starport", at least, 1);
Deaths("player 3", "Independent Starport", at least, 1);
Actions:
Set Alliance Status("player 3", Allied Victory);
}

Trigger("all players"){
Conditions:
Deaths("current player", "Independent Starport", at least, 1);
Deaths("player 4", "Independent Starport", at least, 1);
Actions:
Set Alliance Status("player 4", Allied Victory);
}

Trigger("all players"){
Conditions:
Deaths("current player", "Independent Starport", at least, 1);
Deaths("player 5", "Independent Starport", at least, 1);
Actions:
Set Alliance Status("player 5", Allied Victory);
}

Trigger("all players"){
Conditions:
Deaths("current player", "Independent Starport", at least, 1);
Deaths("player 6", "Independent Starport", at least, 1);
Actions:
Set Alliance Status("player 6", Allied Victory);
}

Trigger("all players"){
Conditions:
Deaths("current player", "Independent Starport", at least, 1);
Deaths("player 7", "Independent Starport", at least, 1);
Actions:
Set Alliance Status("player 7", Allied Victory);
}

Trigger("all players"){
Conditions:
Deaths("current player", "Independent Starport", at least, 1);
Deaths("player 8", "Independent Starport", at least, 1);
Actions:
Set Alliance Status("player 8", Allied Victory);
}

Trigger("all players"){
Conditions:
Always();
Actions:
Preserve Trigger();
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
}

Trigger("all players"){
Conditions:
Always();
Actions:
Preserve Trigger();
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
}

Trigger("all players"){
Conditions:
Always();
Actions:
Preserve Trigger();
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
Wait(0);
}




None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
[2024-4-17. : 3:26 am]
O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
[2024-4-17. : 1:53 am]
Vrael -- bet u'll ask for my minerals first and then just send me some lousy vespene gas instead
[2024-4-17. : 1:52 am]
Vrael -- hah do you think I was born yesterday?
[2024-4-17. : 1:08 am]
O)FaRTy1billion[MM] -- i'll trade you mineral counts
[2024-4-16. : 5:05 pm]
Vrael -- Its simple, just send all minerals to Vrael until you have 0 minerals then your account is gone
[2024-4-16. : 4:31 pm]
Zoan -- where's the option to delete my account
[2024-4-16. : 4:30 pm]
Zoan -- goodbye forever
Please log in to shout.


Members Online: jun3hong, Ultraviolet, lil-Inferno