How to: Create a Creep Revival System

Tinki3

Special Member
Reaction score
418
> If I got an items on the creep that dies, will the one that respawn have the same items?

Annoyingly, no, as the "revived" creep is a whole new unit.
You'd need triggers to assist you here, as you already stated.

Thanks for the comment San-D.
 

FireBladesX

Eating my wings!
Reaction score
123
I put this in to my map, but with 30 second wait, and they don't respawn.
Could this be because the corpses don't last 30 seconds in my map?

However, I tried this with a 2 second wait, and it worked fine.
 

FireBladesX

Eating my wings!
Reaction score
123
Yeah, i edited the constants, but is that what makes the creeps not revive?
fast reply, btw o_O
I think water elementals respawned, btw. logic defying? (i could b mistaken, however)
---> also, i'm pretty sure that the golems came back, too
 

Tinki3

Special Member
Reaction score
418
> i edited the constants, but is that what makes the creeps not revive?

If "Decay Time - (Bones)" + "(Flesh)" gives a value less than 30, then that means the unit is removed before 30 seconds has expired.
Just check those 2 constants.
 
M

modeskon2006

Guest
When I use this trigger, and I kill some creeps, there spawn more creeps then i kill, even tho it says only 1 will respawn in the trigger? ..
 

Lionhearte

New Member
Reaction score
0
I seem to have a bit of a problem.
In my map, after killing said creeps, and waiting the appropriate time set in the trigger, the creeps do not spawn. After testing it by killing a bunch of creeps, which are located in the north west part of the map, I started noticing a large blot in the middle of the map. It was the creeps, respawning (underwater) in the middle of the map, and not where they should be.

I may have done some of the triggers wrong, but after checking over them thrice, it appears everything is in place.

The gameplay constants for "Flesh" and "Bones" are at default. I've tested it a few times, thinking it was because I deleted "Use melee game time" from Map Initialization, but after restoring that and testing again, the problem persists.

Any help on this would be much appreciated :D
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
I seem to have a bit of a problem.
In my map, after killing said creeps, and waiting the appropriate time set in the trigger, the creeps do not spawn. After testing it by killing a bunch of creeps, which are located in the north west part of the map, I started noticing a large blot in the middle of the map. It was the creeps, respawning (underwater) in the middle of the map, and not where they should be.

I may have done some of the triggers wrong, but after checking over them thrice, it appears everything is in place.

The gameplay constants for "Flesh" and "Bones" are at default. I've tested it a few times, thinking it was because I deleted "Use melee game time" from Map Initialization, but after restoring that and testing again, the problem persists.

Any help on this would be much appreciated :D


You will want to post a help thread for this, and when you do be sure to include the trigger, just copy it as text and paste it. I have an idea what is wrong but can't be sure unless I see the trigger, I think you are useing create unit at location of dieing unit which after a wait will no longer be in the memmorie
 
A

Antizer

Guest
I have a question... Can this trigger be used for player units? For instance, there are two training areas in my map. The player "Player 6" has units in these areas (only in these areas), and i want these units to respawn after five seconds.:)
 

The newbie

New Member
Reaction score
0
Something's wrong

Hello, I have spent hours trying to get those fucking mobs to spawn, but I prolly fucked something up along the way xD.

At first I couldn't even get it to work, but now they spawn...it's just the wrong place, they revive at around the middle, which is the "leak" you are talking about I suppose? Well take a look and maybe someone can explain what I've done wrong ;(
Code:
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 10.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])

Code:
Creep revival system initialization
    Events
        Map initialization
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) 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())

There is also this:
JASS:
function Trig_RespawnCreeps_Test takes nothing returns boolean
    return ( IsUnitEnemy(GetFilterUnit(), Player(PLAYER_NEUTRAL_AGGRESSIVE)) )
endfunction

