Description:
Any time I use the listed code below, the most recently created unit in a unit group (such as Lairs) that the code applies to spawns a unit that just stands there.
Desire result:
All units that are spawned would follow orders.
Example
1 lair. every 15 seconds it spawns an infestor that just stand there.
2 lairs. each spawn an infestor, but the most recently placed lair on the map spawns an infestor that just stand there.
Notes:
Location of the pointer does not seem effect unit movement behavior. I can place it right next to the building and the unit still won't move.
Unit spawned does not seem effect unit movement behavior.
Spawn point does not seem effect unit movement behavior.
Triggers
Infestor Spawn
Infestor Spawn
Events
Timer - Every 15.0 seconds of Game Time
Local Variables
Conditions
Actions
Unit Group - Pick each unit in (Lair units in (Entire map) owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Unit - Order (Last created unit) to ( Move targeting Point 002) (Replace Existing Orders)
Unit - Create 1 Infestor (Spellcaster) for player (Owner of (Picked unit)) at (Position of (Picked unit)) using default facing (No Options)
Move the Order action below the Create action. The variable "Last created unit" is set to the last created unit BEFORE you have the action. And you create the unit afterwards, so it just misses it.
Description: Any time I use the listed code below, the most recently created unit in a unit group (such as Lairs) that the code applies to spawns a unit that just stands there.
Desire result: All units that are spawned would follow orders.
Example 1 lair. every 15 seconds it spawns an infestor that just stand there.
2 lairs. each spawn an infestor, but the most recently placed lair on the map spawns an infestor that just stand there.
Notes:
Location of the pointer does not seem effect unit movement behavior. I can place it right next to the building and the unit still won't move.
Unit spawned does not seem effect unit movement behavior.
Spawn point does not seem effect unit movement behavior.
Triggers
Infestor Spawn
Infestor Spawn
Events
Timer - Every 15.0 seconds of Game Time
Local Variables
Conditions
Actions
Unit Group - Pick each unit in (Lair units in (Entire map) owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Unit - Order (Last created unit) to ( Move targeting Point 002) (Replace Existing Orders)
Unit - Create 1 Infestor (Spellcaster) for player (Owner of (Picked unit)) at (Position of (Picked unit)) using default facing (No Options)
@deathdealingjawa: Go
Move the Order action below the Create action. The variable "Last created unit" is set to the last created unit BEFORE you have the action. And you create the unit afterwards, so it just misses it.
@Krakarn: Go
You are a gentleman and a scholar, that is to say thank you for helping with this issue.