How do you Respawn Creeps?

Samael88

Evil always finds a way
Reaction score
181
It is not that hard. You just do this:

Code:
Event
   Unit dies
Condition
   Put something here to specify wich units
Actions
   Wait XX time
   set temppoint = position of dying unit
   create a unit of same type as dying unit at temppoint
   Custom script: call RemoveLocation(udg_temppoint)

That will respawn the unit where it dies. The simplest trigger around for it.

temppoint is a point variable.
it is there to store the point and then help us destroy it so that we don't get a memory-leak.
the udg_ is beacuse the variable is "created" in the variable editor.
udg_InsertVariableNameHere.
 

Galdiuz

Creator of Photon Command
Reaction score
98
That IS an exact trigger... or, almost. You'd have to change the condition though. Use ''Owner of triggering unit is equal to neutral hostile''.
 

Curo

Why am I still playing this game...?
Reaction score
109
Oh okay, do you think you could give me an exact trigger? If it's not too much hassle.

Why do some people want everything handed to them exactly? Are you going to ask us for every one of the triggers you make? Better that you learn how to make triggers. A guide like the one provided should be sufficient. Give a man a fish and he will eat for a day; teach a man to fish and he will eat until he gets sick of fish.

And btw, use Triggering unit instead of Dying unit. Dying unit may get lost with the wait function.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Though that variable will be overwritten if anpther creep dies within the wait time.
For this you'll need to use JASS, sorry don't know the code, just thought i'd let you know =)
 

CaptDeath

New Member
Reaction score
103
Why do some people want everything handed to them exactly? Are you going to ask us for every one of the triggers you make? Better that you learn how to make triggers. A guide like the one provided should be sufficient. Give a man a fish and he will eat for a day; teach a man to fish and he will eat until he gets sick of fish.

And btw, use Triggering unit instead of Dying unit. Dying unit may get lost with the wait function.

they ask for it cause they are still learning to fish and wants to see how a fisherman doses it
i will make one in like a few hours im busy atm
 

Curo

Why am I still playing this game...?
Reaction score
109
they ask for it cause they are still learning to fish and wants to see how a fisherman doses it
i will make one in like a few hours im busy atm

So then explain to them how to make a trigger; don't make it for them, or tomorrow they'll just show up asking you to make another trigger. I have NEVER made a thread expecting to get a trigger from someone.

Also, I think Triggering unit will survive through the waits...not sure who I heard it from though.
 

Romek

Super Moderator
Reaction score
964
Both Dying unit and Triggering unit can last waits.
Dying unit is just a slightly less efficient Triggering Unit actually...
 

Curo

Why am I still playing this game...?
Reaction score
109
Both Dying unit and Triggering unit can last waits.
Dying unit is just a slightly less efficient Triggering Unit actually...

If another unit dies, doesn't Dying unit get overwritten? I know things like Casting unit get overwritten. Either way, Triggering unit is the most efficient.
 

Romek

Super Moderator
Reaction score
964
If another unit dies, doesn't Dying unit get overwritten? I know things like Casting unit get overwritten. Either way, Triggering unit is the most efficient.
Hmm. Actually, I got confused.
Triggering Unit and Dying Unit are both natives.

Which means neither of them get over-written :D
 

Samael88

Evil always finds a way
Reaction score
181
And btw, use Triggering unit instead of Dying unit. Dying unit may get lost with the wait function.

That could be true. I don't think it makes any difference tho.


just set the variable before the wait function so it doesnt get lost...

That is the mot outrageous thing I ever heard:(
The whole reason to set the variable after the wait is so that it does not get lost.
If it was before it would have been overwritten everytime the trigger fires. And I don't think you kill a monster every, say 60 seconds:p

Though that variable will be overwritten if anpther creep dies within the wait time.
For this you'll need to use JASS, sorry don't know the code, just thought i'd let you know =)

No need for Jass at all. The whole reason of setting the variable after the wait is so that he does not need to use JASS:mad:


Both Dying unit and Triggering unit can last waits.
Dying unit is just a slightly less efficient Triggering Unit actually...

Finally. Thanks romek:thup:



On topic: That trigger will work just fine. No problem with it at all:nuts:
 

Exide

I am amazingly focused right now!
Reaction score
448
Here you go:

Trigger:
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Counter = 1
      • Set tempgroup = (Units owned by Neutral Hostile)
      • Unit Group - Pick every unit in tempgroup and do (Actions)
        • Loop - Actions
          • Set CreepRespawnPoint[Counter] = (Position of (Picked unit))
          • Unit - Set the custom value of (Picked unit) to Counter
          • Set Counter = (Counter + 1)
      • Custom script: call DestroyGroup(udg_tempgroup)


Trigger:
  • Respawning
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
    • Actions
      • Wait 15.00 seconds
      • Unit - Create 1 (Unit-type of (Triggering unit)) for Neutral Hostile at CreepRespawnPoint[(Custom value of (Triggering unit))] facing Default building facing degrees
      • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
 
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