• 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.

how to make the monsters respawn where they started?

Status
Not open for further replies.
Level 4
Joined
Jun 17, 2011
Messages
64
this is my trigger to revive the units and the heroes
  • Revive
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Dying unit) is A Hero) Equal to True
        • Then - Actions
          • Wait ((Real((Level of (Triggering unit)))) + 10.00) seconds
          • Hero - Instantly revive (Dying unit) at (Center of hero revive town <gen>), Hide revival graphics
        • Else - Actions
          • Wait 40.00 seconds
          • Unit - Create 1 (Unit-type of (Dying unit)) for Player 12 (Brown) at (Position of (Dying unit)) facing Default building facing degrees
but they kept spawning where they died
 
Level 3
Joined
Nov 15, 2010
Messages
30
this is my trigger to revive the units and the heroes
  • Revive
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Dying unit) is A Hero) Equal to True
        • Then - Actions
          • Wait ((Real((Level of (Triggering unit)))) + 10.00) seconds
          • Hero - Instantly revive (Dying unit) at (Center of hero revive town <gen>), Hide revival graphics
        • Else - Actions
          • Wait 40.00 seconds
          • Unit - Create 1 (Unit-type of (Dying unit)) for Player 12 (Brown) at (Position of (Dying unit)) facing Default building facing degrees
but they kept spawning where they died

------------------------------------------------------------------------
Unit - Create 1 (Unit-type of (Dying unit)) for Player 12 (Brown) at (Position of (Dying unit)) facing Default building facing degrees
-------------------------------------------------------------------------
Change the part where it says at (position of dying unit) to the spot where you want it to respawn.

As it is now, if its a hero, it respawns at the specified location, but it its a non-hero, it spawns exactly where it died.

Hope it helps.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
You create a system which runs at map initialization and generates position data for all units that will respawn (where they start). Later when a unit dies you acess this position data when you respawn them.

You can eithor do this using a hashtable to map the respawn position data to each unit and when the unit dyes you free that unit and add the respawn data to the new unit. Or you could use an array system to store the respawn position data and then just give the units a trigger value (integer which you can change only with triggers) a value representing the slot that the position data has to come from when they respawn.
 
Level 4
Joined
Jun 17, 2011
Messages
64
You create a system which runs at map initialization and generates position data for all units that will respawn (where they start). Later when a unit dies you acess this position data when you respawn them.

You can eithor do this using a hashtable to map the respawn position data to each unit and when the unit dyes you free that unit and add the respawn data to the new unit. Or you could use an array system to store the respawn position data and then just give the units a trigger value (integer which you can change only with triggers) a value representing the slot that the position data has to come from when they respawn.

How can i do a hashtable to map? or the other one? which one is easier?
 
Status
Not open for further replies.
Top