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

replacing villagers for footmen

Status
Not open for further replies.
Level 6
Joined
Aug 27, 2013
Messages
104
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