• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

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 63
Joined
Jan 18, 2005
Messages
27,155
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