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");
}
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
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.