• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Advanced Unit Respawn system

Status
Not open for further replies.
Level 10
Joined
Nov 24, 2010
Messages
546
Hello again
Well first of all im sorry to creating pretty much threads.

Now im looking for Unit Respawn system
Each type of unit should be stored in Array Variable.
Each unit has it own region where it respawn over some time.

Well lets say there are 6 Ghouls
Each have different place on map, and whenever killed he respawn on his original region over 240 seconds.

Anyone know help? Demo map would be also very cool
Ill +rep if you help me :p
 
There are many methods. You can use Unit Indexer and store initial location for each unit using custom value of unit.

  • Set key = (Custom value of unit)
  • Set loc[key] = (Position of unit)
There is also no problem if you would like to use coordinates insteado locations.

When given unit dies:

  • init
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set key = (Custom value of (Triggering unit))
      • Unit - Create 1 (Unit-type of (Triggering unit)) for (Onwer of (Triggering unit)) at loc[key] facing Default building facing degrees
 
Level 10
Joined
Nov 24, 2010
Messages
546
Yes, saving location does it's job.

JASS:
local unit u = <your unit>
local integer key = GetUnitUserData(u)
local real x = GetUnitX(u)
local real y = GetUnitY(u)
Coordinates are better than locations if you want efficiency because you can use native for creating unit (which uses coordinates x and y).

ah jass :(( maybe you could upload me a demo map? preferably GUI so i can set my own conditions for specific units. I cant make even Visibility trigger with Jass so i dont understand this :(

JASS:
local unit u = <your unit>
local integer key = GetUnitUserData(u)
local real x = GetUnitX(u)
local real y = GetUnitY(u)
 
Status
Not open for further replies.
Top