QUOTE(Mini Moose 2707 @ Mar 26 2005, 10:01 AM)
Triggers are executed in the order of Players, All Players, Forces. They go in terms of numbers. If you're doing a random switch, and want all players to get the same result, have ONE player run the randomization. If you want them all to get different results, have each of them run it.
[right][snapback]172979[/snapback][/right]
Mini Moose i'll say the same thing that i said to Trigger Master yesterday.
Triggers are
not exicuted from Player 1 - Force 4.
There only exicuted Players 1-8. All Players And Force 1-4 are
not players, and they do
not run triggers.
If a trigger is owned by a group (A force or All Players), It will react the EXACT same way that trigger would if it was copied to each of the players in that group.
This is my favorite saying, because it is so true and applies to everything. When you have a trigger owned by a group you don’t just have one trigger, you have a trigger for each player in that group this means those triggers will fire for each player in that group and with that players triggers.
For a simple answer to your questions here they are. Regarding group owned triggers triggers are executed in the order that they are created. (however moving triggers up and down can change this order). Here is a easy way to find determine this.
-Create A trigger for player 1 that displays text LINE ONE
-Create A trigger for All Players that displays text LINE TWO
-Create A trigger for player 1 that displays text LINE THREE
If you run this in star craft you will see Line 1 2 3 in order. But you can also alter this order many times without even realizing it. Try this
Move Line 1 trigger below line 3 then move 3 below 1. Results in 213 because now lines 1 and 3 are after 2 in trigger order.
Groups almost have a form of invisible trigger order (this is why I hate them). But you can still figure it out. To change it the way you want or see the way it will fire change the ownership of line 2 to Player 1 (or all the players that apply). You will then see trigger 2 between triggers 1 and 3 (assuming you didn’t do the test I listed). You can then move it to the place you want and move the trigger back to the same force. The triggers will look the exact same but they will fire in a different order now.
Second Question. Group owned triggers are fired with all the other players triggers. So if you have a crap load of triggers for player 1 and player 2. And you have one trigger owned by force 1 (p1 and 2) then it will fire like this. Player 1s triggers (force trigger will be in the proper ‘hidden’ order. Followed by Player 2s trigger with the force trigger in most likely the same place.
Trigger order is read player 1 2 3 4 5 6 7 8. Group triggers are woven in there with the rest.
Third Question about randomize: It really depends. I could do it both ways but most likely you would get a different result for each player. If you had the following each player would get there own random answer.
| Trigger |
| Players: |
| ¤ All Players |
| Conditions: |
| ¤ Always |
| Actions: |
| ¤ Randomize Switch 1 |
| Trigger |
| Players:All Players |
| Conditions: |
| ¤ Switch 1 is set |
| Actions: |
| ¤ Actions |
All the triggers would fire completely for player one then they would all fire for player 2 and so on.
Anyway to make a set of triggers to give all players the same random result (but appear to not do that is difficult) But here is how it could be done.
| Trigger |
| Players: |
| ¤ All Players |
| Conditions: |
| ¤ Switch Randomization is Clear |
| Actions: |
¤ Randomize Switch 1
|
| ¤ Set Switch Randomization. |
| Trigger |
| Players:All Players |
| Conditions: |
¤ Switch 1 is set
|
| ¤ Switch Randomization is Set |
| Actions: |
| ¤ Actions (not clearing Switch Randomization) |
Now since switches are global this would cause a ‘bug’ that most people would be confused about. When the randomization trigger runs for player 1 it would randomize the switch AND set the randomization switch. It would be followed directly by player 1 receiving a result. BUT since the randomization switch isn’t reset in the actions then player 2’s First trigger will not fire because the conditions are no longer true so Player 2 would continue to get the same results as player 1 and so on for all the players.
This isn’t necessarily a trigger order problem because the randomize trigger is checked before the other players check to see what the random state is. This is a problem with the map creator not realizing that a group owned trigger is multiple triggers that fire at different times. Some times you will see bound maps have a error similar to this. Ever play a bound map and a level gets restarted after someone else trys to catch up from way behind? This happens because the creator unknowingly set up the end of level trigger to run independently for each player.
Its really hard to explain and I’ve spent TONS of time trying to get people to understand how group owned triggers work and still many of them fail to understand.