AI Triggers Problem

Kelv

TH.net Regular
Reaction score
7
Figured out the problem. Here is the final trigger if anyone is interested. It works fairly well. I haven't done any leak removal.

Code:
Eagle Choice
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Distance between (Position of Eagle 0001 <gen>) and (Position of Tent 2 0000 <gen>)) Less than 4000.00
            Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Unit-type of Eagle_Target) Equal to Eagle
                        (Eagle_Target is alive) Equal to True
                        (Number of units in (Units within 6000.00 of (Position of Eagle 0001 <gen>) matching (((Matching unit) belongs to an ally of Player 12 (Brown)) Equal to True))) Greater than 0
                    Then - Actions
                        Game - Display to (All players) the text: Eagle Target Select...
                        Set Eagle_Target = (Random unit from (Units within 6000.00 of (Position of Eagle 0001 <gen>) matching ((((Matching unit) belongs to an ally of Player 12 (Brown)) Equal to True) and (((Matching unit) is alive) Equal to True))))
                        Unit - Order Eagle 0001 <gen> to Move To (Position of Eagle_Target)
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Distance between (Position of Eagle 0001 <gen>) and (Position of Eagle_Target)) Less than 500.00
                                (Unit-type of Eagle_Target) Not equal to Eagle
                            Then - Actions
                                Trigger - Turn off (This trigger)
                                Unit - Order Eagle 0001 <gen> to Move To (Position of Eagle_Target)
                                Animation - Change Eagle 0001 <gen> flying height to 50.00 at 300.00
                                Wait 1.00 seconds
                                Unit - Move Eagle 0001 <gen> instantly to (Position of Eagle_Target)
                                Unit - Cause Eagle 0001 <gen> to damage Eagle_Target, dealing 500.00 damage of attack type Spells and damage type Normal
                                Animation - Play Eagle 0001 <gen>'s attack animation
                                Wait 0.50 seconds
                                Animation - Reset Eagle 0001 <gen>'s animation
                                Animation - Change Eagle 0001 <gen> flying height to 240.00 at 200.00
                                Set Eagle_Target = Eagle 0001 <gen>
                                Trigger - Turn on (This trigger)
                            Else - Actions
            Else - Actions
                Set Eagle_Target = Tent 2 0000 <gen>
                Unit - Order Eagle 0001 <gen> to Move To (Position of Eagle_Target)
                Set Eagle_Target = Eagle 0001 <gen>
 

Attachments

  • Eagle.w3x
    23.7 KB · Views: 88
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top