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

replacing villagers for footmen

Status
Not open for further replies.
Level 6
Joined
Aug 27, 2013
Messages
103
Can you post the trigger?
upload_2018-10-2_19-0-15.png
upload_2018-10-2_19-0-33.png
 
Level 9
Joined
Jul 30, 2018
Messages
445
I guess when you replace a unit, the replaced unit counts as entering, so it creates an infinite loop: First the villager enters the region, it is removed and is replaced with a Footman, which enters the region again, so it runs the trigger yet again trying to replace the just replaced Footman with another Footman. You might want to add a condition (Unit-type of (Entering unit)) equal to Villager. Or like said above, turn the trigger off, but then again, if the Footman happens to enter the region later, the trigger is ran again.

EDIT:
Also, if you ever plan to make any bigger maps it's a good thing to learn to take off the leaks right from the start. For example, you trigger is now leaking locations and sound. Read more here: Memory Leaks

So do this:

  • Actions
    • Set TempPoint = (Center of Region 000 <gen>)
    • Unit - Order Unit1 to Move To TempPoint
    • Unit - Order Unit2 to Move To TempPoint
    • Unit - Order Unit3 to Move To TempPoint
    • Custom script: call RemoveLocation(udg_TempPoint)
    • Sound - Play [Your sounds]
    • Sound - Destroy (Last played sound) //The sound will still be heard once, even if you destroy it right away
    • Trigger - Turn off (This trigger)
 
Last edited:
Status
Not open for further replies.
Top