• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Certain unit respawn at certain region

Status
Not open for further replies.
Level 3
Joined
May 24, 2008
Messages
53
Hi! :)
I need help making a trigger that should spawn a certain unit, at certain place, when it dies
the thing is that the unit is in more than one spot..
for example:
I have a Spider unit un the region Spid01
also I have a Spider in a region called Spid02
I need to spawn a spider in region Spid01 when a unit from there dies
same with Spid02
a few weeks ago I'd come up with a trigget that almost worked.. except that the unit was created twice..
once when the unit died (how it was supposed to do)
and again like 4 o 5 seconds later..
I tried disabling that one to see if the second unit still spawns (because of another trigger) but nothing happened..
so the problem was that trigger..
anyway: I need a trigger to spawn a "X" unit in a "P" place..
how can i do that?
thanks!!
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
This map contains what you need.

On map initialiazation all units owned by the "Neutral Hostile" player are picked and put into a group. Then all units from that group have their position declared and saved into their custom value.

The second trigger contains the ressurection part, detecting when any of the players' unit dies, then declaring it's position from the custom value and ressurectining it after a small period of time.
 

Attachments

  • Respawn.w3x
    17.2 KB · Views: 55
Level 3
Joined
May 24, 2008
Messages
53
I need it to work with regions..
how can i modify it to work in regions?
 
Level 3
Joined
May 24, 2008
Messages
53
because i need units to spawn at one place only..
and if i make a unit move from it spawn point (with your system), when it spawn, it will spawn in the spot it died..
and one can keep moving it.. and i don't want that..
Edit:
Also, there will be more than one hero killing units... what if 2 units are killed almost at the same time?
wont they spawn near each other?
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
It will spawn on the spot where it was at the begining of the map..
You could notice that if you were tested the map entirely.

And no problem if there are more than 1 killed unit, if you want to test it make a spell that kills all 9 units I have placed and they will spawn one by one or all at the same time.
 
Level 3
Joined
May 24, 2008
Messages
53
I asked because i tested it...
if Before the last unit killed respawn (let's call it A), another unit is killed (B), the A unit respawns at the spot that B is killed
i tried with your map AND on mine..
maybe i did something wrong, but that's what i got..
 
Status
Not open for further replies.
Top