Creep Revival System Help

Lionhearte

New Member
Reaction score
0
I posted this in the original topic but was asked to put it in here and upload the trigger, so here it is.
Here is the first one, the initialization:

Code:
Creep Revival System Initialization
    Events
        Map initialization
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                Set Integer = (Integer + 1)
                Unit - Set the custom value of (Picked unit) to Integer
                Custom script: set udg_Creep_X[udg_Integer] = GetUnitX(GetEnumUnit())
                Custom script: set udg_Creep_Y[udg_Integer] = GetUnitY(GetEnumUnit())

And here is the "Revive Creeps 1 by 1"
Code:
Revive Creeps 1 by 1
    Events
        Unit - A unit Dies
    Conditions
        ((Owner of (Triggering unit)) Equal to Neutral Hostile) and (((Triggering unit) is Summoned) Not equal to True)
    Actions
        Wait 5.00 game-time seconds
        Set tempPoint[1] = (Center of (Entire map))
        Set tempPoint[2] = (tempPoint[1] offset by (Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))]))
        Unit - Create 1 (Unit-type of (Triggering unit)) for Neutral Hostile at (Center of ((Entire map) offset by (Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))]))) facing (Random angle) degrees
        Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
        Custom script: call RemoveLocation(udg_tempPoint[1])
        Custom script: call RemoveLocation(udg_tempPoint[2])
As I said before, the problem was that the creeps did infact respawn, but in the center of the map (oddly patterned too, like, didn't respawn right next to eachother, but exact distance away from eachother as if they spawned normally), instead of where they should be.

A few things that may affect it:
-The models I am using do not have a decaying animation, they just have a death animation, although I tested this with a regular game model and it still respawned in the middle of the map.
-Flesh and Bones under the gameplay constants are at default, 88s and 2s.
-Also originally tried to test with "Wait - 50.00 real time seconds", but changed it to game time after it kept bugging out and spawning in the middle of the map.

If anyone can help with this it would be most appreciated ^^
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Where is that trigger coming from?


> Center of ((Entire map) offset by (Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))]))

Well, you store the actual positions of the Creeps. It makes little sense to revive them relative to the map's center.


Forget those x,y arrays.
Use an array of points, store the actual positions, and simply use that to respawn them.


On a related note, that kind of triggers does not work with units that do not leave a corpse.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top