replacing villagers for footmen

Status
Not open for further replies.
Can you post the trigger?
upload_2018-10-2_19-0-15.png
upload_2018-10-2_19-0-33.png
 
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.
Back
Top