| 03-30-2003, 02:49 PM | #1 |
First we're going to need at least two players in force 1. Make sure you set them to be allied. Now go the Trigger Editor, click edit on the menu and select variables. Create this variable: forceonesbuildings Type: Integer Initial Value = Number of buildings all of force one has at start. Now we need to make a trigger like this for every player in force 1, this will keep track of the amount of buildings when a player in force 1 constructs a building. Event: Unit - A unit owned by (player you're making the trig for) Finishes construction Condition: Action: Set forceonebuildings = (forceonebuildings + 1) Next up make a trigger like this for every player in force 1, this will keep track of the amount of buildings when a player in force 1 loses a building. Event: Unit - A unit owned by (player you're making the trig for) Dies Condition: Boolean Comparison - ((triggering unit) is A structure) Equal to True Action: Set forceonebuildings = (forceonebuildings - 1) Trigger - Run forceonedefeat <gen> (ignoring conditions) NOTE: We'll make this trig (forceonedefeat) in a minute. Finally create this trigger. forceonedefeat Event: Condition: Action: If (forceonebuildings Equal to 0) then do (Game - Defeat Player one (Red) with the message: Defeat!) else do (Do nothing) NOTE: you can duplicate the if statement and make one for each player if this is a Multiplayer map. An example map is attached, use these cheats: GreedIsGood(9999) - Get some money. WarpTen - For faster building. Build as many buildings as you want. Player 1 & 2 are under your control, and then use the Archimondes to destroy them all, and you will see that it works. Hope this helps, happy mapping! |
| 03-30-2003, 02:54 PM | #2 |
Guest | Wouldn't unit finished construction fire for all units being produced, not only buildings? |
| 03-30-2003, 06:06 PM | #3 |
Guest | Aye, it would. You need a bootlean in there dude. |
| 03-31-2003, 02:33 PM | #4 |
No, actually it wouldn't. There are 6 different trigger conditions. Begins Training a unit Cancels Training a unit Finishes Training a unit Begins construction Cancels construction Finishes construction So a boolean is not needed. |
| 04-01-2003, 02:46 AM | #5 |
Guest | You're be right, I just made a test map, and that's how it works. I could have sworn I used a unit finishes construction for a goblin zeppelin in one map. |
