• 🏆 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!

Respawn

Status
Not open for further replies.
Level 5
Joined
Jun 10, 2010
Messages
145
Hello again hive!!!
So i am working on a map who need a unit respawn in randown region, i made it.
But the unit respawn on the deep water and don't move.
Plz i need help
Thanks
 
Level 9
Joined
Dec 22, 2008
Messages
488
Well, I think may be a bit much work but here's a way:
1) Create a region in the deep water (or more regions if needed).
2) Create trigger: (1 Even and 1 Action)
  • Unit - A unit enters DeepWater <gen>
  • If ((Unit-type of (Triggering unit)) Equal to Footman) then do (Unit - Move (Triggering unit) instantly to (Random point in (Playable map area))) else do (If ((Unit-type of (Triggering unit)) Equal to Knight) then do (Unit - Move (Triggering unit) instantly to (Random point in (Playable map area))) else do (Do nothing))
3) Do that with every land unit that can't walk on water then leave the end as '(Do nothing)'.

I think this should work.
 
Level 5
Joined
Jun 10, 2010
Messages
145
But the deep water in my map is not a square to put a region see:
 

Attachments

  • Hive.png
    Hive.png
    1.6 MB · Views: 109
Level 14
Joined
Aug 30, 2004
Messages
909
try something like this:

Set TempPoint = random point in playable map area
If terrain-type is pathable for ground units = false,
- then run this trigger
- skip remaining actions
Move unit instantly to TempPoint

Sorry I don't have my editor with me...but what this would do is check to see if the random point is pathable to a ground unit and if not it will grab another point until it does. Then move the unit there.
 
Level 7
Joined
Jun 14, 2009
Messages
235
You could create multiple regions, and have it pick from one randomly (the regions would all be out of the deep water) and then pick a random point in the region.

Also that leeks
 
Level 11
Joined
Jan 25, 2009
Messages
572
Dont listen to them... They seem not to have much knowledge in triggering. Here ill give you the code =D

  • Trigger
    • Events
    • Conditions
    • Actions
      • Set Location = (Random point in Region)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain pathing at Location of type Walkability is off) Equal to False
        • Then - Actions
          • -------- // You'r Actions Below =) --------
        • Else - Actions
This should work but i'm not 100% sure. I dont have much time to test it but you could give it a try =D
 
Status
Not open for further replies.
Top