Whats wrong with this trigger

Status
Not open for further replies.
Level 6
Joined
Sep 26, 2007
Messages
114
Hi:thumbs_up:

Can some one tell me whats wrong this this trigger:con:

Ok this is what happen the units spwn but they dont attack move or move at all to where i want them :(:cry:
  • Human Spwn
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Change color of (Triggering unit) to Black
      • Set Temp_Point[0] = (Center of HumanSpwn <gen>)
      • Unit - Create 3 Bandit for Player 11 (Dark Green) at Temp_Point[0] facing Default building facing degrees
      • Unit - Create 3 Brigand for Player 11 (Dark Green) at Temp_Point[0] facing Default building facing degrees
      • Unit - Create 3 Enforcer for Player 11 (Dark Green) at Temp_Point[0] facing Default building facing degrees
      • Unit - Create 2 Assassin for Player 11 (Dark Green) at Temp_Point[0] facing Default building facing degrees
      • Unit - Create 1 Bandit Lord for Player 11 (Dark Green) at Temp_Point[0] facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_Temp_Point[0])
      • Set Temp_Point[1] = (Position of Defend the Warlord 0034 <gen>)
      • If (((Triggering unit) is A peon-type unit) Equal to False) then do (Unit - Order (Triggering unit) to Attack-Move To Temp_Point[1]) else do (Do nothing)
      • Custom script: call RemoveLocation(udg_Temp_Point[1])
  • Orc Spwn
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Change color of (Triggering unit) to Black
      • Set Temp_Point[0] = (Center of OrcSpwn <gen>)
      • Unit - Create 3 Bandit for Player 12 (Brown) at Temp_Point[0] facing Default building facing degrees
      • Unit - Create 3 Brigand for Player 12 (Brown) at Temp_Point[0] facing Default building facing degrees
      • Unit - Create 3 Enforcer for Player 12 (Brown) at Temp_Point[0] facing Default building facing degrees
      • Unit - Create 2 Assassin for Player 12 (Brown) at Temp_Point[0] facing Default building facing degrees
      • Unit - Create 1 Bandit Lord for Player 12 (Brown) at Temp_Point[0] facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_Temp_Point[0])
      • Set Temp_Point[1] = (Position of Defend the King 0021 <gen>)
      • If (((Triggering unit) is A peon-type unit) Equal to False) then do (Unit - Order (Triggering unit) to Attack-Move To Temp_Point[1]) else do (Do nothing)
      • Custom script: call RemoveLocation(udg_Temp_Point[1])
 
Last edited:
If (((Triggering unit) is A peon-type unit) Equal to False) then do (Unit - Order (Triggering unit) to Attack-Move To Temp_Point[1]) else do (Do nothing)

This is the problem. If triggering unit? Wtf?
Use If last created unit. But I think this still leaks, because will only order the last unit created, try doing a variable to store all the units you created and them check if they are peon.
 
There is no triggering unit thats why they didnt do anything, put the order after everytime a unit is created and refer to those as "Last created unit"
 
Triggering unit is used for event responses and your event is time so its obvious that triggering unit will never work for time.

  • Events
    • Time - Every 30.00 seconds of game time
  • Conditions
  • Actions
    • Unit - Change color of (Triggering unit) to Black
    • Set Temp_Point[0] = (Center of HumanSpwn <gen>)
    • Unit - Create 3 Bandit for Player 11 (Dark Green) at Temp_Point[0] facing Default building facing degrees
    • Unit - Order Last created unit to move to REGION
    • Unit - Create 3 Brigand for Player 11 (Dark Green) at Temp_Point[0] facing Default building facing degrees
    • Unit - Order Last created unit to move to REGION
  • Unit - Create 3 Enforcer for Player 11 (Dark Green) at Temp_Point[0] facing Default building facing degrees
    • Unit - Order Last created unit to move to REGION
  • Unit - Create 2 Assassin for Player 11 (Dark Green) at Temp_Point[0] facing Default building facing degrees
    • Unit - Order Last created unit to move to REGION
  • Unit - Create 1 Bandit Lord for Player 11 (Dark Green) at Temp_Point[0] facing Default building facing degrees
    • Unit - Order Last created unit to move to REGION
  • Custom script: call RemoveLocation(udg_Temp_Point[0])
  • Set Temp_Point[1] = (Position of Defend the Warlord 0034 <gen>)
  • If (((Triggering unit) is A peon-type unit) Equal to False) then do (Unit - Order (Triggering unit) to Attack-Move To Temp_Point[1]) else do (Do nothing)
  • Custom script: call RemoveLocation(udg_Temp_Point[1])
DO NOT use Custom script: call RemoveLocation on the region/point where you want the unit to move.
 
Status
Not open for further replies.
Back
Top