This is the trig to see if the hinge is destroyed (the hinge is a shield battery in this case) (oh, and if the switch is set, the gate is down):
Trigger("Player 1"){
Conditions:
Bring("Player 1", "Any unit", "watchtower", At least, 1);
Bring("Player 12", "Protoss Shield Battery", "watchtower", At least, 1);
Bring("Player 1", "Protoss Beacon", "watchtowerbeacon", At least, 1);
Switch("watchtower", not set);
Actions:
Set Switch("watchtower", set);
Preserve Trigger();
}
Now, each gate corresponds to a territory, being a beacon. Ownership of the gate is determined by ownership of the beacon. If the beacons neutral, anyone can open the gate. (these two trigs run for all players, and Force 1 is the force that includes all of the Human Players).
Trigger("All players"){
Conditions:
Bring("Current Player", "Any unit", "watchtower", At least, 1);
Bring("Player 12", "Protoss Shield Battery", "watchtower", At least, 1);
Bring("Player 12", "Protoss Beacon", "watchtowerbeacon", At least, 1);
Switch("watchtower", not set);
Actions:
Preserve Trigger();
Set Switch("watchtower", set);
}
//-----------------------------------------------------------------//
Trigger("All players"){
Conditions:
Bring("Force 1", "Any unit", "watchtower", Exactly, 0);
Bring("Player 12", "Protoss Shield Battery", "watchtower", At least, 1);
Bring("Player 12", "Protoss Beacon", "watchtowerbeacon", At least, 1);
Switch("watchtower", set);
Actions:
Set Switch("watchtower", clear);
Preserve Trigger();
}
Now, if a player owns the beacon, I want only them to be able to open it.
Trigger("Player 1"){
Conditions:
Bring("Player 1", "Any unit", "watchtower", At least, 1);
Bring("Player 12", "Protoss Shield Battery", "watchtower", At least, 1);
Bring("Player 1", "Protoss Beacon", "watchtowerbeacon", At least, 1);
Switch("watchtower", clear);
Actions:
Set Switch("watchtower", set);
Preserve Trigger();
}
Trigger("Player 1"){
Conditions:
Bring("Player 1", "Any unit", "watchtower", Exactly, 0);
Bring("Player 12", "Protoss Shield Battery", "watchtower", At least, 1);
Bring("Player 1", "Protoss Beacon", "watchtowerbeacon", At least, 1);
Switch("watchtower", set);
Actions:
Set Switch("watchtower", clear);
Preserve Trigger();
}
These are the two triggers, given to a relatively unused Computer player (though he does have hyper trigs, will that effect it?) which control the actual motion of the gates depending on the switch setting.
Trigger("Player 5"){
Conditions:
Switch("watchtower", set);
Bring("Player 12", "Left Pit Door", "watchtower", At least, 1);
Actions:
Set Doodad State("Player 12", "Left Pit Door", "watchtower", disabled);
Give Units to Player("Player 12", "Player 11", "Left Pit Door", 1, "watchtower");
Preserve Trigger();
}
//-----------------------------------------------------------------//
Trigger("Player 5"){
Conditions:
Switch("watchtower", not set);
Bring("Player 11", "Left Pit Door", "watchtower", At least, 1);
Actions:
Set Doodad State("Player 11", "Left Pit Door", "watchtower", enabled);
Give Units to Player("Player 11", "Player 12", "Left Pit Door", 1, "watchtower");
Preserve Trigger();
}
Any input?
None.