We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch
Player setup and intended conditions and actions for the respective players are the defining factor for the resulting triggers. So I'm gonna explain increasingly difficult examples, each time introducing a new mechanic. At the end you should be able to figure out even complex relationships. So bear with me if this is gonna be a bit longer.
First you need to define which player(s) the
conditions should be checked for.
If it's really just P1 then you can leave P1 in the conditition. Should
any player (
of Force 1) be able to trigger it, then tell sc just that by making the condition "
All Players (
or Force 1) brings ..."
As for the
action you probably never wanna create units for a specific player (P1, P2, etc.) unless you are 100% certain that player is always there. Creating units for All Players or Force 1 is also only useful if you have only 1 trigger owner. Also trigger owner can radically change the outcome of triggers: That's because triggers owned by multiple players, will be copied for and run by each player so each player will spawn the specified amount of units. Example:
Player 1
Player 2
Player 1 brings Civ to beacon
Create 1 Marine for All Players
This will create 2 Marines for each
active player (occupied slot and not defeated). So you avoid hostile units for "ghost players" but are probably creating more marines than you wanted.
So what you wanna go for is use Current Player. Current Player is whoever currently runs this trigger. Remember, each owner will run their own copy of the trigger. When P1 runs it, Current Player is replaced with P1, when P2 runs it Current Player = P2.
Player 1
Player 2
Player 1 brings Civ to beacon
Create 1 Marine for Current Player
This will create 1 Marine for both P1 and P2 but will skip any players that aren't there because they won't run their copy of the trigger. Only active players execute triggers.
Using Current Player is the cleanest way, but also requires some extra care if you have actions that should
run only once (e.g. reward 100 Minerals to whoever brought the civ)
AND actions that
each player should run (e.g. create 1 Marine for them).
You could do it like that:
Player 1
Player 2
Current Player brings 1 civ to Beacon
Give 100 Minerals to Current Player
Create 1 Marine for Force 1 *
*) Only works as intended if P1 and P2 are the only ones in Force 1. Only one Player has their condition true about the civ being there, so only that player will run it. They will give themselves 100 Minerals and create the units for everyone.
For really complex setups where the players aren't even in the same force, the cleanest way is to use a death counter variable to keep track of who runs what and split it up:
Player 1
Player 2
Current Player brings 1 civ to Beacon
Set death counter 'Cantina' (rename to 'civ_beacon' or w/e) set to 1 for P1
Set death counter civ_beacon set to 1 for P2
Set death counter civ_beacon add 1 for Current Player
Whoever brings the civ to the beacon has
2 deaths of 'civ_beacon',
the rest has
1.
Player 1
Player 2
Current Player suffered exactly 1 death of civ_beacon
create 1 Marine for Current Player
Set deaths of civ_beacon to 0 for Current Player
If you have 1 death you weren't the player that brought the civ, so you just get a marine.
Player 1
Player 2
Current Player suffered exactly 2 deaths of civ_beacon
Give 100 Minerals to Current Player
create 1 Marine for Current Player
Set deaths of civ_beacon to 0 for Current Player
If you have 2 deaths you brought the civ, so you just get a marine and extra minerals.
I hope the color coding helps you keep track who is who and how the dc count keeps them separated among the various triggers.
Keep in mind there's ways to write these things in fewer triggers, but for the sake of better understanding I kept it pretty extensive.