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

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.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top