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

Unit Enter/ Leaves Region doesnt work after region moved?

Status
Not open for further replies.
Level 10
Joined
Jan 28, 2009
Messages
394
Im having trouble with a trigger that involves moving a region, after the region is moved any other triggers with the event "unit leaves region" or "unit enters region" seem to not work. While triggers with the condition "unit is in region" work in the new spot where region was moved. Also if i assign the region a variable it still dont work properly. Grrr..
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
Hmm I ran a few tests
That doesnt seem possible
You need a custom system for that

Something like this
  • Position Check
  • Events
    • Time - Every 0.1 seconds of Game
  • Conditions
  • Actions
    • If (((X of Unit is < Max X of Region A) and (X of Unit is > Min X of Region A)) and ((Y of Unit is < Max Y of Region A and) and (Y of Unit is > Min Y of Region A)))
      • Then - Actions
        • If BoolVarIn is equal to False
          • Then - Actions
            • Set BoolVarIn = True
            • <Do actions for Entering Region>
          • Else - Actions
        • Else - Actions
          • If BoolVarIn is equal to False
            • Then - Actions
            • Else - Actions
              • Set BoolVarIn = False
              • <Do actions for Leaving Region>
Now you can move the Region and it will recodnize that you did

Well its a bit complicated but Sorry only way I could find :' (
 
Level 10
Joined
Jan 28, 2009
Messages
394
Yeah, once you move the region you can no longer use the events "unit enters" or "unit leaves" but everything else still works fine.. Xilinger is right on and yes Need_O2 the best way i found to get around this problem is running a periotic event that checks wether or not the unit is in the region. I was trying to avoid that because i didnt want to create unnecissary lag during the game.
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
that wont make Lag
lol Im dumb, why check coordinates while you can check if a unit in region anyway :p
 
Status
Not open for further replies.
Top