How to: Create a Creep Revival System

Tinki3

Special Member
> 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!
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!
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
 
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
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"
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
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
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
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

TheDanish

New Member
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
Staff member
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
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 The Helper:
    it is not that power consumption went up it was available capacity went down with power plants freezing
  • Varine Varine:
    What a fucking disaster. Are all of the Texas people okay? I see TH is, are we the only two?
  • Varine Varine:
    How have the other states held up? I just got power back so I have no idea what's going on, we didn't get warning
  • Varine Varine:
    Why the fuck didn't they fix this ten years ago when it happened?
  • Blackveiled Blackveiled:
    I'm in it with you and TH as well. My power has been in and out, and I have a ruptured pipe that I need to fix, shouldn't be too bad to fix myself.
  • Varine Varine:
    I hope you're staying warm! Apparently the supply is coming up so hopefully we can get back to normal power soon, mine has been on for six hours now.
  • M Mulciberxp:
    My power has been off most of the last 2 days. We had a generator installed 3 years ago though, so we're staying warm. Water is another issue...
  • The Helper The Helper:
    Where I live has a pool so we are using that to get water to flush the toilets. We have enough bottled water to drink and brush teeth and stuff but it has been a few days and no shower though....
  • Varine Varine:
    I had some water in gallon jugs, and got our water back on yesterday. We don't seem to have any leaks, but I haven't crawled down there to look yet.
  • The Helper The Helper:
    still no water I cannot remember when I last showered now I know how they felt in the old west lol
  • Varine Varine:
    My poor plants are happy, they aren
  • Varine Varine:
    aren't used to going this long without water or lights or normal heat. I think a couple of them froze, but they look like they'll make it
  • Varine Varine:
    Well one of them is pretty rough but I think it was sick to begin with, that one always had some problems.
  • jonas jonas:
  • jonas jonas:
    ???
  • Ghan Ghan:
    That is such a Texas thing to say lol
  • midnight8 midnight8:
    a positive could come out of this. So many people trapped at home could put a dent in the covid numbers in Texas
  • Varine Varine:
    That dude, Tom Boyd, is really upset about the backlash from his "it's your fault you're freezing" thing because he claims he resigned before saying it, so it wasn't like he said it in his official capacity or anything.
  • jonas jonas:
    Almost as if he was saying "screw you guys, I'm going home"
  • Varine Varine:
    I'm fairly new here still but that seems to be the analogous message by several of our politicians.
  • vypur85 vypur85:
    Nobody?
  • jonas jonas:
    Hi vypur85, long time no see
  • tom_mai78101 tom_mai78101:
    Hi vypur85, long time no see.
  • The Helper The Helper:
    We are all somebody
  • Varine Varine:
    I kinda like being nobody tho.

    Staff online

    Members online

    Affiliates

    Hive Workshop NUON Dome
    Top