HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Ordered unit return to original location

11-19-2005, 02:30 PM#1
Father_Chaos
I have a trigger that spawns zombies each 30sec and orders them to attack at a random location on the map borders. Here's my trigger:
Code:
Spawn
    Events
        Time - Every 30.00 seconds of game time
    Conditions
    Actions
        Special Effect - Create a special effect at (Center of Spawn <gen>) using AbilitiesSpellsUndeadRaiseSkeletonWarriorRaiseSkeleton.mdl
        Unit - Create 1 Zombie for Neutral Hostile at (Center of Spawn <gen>) facing (Random angle) degrees
        Wait 0.50 game-time seconds
        Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) and do (Unit - Order (Picked unit) to Attack-Move To ((Center of (Playable map area)) offset by 10000.00 towards (Random angle) degrees))
However, when the zombies reach the border they stop and return to the "Spawn" region until the next spawn and order. How can I make them stay there? I also tried with a computer-controller player instead of neutral hostile, but it still won't work .
11-19-2005, 03:11 PM#2
Vexorian
change the gameplay constants "Creep - Guard Return Distance" and "Creep - Guard Return Time" to very big values
11-19-2005, 03:20 PM#3
Father_Chaos
Thanks!

Another question : Is it possible to make an event to fire when a zombie stops (has no more orders)? That way I would change "Unit Group - Pick every unit in region" action to only work with "Last created unit" and when a zombie would reach his destination he would immediately go to another one.
11-19-2005, 03:44 PM#4
tassadar920
There may be a way to catch units that are "idle" but I've never tried... it would probably be a boolean condition.
11-19-2005, 04:35 PM#5
Father_Chaos
Here's what I tried:
Code:
Idle Zombies Check
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) and do (If (((Picked unit) is paused) Equal to True) then do (Unit - Order (Picked unit) to Attack-Move To ((Center of (Playable map area)) offset by 10000.00 towards (Random angle) degrees)) else do (Do nothing))
But it didn't work ...
11-19-2005, 06:40 PM#6
Vexorian
For the record that trigger will cause a huge increment in memory usage over time and eventually lag. It will lag instantly if there are a lot of units.

And "Unit is paused" how is that related to unit is idle? Paused is a state you set with triggers.

To know if a unit is idle just check its current order id, if it is 0 , OrderId("stop") or some other order you would consider idle then it is an idle unit
11-19-2005, 08:31 PM#7
Father_Chaos
Could you make an example with OrderId? I do not understand how it works...