function Trig_RespawnCreeps_Actions takes nothing returns nothing
    local location Position = GetUnitLoc(GetDyingUnit())
    local integer Level = GetUnitLevel(GetDyingUnit())
    loop
        call PolledWait( GetRandomReal(25.00, 55.00) )
        exitwhen ( IsUnitGroupEmptyBJ(GetUnitsInRangeOfLocMatching(1536.00, Position, Condition(function Trig_RespawnCreeps_Test))) == true )
    endloop
    call CreateNUnitsAtLoc( 1, ChooseRandomCreepBJ(Level), Player(PLAYER_NEUTRAL_AGGRESSIVE), Position, bj_UNIT_FACING )
endfunction

function InitTrig_RespawnCreeps takes nothing returns nothing
    set gg_trg_RespawnCreeps = CreateTrigger(  )
    call TriggerRegisterPlayerUnitEventSimple( gg_trg_RespawnCreeps, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddAction( gg_trg_RespawnCreeps, function Trig_RespawnCreeps_Actions )
endfunction


But in these
line 213: Expected a variable name
line 214: Expected a name
line 215: Expected a name
Code:
 set gg_trg_RespawnCreeps = CreateTrigger(  )
    call TriggerRegisterPlayerUnitEventSimple( gg_trg_RespawnCreeps, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddAction( gg_trg_RespawnCreeps, function Trig_RespawnCreeps_Actions )
endfunction

Something like that happened also earlier with Finki's creep reviver, but it seems to be fixed now for me.

If u can't find out what's wrong maybe someone have a creep revive that is easy to use and very simple, i am still learning and the creeps are far from the most important in my map ^^
Maybe a custom written to copy ;)?
 

tork

New Member
Reaction score
2
Thank you very much for this is has helped alot +Rep

But it does leak if you just change a couple things it good

Trigger:
  • Creep Revival System Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Temp_Group = (Units in (Playable map area) owned by Neutral Hostile)
      • Unit Group - Pick every unit in Temp_Group 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())
      • Custom script: call DestroyGroup (udg_Temp_Group)


Trigger:
  • 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 (Random real number between 100.00 and 150.00) seconds
      • Set Temp_Point = ((Center of (Entire map)) 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 Temp_Point facing (Random angle) degrees
      • Custom script: call RemoveLocation (udg_Temp_Point)
      • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
 

13loodfangz

New Member
Reaction score
0
problem

After sweeping through this thread and my own map i still could not find the problem in the creeps not spawning, could you have a look for me to find out what is wrong inside?

much appreciated and thanks.
 

Attachments

  • Luminous Horizon.w3x
    618.2 KB · Views: 543

TheDanish

New Member
Reaction score
0
As far as I can tell, this respawn system does not work properly.

The triggers proposed, of course, leak. These leaks are easy to fix, but when they are fixed, units seem to spawn at the center of the map. It seems that most respawn systems that use similar triggers run into these problems.
 

UndeadDragon

Super Moderator
Reaction score
448
As far as I can tell, this respawn system does not work properly.

The triggers proposed, of course, leak. These leaks are easy to fix, but when they are fixed, units seem to spawn at the center of the map. It seems that most respawn systems that use similar triggers run into these problems.

If you are calling the unitX and unitY positions leaks and removing them, then of course the unit will spawn in the middle of the map. You would not have any offsets to refer to.
 

kiren17

New Member
Reaction score
2
My two triggers are
Trigger:
  • Creep Revival System Initialization Copy
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) and do (Actions)
        • Loop - Actions
          • Set Interger = (Interger + 1)
          • Unit - Set the custom value of (Picked unit) to Interger
          • Custom script: set udg_Creep_X[udg_Integer] = GetUnitX(GetEnumUnit())
          • Custom script: set udg_Creep_Y[udg_Integer] = GetUnitY(GetEnumUnit())


Trigger:
  • 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 ((Real((Level of (Triggering unit)))) x 5.00) game-time seconds
      • 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))
but i get "Error: Expected a name". I copied the two triggers from your map.

Edit: never mind working now.
 
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