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

Boolean: Unit in Region condition doesn't work.

Status
Not open for further replies.
Level 4
Joined
Jan 28, 2013
Messages
94
I want a unit to be only able to trigger trigger if that unit is in a certain region. I used the Boolean function Unit in Region = True but for some reason that condition does not work! What am I doing wrong?
 
Level 4
Joined
Jan 28, 2013
Messages
94
Here's the trigger:
  • Mount
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Mount (Dummy)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering player) Equal to Player 1 (Red)
          • (Region 000 <gen> contains (Casting unit)) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Casting unit)) Equal to Elite Knight
            • Then - Actions
              • Set MountPlayer1Knight = (Casting unit)
              • Set LocTempKnightPlayer1 = (Position of MountPlayer1Knight)
              • Game Cache - Store MountPlayer1Knight as MountHero of Player1Knight in Hero1Red
              • Game Cache - Save Hero1Red
              • Unit - Hide (Casting unit)
              • Unit - Create 1 Elite Knight (mounted) for Player 1 (Red) at LocTempKnightPlayer1 facing Default building facing degrees
              • Game - Display to (All players) the text: Debug - Knight Saved
            • Else - Actions
              • Game - Display to (All players) the text: Debug - Unit Type f...
        • Else - Actions
          • Game - Display to (All players) the text: Can't mount here
I've posted this trigger before but now I want it to be that the casting unit is in a certain Stable region.
Edit. I should probably remove those Cache actions since it's not working properly.
 
Level 4
Joined
Jan 28, 2013
Messages
94
There is nothing wrong with the trigger per se. Which debug message pops up? Make sure you're dealing with the correct region and ability.

Debug messages:
Can't mount here
Debug - Player or ability fail

Edit. It was the wrong region... :$ Now it works, thanks!
 
Status
Not open for further replies.
Top