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

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