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: 550

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
447
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.
  • Varine Varine:
    I ordered like five blocks for 15 dollars. They're just little aluminum blocks with holes drilled into them
  • Varine Varine:
    They are pretty much disposable. I have shitty nozzles though, and I don't think these were designed for how hot I've run them
  • Varine Varine:
    I tried to extract it but the thing is pretty stuck. Idk what else I can use this for
  • Varine Varine:
    I'll throw it into my scrap stuff box, I'm sure can be used for something
  • Varine Varine:
    I have spare parts for like, everything BUT that block lol. Oh well, I'll print this shit next week I guess. Hopefully it fits
  • Varine Varine:
    I see that, despite your insistence to the contrary, we are becoming a recipe website
  • Varine Varine:
    Which is unique I guess.
  • The Helper The Helper:
    Actually I was just playing with having some kind of mention of the food forum and recipes on the main page to test and see if it would engage some of those people to post something. It is just weird to get so much traffic and no engagement
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top