The second part of the topic is that I want to set up a priority system for these units so that they attack units in a custom "threat" order that I had made. This worked before, but back then I couldn't get them to stop attacking. Now I cannot get them to start
Collapsable Box
Creep Spawn
- Events
- - Game - Map initialization
- - Timer - Every 30.0 seconds of Real Time
- Local Variables
- Conditions
- Actions
- - Unit - Create 6 Creep for player 13 at Point 001 using default facing (No Options)
- - Unit Group - Pick each unit in (Last created units) and do (Actions)
- - - Actions
- - - - Unit - Set (Picked unit) custom value 0 to 2.0
- - Unit - Create 6 Creep for player 14 at Point 007 using default facing (No Options)
- - Unit Group - Pick each unit in (Last created units) and do (Actions)
- - - Actions
- - - - Unit - Set (Picked unit) custom value 0 to 6.0
- - Player - Set player 13 color to (Player 13) Light Green (Change the color of existing units)
- - Player - Set player 14 color to (Player 11) Dark Green (Change the color of existing units)
- - Trigger - Run Creep Orders (Ignore Conditions, Don't Wait until it finishes)
Creep Checkpoints
- Events
- - Unit - Any Unit Enters within 9.5 of Point 002
- - Unit - Any Unit Enters within 9.5 of Point 003
- - Unit - Any Unit Enters within 9.5 of Point 004
- - Unit - Any Unit Enters within 9.5 of Point 005
- - Unit - Any Unit Enters within 9.5 of Point 006
- Local Variables
- - Triggering Units = (Empty unit group) <Unit Group>
- Conditions
- - (Unit type of (Triggering unit)) == Creep
- - Or
- - - Conditions
- - - - (Owner of (Triggering unit)) == 13
- - - - (Owner of (Triggering unit)) == 14
- Actions
- - General - If (Conditions) then do multiple (Actions)
- - - If Then Else
- - - - General - Else if (Conditions) then do (Actions)
- - - - - Else If
- - - - - - (Owner of (Triggering unit)) == 13
- - - - - Then
- - - - - - Unit - Set (Triggering unit) custom value 0 to ((Custom value 0 of (Triggering unit)) + 1.0)
- - - - - - Trigger - Run Creep Orders (Ignore Conditions, Don't Wait until it finishes)
- - - - General - Else if (Conditions) then do (Actions)
- - - - - Else If
- - - - - - (Owner of (Triggering unit)) == 14
- - - - - Then
- - - - - - Unit - Set (Triggering unit) custom value 0 to ((Custom value 0 of (Triggering unit)) - 1.0)
- - - - - - Trigger - Run Creep Orders (Ignore Conditions, Don't Wait until it finishes)
Creep Protect
- Events
- - Unit - Any Unit acquires a target
- Local Variables
- - Collect NPC = (Empty unit group) <Unit Group>
- - Collect NPC 2 = (Empty unit group) <Unit Group>
- Conditions
- - (Unit type of (Acquired Target)) != Creep
- Actions
- - General - If (Conditions) then do multiple (Actions)
- - - If Then Else
- - - - General - Else if (Conditions) then do (Actions)
- - - - - Else If
- - - - - - (Player 13 treats player (Owner of (Acquired Target)) as Ally) == True
- - - - - - (Player 13 treats player (Owner of (Triggering unit)) as Enemy) == True
- - - - - Then
- - - - - - Unit Group - Add all units in (Create a list of all player 13's units of type "Creep" within range 7.0 of the point (Position of (Triggering unit)) up to -1 units) to Collect NPC 2
- - - - - - Unit Group - Add all units in (Create a list of all player 13's units of type "Tower" within range 7.0 of the point (Position of (Triggering unit)) up to -1 units) to Collect NPC 2
- - - - - - Unit Group - Pick each unit in Collect NPC 2 and do (Actions)
- - - - - - - Actions
- - - - - - - - Unit - Set (Picked unit) custom value 0 to ((Custom value 0 of (Picked unit)) + 1000.0)
- - - - - - Unit - Order all units in Collect NPC 2 to ( Attack targeting (Triggering unit)) (Replace Existing Orders)
- - - - - - Timer - Start (New timer) as a One Shot timer that will expire in 5.0 Real Time seconds
- - - - - - General - Wait for (Conditions), checking every 1.0 Real Time seconds
- - - - - - - Conditions
- - - - - - - - Or
- - - - - - - - - Conditions
- - - - - - - - - - (Remaining time of (Last started timer)) == 0.0
- - - - - - - - - - And
- - - - - - - - - - - Conditions
- - - - - - - - - - - - (Distance between (Position of (Triggering unit)) and (Center of Collect NPC 2)) > 10.0
- - - - - - - - - - - - (Remaining time of (Last started timer)) < 3.0
- - - - - - Unit Group - Pick each unit in Collect NPC 2 and do (Actions)
- - - - - - - Actions
- - - - - - - - Unit - Set (Picked unit) custom value 0 to ((Custom value 0 of (Picked unit)) - 1000.0)
- - - - - - Unit Group - Remove all units from Collect NPC 2
- - - - - - Trigger - Run Creep Orders (Ignore Conditions, Don't Wait until it finishes)
- - - - General - Else if (Conditions) then do (Actions)
- - - - - Else If
- - - - - - (Player 14 treats player (Owner of (Acquired Target)) as Ally) == True
- - - - - - (Player 14 treats player (Owner of (Triggering unit)) as Enemy) == True
- - - - - Then
- - - - - - Unit Group - Add all units in (Create a list of all player 14's units of type "Creep" within range 7.0 of the point (Position of (Triggering unit)) up to -1 units) to Collect NPC
- - - - - - Unit Group - Add all units in (Create a list of all player 14's units of type "Tower" within range 7.0 of the point (Position of (Triggering unit)) up to -1 units) to Collect NPC
- - - - - - Unit Group - Pick each unit in Collect NPC and do (Actions)
- - - - - - - Actions
- - - - - - - - Unit - Set (Picked unit) custom value 0 to ((Custom value 0 of (Picked unit)) + 1000.0)
- - - - - - Unit - Order all units in Collect NPC to ( Attack targeting (Triggering unit)) (Replace Existing Orders)
- - - - - - Timer - Start (New timer) as a One Shot timer that will expire in 5.0 Real Time seconds
- - - - - - General - Wait for (Conditions), checking every 1.0 Real Time seconds
- - - - - - - Conditions
- - - - - - - - Or
- - - - - - - - - Conditions
- - - - - - - - - - And
- - - - - - - - - - - Conditions
- - - - - - - - - - - - (Distance between (Position of (Triggering unit)) and (Center of Collect NPC)) > 10.0
- - - - - - - - - - - - (Remaining time of (Last started timer)) < 3.0
- - - - - - - - - - (Remaining time of (Last started timer)) == 0.0
- - - - - - Unit Group - Pick each unit in Collect NPC and do (Actions)
- - - - - - - Actions
- - - - - - - - Unit - Set (Picked unit) custom value 0 to ((Custom value 0 of (Picked unit)) - 1000.0)
- - - - - - Unit Group - Remove all units from Collect NPC
- - - - - - Trigger - Run Creep Orders (Ignore Conditions, Don't Wait until it finishes)
Creep Orders
- Events
- Local Variables
- Conditions
- Actions
- - Unit - Order all units in (Units in (Create a list of all player 13's units of type "Creep" within range 10000.0 of the point Point 004 up to -1 units) with custom value 0 equal to 1.0) to ( Attack targeting relative points near Point 001) (Replace Existing Orders)
- - Unit - Order all units in (Units in (Create a list of all player 13's units of type "Creep" within range -1.0 of the point Point 004 up to -1 units) with custom value 0 equal to 2.0) to ( Attack targeting relative points near Point 002) (Replace Existing Orders)
- - Unit - Order all units in (Units in (Create a list of all player 13's units of type "Creep" within range -1.0 of the point Point 004 up to -1 units) with custom value 0 equal to 3.0) to ( Attack targeting relative points near Point 003) (Replace Existing Orders)
- - Unit - Order all units in (Units in (Create a list of all player 13's units of type "Creep" within range -1.0 of the point Point 004 up to -1 units) with custom value 0 equal to 4.0) to ( Attack targeting relative points near Point 004) (Replace Existing Orders)
- - Unit - Order all units in (Units in (Create a list of all player 13's units of type "Creep" within range -1.0 of the point Point 004 up to -1 units) with custom value 0 equal to 5.0) to ( Attack targeting relative points near Point 005) (Replace Existing Orders)
- - Unit - Order all units in (Units in (Create a list of all player 13's units of type "Creep" within range -1.0 of the point Point 004 up to -1 units) with custom value 0 equal to 6.0) to ( Attack targeting relative points near Point 006) (Replace Existing Orders)
- - Unit - Order all units in (Units in (Create a list of all player 13's units of type "Creep" within range -1.0 of the point Point 004 up to -1 units) with custom value 0 equal to 7.0) to ( Attack targeting relative points near Point 007) (Replace Existing Orders)
- - Unit - Order all units in (Units in (Create a list of all player 14's units of type "Creep" within range -1.0 of the point Point 004 up to -1 units) with custom value 0 equal to 1.0) to ( Attack targeting relative points near Point 001) (Replace Existing Orders)
- - Unit - Order all units in (Units in (Create a list of all player 14's units of type "Creep" within range -1.0 of the point Point 004 up to -1 units) with custom value 0 equal to 2.0) to ( Attack targeting relative points near Point 002) (Replace Existing Orders)
- - Unit - Order all units in (Units in (Create a list of all player 14's units of type "Creep" within range -1.0 of the point Point 004 up to -1 units) with custom value 0 equal to 3.0) to ( Attack targeting relative points near Point 003) (Replace Existing Orders)
- - Unit - Order all units in (Units in (Create a list of all player 14's units of type "Creep" within range -1.0 of the point Point 004 up to -1 units) with custom value 0 equal to 4.0) to ( Attack targeting relative points near Point 004) (Replace Existing Orders)
- - Unit - Order all units in (Units in (Create a list of all player 14's units of type "Creep" within range -1.0 of the point Point 004 up to -1 units) with custom value 0 equal to 5.0) to ( Attack targeting relative points near Point 005) (Replace Existing Orders)
- - Unit - Order all units in (Units in (Create a list of all player 14's units of type "Creep" within range -1.0 of the point Point 004 up to -1 units) with custom value 0 equal to 6.0) to ( Attack targeting relative points near Point 006) (Replace Existing Orders)
- - Unit - Order all units in (Units in (Create a list of all player 14's units of type "Creep" within range -1.0 of the point Point 004 up to -1 units) with custom value 0 equal to 7.0) to ( Attack targeting relative points near Point 007) (Replace Existing Orders)
- Events
- - Game - Map initialization
- - Timer - Every 30.0 seconds of Real Time
- Local Variables
- Conditions
- Actions
- - Unit - Create 6 Creep for player 13 at Point 001 using default facing (No Options)
- - Unit Group - Pick each unit in (Last created units) and do (Actions)
- - - Actions
- - - - Unit - Set (Picked unit) custom value 0 to 2.0
- - Unit - Create 6 Creep for player 14 at Point 007 using default facing (No Options)
- - Unit Group - Pick each unit in (Last created units) and do (Actions)
- - - Actions
- - - - Unit - Set (Picked unit) custom value 0 to 6.0
- - Player - Set player 13 color to (Player 13) Light Green (Change the color of existing units)
- - Player - Set player 14 color to (Player 11) Dark Green (Change the color of existing units)
- - Trigger - Run Creep Orders (Ignore Conditions, Don't Wait until it finishes)
Creep Checkpoints
- Events
- - Unit - Any Unit Enters within 9.5 of Point 002
- - Unit - Any Unit Enters within 9.5 of Point 003
- - Unit - Any Unit Enters within 9.5 of Point 004
- - Unit - Any Unit Enters within 9.5 of Point 005
- - Unit - Any Unit Enters within 9.5 of Point 006
- Local Variables
- - Triggering Units = (Empty unit group) <Unit Group>
- Conditions
- - (Unit type of (Triggering unit)) == Creep
- - Or
- - - Conditions
- - - - (Owner of (Triggering unit)) == 13
- - - - (Owner of (Triggering unit)) == 14
- Actions
- - General - If (Conditions) then do multiple (Actions)
- - - If Then Else
- - - - General - Else if (Conditions) then do (Actions)
- - - - - Else If
- - - - - - (Owner of (Triggering unit)) == 13
- - - - - Then
- - - - - - Unit - Set (Triggering unit) custom value 0 to ((Custom value 0 of (Triggering unit)) + 1.0)
- - - - - - Trigger - Run Creep Orders (Ignore Conditions, Don't Wait until it finishes)
- - - - General - Else if (Conditions) then do (Actions)
- - - - - Else If
- - - - - - (Owner of (Triggering unit)) == 14
- - - - - Then
- - - - - - Unit - Set (Triggering unit) custom value 0 to ((Custom value 0 of (Triggering unit)) - 1.0)
- - - - - - Trigger - Run Creep Orders (Ignore Conditions, Don't Wait until it finishes)
Creep Protect
- Events
- - Unit - Any Unit acquires a target
- Local Variables
- - Collect NPC = (Empty unit group) <Unit Group>
- - Collect NPC 2 = (Empty unit group) <Unit Group>
- Conditions
- - (Unit type of (Acquired Target)) != Creep
- Actions
- - General - If (Conditions) then do multiple (Actions)
- - - If Then Else
- - - - General - Else if (Conditions) then do (Actions)
- - - - - Else If
- - - - - - (Player 13 treats player (Owner of (Acquired Target)) as Ally) == True
- - - - - - (Player 13 treats player (Owner of (Triggering unit)) as Enemy) == True
- - - - - Then
- - - - - - Unit Group - Add all units in (Create a list of all player 13's units of type "Creep" within range 7.0 of the point (Position of (Triggering unit)) up to -1 units) to Collect NPC 2
- - - - - - Unit Group - Add all units in (Create a list of all player 13's units of type "Tower" within range 7.0 of the point (Position of (Triggering unit)) up to -1 units) to Collect NPC 2
- - - - - - Unit Group - Pick each unit in Collect NPC 2 and do (Actions)
- - - - - - - Actions
- - - - - - - - Unit - Set (Picked unit) custom value 0 to ((Custom value 0 of (Picked unit)) + 1000.0)
- - - - - - Unit - Order all units in Collect NPC 2 to ( Attack targeting (Triggering unit)) (Replace Existing Orders)
- - - - - - Timer - Start (New timer) as a One Shot timer that will expire in 5.0 Real Time seconds
- - - - - - General - Wait for (Conditions), checking every 1.0 Real Time seconds
- - - - - - - Conditions
- - - - - - - - Or
- - - - - - - - - Conditions
- - - - - - - - - - (Remaining time of (Last started timer)) == 0.0
- - - - - - - - - - And
- - - - - - - - - - - Conditions
- - - - - - - - - - - - (Distance between (Position of (Triggering unit)) and (Center of Collect NPC 2)) > 10.0
- - - - - - - - - - - - (Remaining time of (Last started timer)) < 3.0
- - - - - - Unit Group - Pick each unit in Collect NPC 2 and do (Actions)
- - - - - - - Actions
- - - - - - - - Unit - Set (Picked unit) custom value 0 to ((Custom value 0 of (Picked unit)) - 1000.0)
- - - - - - Unit Group - Remove all units from Collect NPC 2
- - - - - - Trigger - Run Creep Orders (Ignore Conditions, Don't Wait until it finishes)
- - - - General - Else if (Conditions) then do (Actions)
- - - - - Else If
- - - - - - (Player 14 treats player (Owner of (Acquired Target)) as Ally) == True
- - - - - - (Player 14 treats player (Owner of (Triggering unit)) as Enemy) == True
- - - - - Then
- - - - - - Unit Group - Add all units in (Create a list of all player 14's units of type "Creep" within range 7.0 of the point (Position of (Triggering unit)) up to -1 units) to Collect NPC
- - - - - - Unit Group - Add all units in (Create a list of all player 14's units of type "Tower" within range 7.0 of the point (Position of (Triggering unit)) up to -1 units) to Collect NPC
- - - - - - Unit Group - Pick each unit in Collect NPC and do (Actions)
- - - - - - - Actions
- - - - - - - - Unit - Set (Picked unit) custom value 0 to ((Custom value 0 of (Picked unit)) + 1000.0)
- - - - - - Unit - Order all units in Collect NPC to ( Attack targeting (Triggering unit)) (Replace Existing Orders)
- - - - - - Timer - Start (New timer) as a One Shot timer that will expire in 5.0 Real Time seconds
- - - - - - General - Wait for (Conditions), checking every 1.0 Real Time seconds
- - - - - - - Conditions
- - - - - - - - Or
- - - - - - - - - Conditions
- - - - - - - - - - And
- - - - - - - - - - - Conditions
- - - - - - - - - - - - (Distance between (Position of (Triggering unit)) and (Center of Collect NPC)) > 10.0
- - - - - - - - - - - - (Remaining time of (Last started timer)) < 3.0
- - - - - - - - - - (Remaining time of (Last started timer)) == 0.0
- - - - - - Unit Group - Pick each unit in Collect NPC and do (Actions)
- - - - - - - Actions
- - - - - - - - Unit - Set (Picked unit) custom value 0 to ((Custom value 0 of (Picked unit)) - 1000.0)
- - - - - - Unit Group - Remove all units from Collect NPC
- - - - - - Trigger - Run Creep Orders (Ignore Conditions, Don't Wait until it finishes)
Creep Orders
- Events
- Local Variables
- Conditions
- Actions
- - Unit - Order all units in (Units in (Create a list of all player 13's units of type "Creep" within range 10000.0 of the point Point 004 up to -1 units) with custom value 0 equal to 1.0) to ( Attack targeting relative points near Point 001) (Replace Existing Orders)
- - Unit - Order all units in (Units in (Create a list of all player 13's units of type "Creep" within range -1.0 of the point Point 004 up to -1 units) with custom value 0 equal to 2.0) to ( Attack targeting relative points near Point 002) (Replace Existing Orders)
- - Unit - Order all units in (Units in (Create a list of all player 13's units of type "Creep" within range -1.0 of the point Point 004 up to -1 units) with custom value 0 equal to 3.0) to ( Attack targeting relative points near Point 003) (Replace Existing Orders)
- - Unit - Order all units in (Units in (Create a list of all player 13's units of type "Creep" within range -1.0 of the point Point 004 up to -1 units) with custom value 0 equal to 4.0) to ( Attack targeting relative points near Point 004) (Replace Existing Orders)
- - Unit - Order all units in (Units in (Create a list of all player 13's units of type "Creep" within range -1.0 of the point Point 004 up to -1 units) with custom value 0 equal to 5.0) to ( Attack targeting relative points near Point 005) (Replace Existing Orders)
- - Unit - Order all units in (Units in (Create a list of all player 13's units of type "Creep" within range -1.0 of the point Point 004 up to -1 units) with custom value 0 equal to 6.0) to ( Attack targeting relative points near Point 006) (Replace Existing Orders)
- - Unit - Order all units in (Units in (Create a list of all player 13's units of type "Creep" within range -1.0 of the point Point 004 up to -1 units) with custom value 0 equal to 7.0) to ( Attack targeting relative points near Point 007) (Replace Existing Orders)
- - Unit - Order all units in (Units in (Create a list of all player 14's units of type "Creep" within range -1.0 of the point Point 004 up to -1 units) with custom value 0 equal to 1.0) to ( Attack targeting relative points near Point 001) (Replace Existing Orders)
- - Unit - Order all units in (Units in (Create a list of all player 14's units of type "Creep" within range -1.0 of the point Point 004 up to -1 units) with custom value 0 equal to 2.0) to ( Attack targeting relative points near Point 002) (Replace Existing Orders)
- - Unit - Order all units in (Units in (Create a list of all player 14's units of type "Creep" within range -1.0 of the point Point 004 up to -1 units) with custom value 0 equal to 3.0) to ( Attack targeting relative points near Point 003) (Replace Existing Orders)
- - Unit - Order all units in (Units in (Create a list of all player 14's units of type "Creep" within range -1.0 of the point Point 004 up to -1 units) with custom value 0 equal to 4.0) to ( Attack targeting relative points near Point 004) (Replace Existing Orders)
- - Unit - Order all units in (Units in (Create a list of all player 14's units of type "Creep" within range -1.0 of the point Point 004 up to -1 units) with custom value 0 equal to 5.0) to ( Attack targeting relative points near Point 005) (Replace Existing Orders)
- - Unit - Order all units in (Units in (Create a list of all player 14's units of type "Creep" within range -1.0 of the point Point 004 up to -1 units) with custom value 0 equal to 6.0) to ( Attack targeting relative points near Point 006) (Replace Existing Orders)
- - Unit - Order all units in (Units in (Create a list of all player 14's units of type "Creep" within range -1.0 of the point Point 004 up to -1 units) with custom value 0 equal to 7.0) to ( Attack targeting relative points near Point 007) (Replace Existing Orders)
As you can see, it is a freaking mess and very inefficient. What I am asking is how do I make all of these into arrays so I can do:
When triggering unit==creep, owned by P13 or P14, enters point X(his custom value): Owner==13, then X+1, else Owner==14, then X-1, finally ordering that triggering unit to point X (the new custom value).
The other part is that when the triggering unit is either a certain distance away or the duration ends, they leave him alone again and go back to attacking the point they were told to.
Post has been edited 1 time(s), last time on Dec 28 2012, 9:12 pm by LoveLess.
None.