• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Simple Trigger Problem

Status
Not open for further replies.
Level 6
Joined
May 8, 2010
Messages
150
Okay, basically i have a spawn trigger which creates a unit at a point when another unit dies.
When the unit spawns.. it is ment to go towards a point.
But my trigger doesnt work.. and i cant see why it shouldnt.


[trigger=Spawn Wolf]
Events
Unit - A unit Dies
Conditions
(Unit-type of (Triggering unit)) Equal to Timber Wolf
Actions
Unit - Create 1 Timber Wolf for Player 12 (Brown) at (Center of WolfRegions[(Random integer number between 1 and 3)]) facing (Player 1 (Red) start location)
Unit - Change color of (Last created unit) to Black
Unit Group - Add (Last created unit) to Wolf
[/trigger]


[trigger=Wolf Group]
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in (Units owned by Player 12 (Brown) of type Footman) and do (Unit - Order (Picked unit) to Attack Ground (Random point in Wolf Region <gen>))
Wait 6.00 seconds
Unit - Change ownership of (Picked unit) to Neutral Hostile and Change color
Unit Group - Remove (Picked unit) from Wolf
Custom script: call DestroyGroup(udg_Wolf)
[/trigger]
 
Level 4
Joined
Apr 20, 2009
Messages
106
I believe it has something to do with your Wolf Group trigger. Look at your first action.

  • Pick every unit in (Units owned by Player 12 (Brown) of type Footman)
As far as I can see, shouldn't that be picking every unit in unit group Wolf or every unit of type Timber Wolf?
 
Level 4
Joined
Jun 22, 2009
Messages
63
I think it's the interval between the new actions. Maybe they don't have enough time to move to the location before they are supposed to move to a new one etc etc. I think you should try increasing the interval.

*Edit* I don't know if you can use a 6 second wait in a 1 second trigger, but im not sure.
 
Level 8
Joined
Jun 26, 2010
Messages
530
Unit Group - Pick every unit in Wolf and do (Unit - Order (Picked unit) to Attack Ground (Random point in Wolf Region <gen>))


still doesnt work :|

What exactly is not working? The actions after the wait?

  • Unit - Change ownership of (Picked unit) to Neutral Hostile and Change color
  • Unit Group - Remove (Picked unit) from Wolf
  • Custom script: call DestroyGroup(udg_Wolf)
or the Unit order?

  • Unit Group - Pick every unit in Wolf and do (Unit - Order (Picked unit) to Attack Ground (Random point in Wolf Region <gen>))
Your trigger is a periodically event, so it will run like 6 times before the first one finishes. Try in the beggining of the trigger using a local variable and set it = Wolf (global) and uses the local variable in the rest of the trigger. Maybe it will work.

[trigger=Wolf Group]
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
local group locwolves
set wolves = Wolf
Unit Group - Pick every unit in locwolves and do (Unit - Order (Picked unit) to Attack Ground (Random point in Wolf Region <gen>))
Wait 6.00 seconds
Unit - Change ownership of (Picked unit) to Neutral Hostile and Change color
Unit Group - Remove (Picked unit) from Wolf
Custom script: call DestroyGroup(udg_Wolf)
[/trigger]

Edit: That might sound stupid, but i had an idea. Try just moving the "Remove unit" so it happens before the wait

[trigger=Wolf Group]
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in Wolf and do (Unit - Order (Picked unit) to Attack Ground (Random point in Wolf Region <gen>))
Unit Group - Remove (Picked unit) from Wolf
Wait 6.00 seconds
Unit - Change ownership of (Picked unit) to Neutral Hostile and Change color
Custom script: call DestroyGroup(udg_Wolf)
[/trigger]
 
Status
Not open for further replies.
Top