Respawning creeps

skullkidd

New Member
Reaction score
7
Alright so I have tried many creep re spawning methods. And they all pretty much work but there are certain things that aren't working like I would like.

The problems i am having are:
When creep heroes re spawn they go back to level one and they don't have the same items anymore.

Here is what i used...

trigger 1

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())

trigger 2

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 ((Real((Level of (Triggering unit)))) x 30.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))


Also im not sure if this is a bug or not, but some of the units even don't respawn.

Thanks for any help
 

slayer

New Member
Reaction score
2
I got no solution to your problem but..
Neutral Hostile heroes is always "zeroed" when repspawned in this way, all skills, items and so on is put back to default.

I've noticed myself that GUI-creep-respawn triggers overwrite themselves, and less and less creeps is spawned if you are using similar triggers and variables that creates units. But thats just my own experience :D
 

FireBladesX

Eating my wings!
Reaction score
123
Units that dont drop corpses (Water elementals, air units, etc...) won't respawn, because the corpse must still be remaining by the end of a wait.

And if you create another unit, it is by definition starting at level one. So heroes naturally reset their level, they have no record of the previous one.

If you edited your gameplay constants, as well, this could have an effect. Like if your corpses ran out after 30 seconds, and it takes 50 seconds to respawn.
 

PrisonLove

Hard Realist
Reaction score
78
Code:
        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

found your problem

youre not reviving the heroes youre just creating new ones so they always start at level 1 with no experience

if you want to revive heroes i suggest doing one of two things

A) create a hero revive trigger separate from the normal unit one

or

B) set the dying heroes level, XP, items, etc. into variables and give them back when they are created.

i suggest A as it is MUCH easier
 

X-maul

AKA: Demtrod
Reaction score
201
i got an good creep revival system, it revivi's the unit 22 seconds after it die at the position it have been placed in WE
Code:
Creep Get Position
    Events
        Map initialization
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Entire map) owned by Neutral Hostile) and do (Actions)
            Loop - Actions
                Set Integer = (Integer + 1)
                Unit - Set the custom value of (Picked unit) to Integer
                Set Point_CR[Integer] = (Position of (Picked unit))
Code:
Creep Respawn
    Events
        Unit - A unit owned by Neutral Hostile Dies
    Conditions
        ((Triggering unit) is Summoned) Equal to False
    Actions
        Wait 22.00 seconds
        Unit - Create 1 (Unit-type of (Triggering unit)) for Neutral Hostile at Point_CR[(Custom value of (Triggering unit))] facing (Random angle) degrees
        Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
 

skullkidd

New Member
Reaction score
7
Units that dont drop corpses (Water elementals, air units, etc...) won't respawn, because the corpse must still be remaining by the end of a wait.

And if you create another unit, it is by definition starting at level one. So heroes naturally reset their level, they have no record of the previous one.

If you edited your gameplay constants, as well, this could have an effect. Like if your corpses ran out after 30 seconds, and it takes 50 seconds to respawn.


Are you saying that in order for the unit to re spawn. The corpse of the dying unit must still be on the field until it is revived?

if you want to revive heroes i suggest doing one of two things

A) create a hero revive trigger separate from the normal unit one

or

B) set the dying heroes level, XP, items, etc. into variables and give them back when they are created.

Ok say I do "A". Can you give me a hero revive trigger. Cause I did attempt that when I found out what was happening. Since it wasn't working I decided to ask here.



i got an good creep revival system, it revivi's the unit 22 seconds after it die at the position it have been placed in WE


Hey, but does this fix the problems that I was having?
 

vypur85

Hibernate
Reaction score
803
> The corpse of the dying unit must still be on the field until it is revived?

Yes. Or else, there will be no such thing as 'Triggering unit' or 'Dying unit' after the wait time. Triggering/Dying unit can either life or dead.
Code:
When die --> become corpse --> after decay --> removed from game

But sometimes, there is no corpse created, so,
Code:
When die --> removed from the game
 

skullkidd

New Member
Reaction score
7
alright that makes sense. thanks

so mountain giants don't decay?
well it says they do... but they don't respawn
 

vypur85

Hibernate
Reaction score
803
> so mountain giants don't decay?

I'm not sure if they create corpse or not but if they do decay, what's their decay time? Say their decay time is 50 seconds, after 50 seconds, corpse will be removed, thus leaving no 'Dying unit' or "Triggering unit'. In your trigger, it waits 30 seconds per level. If your giants are level 5, then it will wait 150 seconds, by which time, the corpse are already gone for good. Try adjusting the Creep Decay Time in the Gameplay Constant (situated at the Advanced tab in Terrain Editor).

Another way to test is to wait 2 seconds instead of 30*level. Change that value and see whether they respawn.
 

skullkidd

New Member
Reaction score
7
Oh that seems right cause the decay time is only 15 seconds and their level 7.
aha, thanks. So that solves that problem.

Now keeping the same level and keeping the dropped/equiped items after it is revived is in question now.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top