🏆 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!
i made trigger when my units enter certain region, enemy villagers go to nearby building and tranform to footmen but then game froze, can someone help me how to do it correctly?
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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.