• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Game crashes when an unit enters to a region

Status
Not open for further replies.
Level 2
Joined
Feb 28, 2019
Messages
10
unknown.png


When a peasant enters to that region this trigger replaces him to a powerfull militia
However, when another unit enters there I want to replace them to another unit
then I set an "Else" in oder to anyone who passes that place turns into a Dragon
but the game instantly crashes.
 
Last edited:
Level 13
Joined
Nov 4, 2006
Messages
1,239
you are creating an infinite loop there, because replacing a unit (or creating a new one for that matter) counts as "entering" the region, which is why the game crashes.

Edit: you can add conditions to check if the unit type is not equal to either Militia or Searinox, so the trigger doesn't fire again
 
Level 39
Joined
Feb 27, 2007
Messages
5,062
For completeness there is another way that is often the way out of recursive triggers: you can disable the trigger before using the create unit command and then re-enable it, though putting a main trigger condition is simpler.
 
Status
Not open for further replies.
Top