Warcraft III resources & community, 2003–2006 · archived

Respawning Units

5 posts
#1

Respawning Units

So im makeing a new RPG... but I have no idea how to do the trigger that repawns creeps when they die.
Can anyone please help me?
#2
Well, there's plenty of ways to do this but if you're looking for something simple and easy just go with:

Event:
A unit owned by <neutral hostile> dies

Actions:
Wait 60 seconds
Replace <triggering unit> with a <Unit-type of <triggering unit>> using the new unit's max life and mana


That'll get you started, but you'll have to tweak it later on for bosses and camper protection and so forth.
#3
Will I have to do this with evey single creep in my map?
#4
No, for the trigger event just use the "Unit - Player-Owned Unit Event" for each enemy player. So, my trigger above just used neutral hostile, but if you had player 11 and 12 as computer enemies then your trigger would look like:


Event:
A unit owned by <player 11> dies
A unit owned by <player 12> dies

Actions:
Wait 60 seconds
Replace <triggering unit> with a <Unit-type of <triggering unit>> using the new unit's max life and mana


The <triggering unit> is actually what you pick, you don't need to replace it with every unit you have. Hope that helps to clarify things.
#5

Other way

To respawn units you will, most of times, use the same event.
Event-
A unit dies

You put the condition according to the kind of unit. Exemples:
If the unit is a hero: (Triggering Unit) is a (Hero) Equal to (True)
Is is a creep, : Owner of (Triggering Unit) equal to (Neutral Hostile)
And if are just simple player's units only change the (Neutral Hostile),in the exemple above, to the name of the player : Ower of (Triggering Unit) equal to (Player 1)
Like the event, the action is usually the same :
Create 1 (Unit-type of (Triggering Unit)) at (Unit Position *(Position of (Triggering Unit))

* You can change the position of the unit changing the "(Position of (Triggering Unit))" to the name of the area you want.