Here's a trigger I wrote that queries the knowledge base to find any Military Unit (Type 639) for a player that is repairing (Action 13) and converts them to Gaia. This trigger takes two parameters, Player # & the STRING NAME of an existing Army. Due to variable declarations & the way I have it set up, you can only use this effect once per trigger - this could be coded around. Also, never use the < Line 007 - Save whatever player context the game is set at. That's the short of it. Now go create some awesome triggers. See it work (play as player 1): To test it out: Note: Using an army in this trigger is not necessary, but I did to show that you could. [This message has been edited by TwentyOneScore (edited 03-13-2003 @ 10:53 AM).]
001 <
002 <
003 <
004 <
005 <
006 <
007 <
008 <
009 <
010 <
011 <
012 <
013 <
014 <
015 <
016 <
017 <
018 <
019 <
020 <
021 <
022 <
023 <
024 <
025 <
026 <
027 <
028 <
029 <
030 <
031 <
032 <
033 <
034 <
035 <
Line 008 - Check player is active.
Line 009 - Switches context to the player in question so KB queries correctly.
Line 010 & 011 - Select & clear the army.
Line 012 & 013 - Create new KB query & Check if sucessful
Line 014-017 - Add query parameters for Player, Unit Type, State, Action.
Line 018-020 - Execute the query & check for results.
Line 022-026 - Loop over results & add to army
Line 027-028 - Select & Convert Army.
Line 032 - Return Context back to whatever the game was using when we took over.
Download & put this file in the aom/trigger directory
Create a 2 player scenario & add a TC for each. Put a Portable Ram for Player 2 next to player 1's TC.
Create an army for player one.
Add a 10 sec timed trigger with the effect ConvertBuildersToGaia for player 1 with the name of the army created.
Play scenario & try to repair the TC as the ram beats on it.
"Just invite him over for dinner. Turn him from an enemy into a friend. Then when he's least expecting, BAM! The old fork in the eye!" - M.S.
--
Member °ƒ Tsunami Studios <<< Play TOS Maps - 9 Maps - Avg Rating: 4.67! >>>