Frankly I find using Waits confusing anyway, because they apply only to the trigger in which the wait appears and don't apply to other triggers, so if you have a complex series of events that need to take place that requires you to have more than 1 trigger to implement the system, using waits in any of the triggers makes the logic much harder to understand.
Anything that can be done with waits, can be done using the Death Count technique instead, and with much more precision, trace-ability and are much easier to debug.
Trying to see how to implement this.
Reserve a certain death count to a sequence.
Some condition is met and it begins incrementing the death count.
Other triggers conditions are met at specific death counts.
Sounds like it would take allot of triggers to do something you should be able to do in just one but I can see how it could be useful.
I had an audio dialog sequence but it would freeze up in the middle of playing due to wait blocks caused by hyper triggers.
I have a series of switch I call player focus 1-8. So if player 6 has focus and a focus related trigger runs it does something to for that player and cycles the focus to the next player. I have another set of triggers that when a player has focus if he is not in the game it cycles it past him. I am also using the focus switches as a condition to running the hyper triggers, this gives me the added ability to turn them on or off.
In order to play an audio sequence with minimal effect to the hyperactivity of the game this is the function I generated.
Collapse Box
//-----------------------------------------------------------------//
Trigger("All players"){
Conditions:
Command("Current Player", "Terran Siege Tank (Tank Mode)", At least, 20);
Command("Current Player", "Protoss Gateway", Exactly, 1);
Countdown Timer(At most, 1);
Actions:
Set Switch("Player Focus 1", clear);
Set Switch("Player Focus 2", clear);
Set Switch("Player Focus 3", clear);
Set Switch("Player Focus 4", clear);
Set Switch("Player Focus 5", clear);
Set Switch("Player Focus 6", clear);
Set Switch("Player Focus 7", clear);
Set Switch("Player Focus 8", clear);
Play WAV("sound\\Terran\\SCV\\TSCPss05.WAV", 0);
Wait(250);
Wait(250);
Wait(250);
Wait(250);
Wait(250);
Wait(250);
Wait(250);
Wait(250);
Wait(250);
Play WAV("sound\\Terran\\FRIGATE\\TVkWht00.WAV", 0);
Wait(250);
Wait(250);
Wait(250);
Wait(250);
Wait(250);
Wait(250);
Wait(250);
Wait(250);
Play WAV("sound\\Terran\\FRIGATE\\TVkPss01.WAV", 0);
Wait(250);
Wait(250);
Wait(250);
Wait(250);
Wait(250);
Wait(250);
Wait(250);
Wait(250);
Wait(250);
Play WAV("sound\\Terran\\SCV\\TSCYes00.WAV", 0);
Wait(250);
Wait(250);
Wait(250);
Wait(250);
Wait(250);
Wait(250);
Play WAV("sound\\Terran\\FRIGATE\\TVkYes02.WAV", 0);
Wait(250);
Wait(250);
Wait(250);
Wait(250);
Wait(250);
Wait(250);
Kill Unit At Location("Current Player", "Terran Siege Tank (Tank Mode)", 1, "Anywhere");
Set Switch("Player Focus 1", set);
Preserve Trigger();
}
//-----------------------------------------------------------------//
The first command removes focus from every player, longer waits are replaced with a series of short ones. At the end it sets focus on player one. I may end up adding a hyper hold switch as a condition in the hyper triggers so I don't change focus.
You can run one wait per player at a time by giving the hyper triggers to All Players and putting the Hyper Triggers at the BOTTOM of the trigger list so that they are executing last. Having hyper triggers owned by all players will not induce lag, I am sure of this because I've used this method in Überena and Armored Core, among other maps, where there was no dedicated computer player that would always be in the game. The only potential problems can come up if every player in the game runs a nonzero wait simultaneously - and I am not even sure if that actually would cause a problem anyway.
I kept getting wait blocks but I did not pay much attention to where the hyper triggers executed from. Maybe I could have just moved them and not had to deal with any of this hassle.
I frequently use trigedit alpha 1 included in scmdraft 2 v 0.8, is there a utility to add a condition or action from a bunch of triggers at once? I have used notepad to find and replace things like switch triggers I add as padding in EDUgen, and I can use find and replace to remove an action or condition but I cant seem to find a way to add them.
Post has been edited 1 time(s), last time on Mar 22 2013, 6:07 pm by The_Master. Reason: Thanks for showing how to colapse box
None.