QUOTE(ShadowSnipe4 @ Nov 4 2004, 09:31 PM)
I did mean how to cast spells for each player withought making a trigger for each player, so when you say current player, should I make the team that the trigger belongs to, the humans team or have it for each player? Confusing....
[right][snapback]94702[/snapback][/right]
Ok i'll try to explain this as simple as i can.
The Secret Behind Group owned triggers and Current PlayerLike my title i figured more people would read it this way lol- Players 1-8 each own there own set of triggers and exicute them if there present in the game. A force or all players
cannot own triggers. When a trigger is checked for a force or all players each player in that group owns a
copy of that trigger.
-When multiple players own these triggers it looks like one trigger but it isn't. For an example group owned triggers fire compleatly independant of eachother. Anotherwords player 1 can fire the trigger and a hour later player 2 will fire his (even if it isn't preserved)
Current player, is simply the player running the trigger. This does
not mean if a trigger is checked for a force current player is all those players. As i will show you a group owned trigger is the same as a copy of that trigger for each player. Current player only refers to the single player running that trigger.
-For and example I'll use several slightly modified triggers and explain the results of each.
| Trigger |
Players:
|
¤ Force 1 (1-4)
|
Conditions:
|
¤ Current player brings at least one men to locaiton 'beacon'
|
Actions:
|
¤ Create one marine for current player at 'spawn center'
|
Ok this will work for players 1-4 whenever any one of the players goes to the beacon, that one player will get a marine. Also if Player 2 decides to go to the same beacon later in the game he will get a marine just like player 1 did. Each player can run the trigger once but no single player can run it more than once.
| Trigger |
Players:
|
¤ Force 1 (1-4)
|
Conditions:
|
¤ Current player brings at least one men to locaiton 'beacon'
|
Actions:
|
¤ Create one marine for force one at 'spawn center'
|
In this trigger the actions speifiy the force. When you create a unit for a force each player in that force will get a copy of that unit. But keep in mind in this case the conditions still specify 'current player'. So when player 1 goes to the beacon, players 1-4 will all get a marine. If player 2 goes to the beacon later players 1-4 will get one more marine.
| Trigger |
Players:
|
¤ Force 1 (1-4)
|
Conditions:
|
¤ Force 1 brings at least one men to locaiton 'beacon'
|
Actions:
|
¤ Create one marine for current player at 'spawn center'
|
In this example the conditions state force 1. What happens here is whenever ANY one player goes to the beacon all the players triggers fire. So each player will end up with one marine. If you look at the 4 players seperatly it makes since. When player 1 checks his trigger it will go off even if player 2 is standing on the beacon. Afterall player 2 is part of force 1 so it satisfies player ones trigger. Also imediately after player 1 runs his trigger Player 2 two will run his creating a second marine. The same will happen for players 3 and 4.
| Trigger |
Players:
|
¤ Force 1 (1-4)
|
Conditions:
|
¤ Force 1 brings at least one men to locaiton 'beacon'
|
Actions:
|
¤ Create one marine for Force 1 at 'spawn center'
|
This is the two above combined. When ever any player goes to the beacon all 4 player's trigger will fire. But since it is creating the unit for the force each players trigger will create the unit for each player. So if player 3 goes to the beacon each player will get 4 marines.
| Trigger |
Players:
|
¤ Force 1 (1-4)
|
Conditions:
|
¤ Current player brings at least one men to locaiton 'beacon'
|
¤ Switch 1 is clear
|
Actions:
|
¤ Create one marine for current player at 'spawn center'
|
¤ Set Switch 1
|
Now the switch might seem a little pointless but as we saw before without the switch each player that goes to the beacon will get his own marine. This trigger works so only the FIRST player who goes to the beacon will get a marine. After that the switch will be set so the other players cannot get their marine. (keep in mind if the switch is cleared later the remaining 3 players are eligable to get the marine)
Hopefully these examples will help you understand how things work. You must veiw group owned triggers as MULTIPLE triggers, cause they are.
QUOTE(ShadowSnipe4 @ Nov 4 2004, 11:24 PM)
Another Wuick Question, can protoss units be loaded into a dropship and also does the AI script work on human players too or do i have to give the Dropship to a computer, then load the unit, then ive it back to the player, and Legacy, when you say for each player do you mean that have it one trigger and then in the players thing have it for P1, P2, P3, P4 or copy and edit each trigger to work for one player only?
[right][snapback]94748[/snapback][/right]
Yes, Yes, No i doubt he means that if he does you shouldn't do it lol.