Attack Orders help please D:

Bongo

New Member
Reaction score
0
Im probably over complicating the trigger needs, but I need an amount of units created after the map initializes to constantly seek out and attempt to destroy a specific unit, There are multiple units that need to have these pursuers, and a mass of attackers that are to divy up and pursue. Here is what Ive got on there.

Spawn C's
Events
-Game - Map initialization
-Timer - Every 22.0 seconds of Game Time
Local Variables
Conditions
Actions
-Region - Attach C 1 to (last created unit) with offset 0000
(goes down to 12)
-Unit - Order (Unit attached to C 1) to (attack targeting (Unit attached to M 1))(Replace Existing Orders)
(Also goes down to 12)

Another Trigger linked to related to this one ---->

Map Start
Events
-Map Initialization
local
cond
Actions
-Unit Create 1 M for player 1 at Player 1 M Spawn
-Region - Attach M 1 to (last created unit)
(continues for 5 more players)


The "C" units are not created until 22 game seconds have passed, and are created one at a time with no wait triggers between. Every time i test the map the units do not pursue my "M" units, and yes i have a trigger starting computer AI, its the Start Melee AI
 

Blackveiled

Formerly, Ban-Lord
Reaction score
157
If there's more than one unit you will need to use a unit group, which could be why it's not working.
 

Bongo

New Member
Reaction score
0
So the attaching regions to their respective units should be working properly?
 

Dave312

Censored for your safe viewing
Reaction score
269
I'm unsure why you are attaching regions to units. You are better off using Unit Group variables to store the pursuing units and use a periodic event to pick every unit in the unit group, and order them to attack towards the position of your M units. Add 2 Global variables: 1 named M of the type Unit; and the other named CUnits of type Unit Group. Then use these two triggers (only minor changes to your current ones):

Trigger:
  • Spawn C
    • Events
      • Timer - Every 22.0 seconds of Game Time
    • Local Variables
    • Conditions
    • Actions
      • Unit Group - Pick each unit in CUnits and do (Actions)
        • Actions
          • Unit - Order (Picked unit) to ( Attack targeting (Position of M)) (Replace Existing Orders)

Trigger:
  • Map Start
    • Events
      • Game - Map initialization
    • Local Variables
    • Conditions
    • Actions
      • Unit - Create 1 M for player 1 at Player 1 M Spawn using default facing (No Options)
      • Variable - Set M = (Last Created Unit)
      • ... Continue above 2 lines for each player
      • Trigger - Run Spawn C


You will also need to add the pursuing units to the CUnit variable at Map Initialization.
 

Bongo

New Member
Reaction score
0
sorry it was the only way i found to get a unit to do anything at all x.x i dont quite understand the editor yet. and about the variables, how do you add global variables? X.X thanks for the help, youve made it so much simpler and explained alot to me already with just that :)
 

Monsterous

In the Shadows, Lurking.
Reaction score
99
Make sure the Variable isnt inside the trigger, but outside it, to make it Global :p
 

Bongo

New Member
Reaction score
0
You guys were a HUGE help :D you dont even know. Most credit does go to Dave, but if it wasnt for the last 2 posts i wouldntve figured out the global variable thing lol
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top