Creep Respawn trigger (weird behaviour)

Baterasis

New Member
Reaction score
4
My map contains a Creep respawn function that only seems to work when the Wait action is less than or equal to 80 seconds.

Trigger:
  • CreepSet
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) and do (Actions)
        • Loop - Actions
          • Set unitStartPosCount = (unitStartPosCount + 1)
          • Set unitStartPosArray[unitStartPosCount] = (Position of (Picked unit))
          • Unit - Set the custom value of (Picked unit) to unitStartPosCount


Trigger:
  • CreepDies
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
    • Actions
      • Custom script: local unit udg_tempUnit
      • Set tempUnit = (Triggering unit)
      • Wait 80.00 game-time seconds
      • Special Effect - Create a special effect at unitStartPosArray[(Custom value of tempUnit)] using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
      • Trigger - Run CleanEffects <gen> (ignoring conditions)
      • Unit - Create 1 (Unit-type of tempUnit) for Neutral Hostile at unitStartPosArray[(Custom value of tempUnit)] facing (Random angle) degrees
      • Unit - Set the custom value of (Last created unit) to (Custom value of tempUnit)
      • Set unitStartPosArray[(Custom value of (Last created unit))] = (Position of (Last created unit))


If I set the Wait line to 90 seconds or more, the Creeps won't respawn. Any ideas?
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
This can easily be explained.
When a unit dies it leaves a corpse.
As long as the corpse is on the field you can still refer to the unit.
But the wc3 engine is scripted in a way that it clears its memory; once the corpse is gone the unit is removed.
When the unit is removed you can not refer to the unit anymore in triggers.

In the gameplay constants you can change the time it takes for the corpse to vanish. By default it is set to 80 seconds.
 

Baterasis

New Member
Reaction score
4
This can easily be explained.
When a unit dies it leaves a corpse.
As long as the corpse is on the field you can still refer to the unit.
But the wc3 engine is scripted in a way that it clears its memory; once the corpse is gone the unit is removed.
When the unit is removed you can not refer to the unit anymore in triggers.

In the gameplay constants you can change the time it takes for the corpse to vanish. By default it is set to 80 seconds.

Setting the Decay Time (sec) Bones to a higher value in the Gameplay Constants menu made it work. Thanks for your help!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top