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

[Trigger] How can i make to deactive this trigger?

Status
Not open for further replies.

old

old

Level 6
Joined
May 8, 2016
Messages
112
This selection system is that one of circle of power, where an unit enters in and select the hero, i want to desactive after the unit enters to don't replicate heroes.
  • Thief Region
    • Events
      • Unit - A unit enters Thief Region <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Spirit of Warrior
    • Actions
      • Set ChooseRegionUnit = (Random point in SHS_Conf_Region_Start)
      • Unit - Create 1 Thief for (Owner of (Triggering unit)) at ChooseRegionUnit facing Default building facing degrees
      • Camera - Lock camera target for (Owner of (Triggering unit)) to (Last created unit), offset by (0.00, 0.00) using Default rotation
      • Unit - Kill (Triggering unit)
      • Unit - Remove (Triggering unit) from the game
      • Selection - Clear selection for (Owner of (Triggering unit))
      • Selection - Add (Last created unit) to selection for (Owner of (Sold unit))
      • Selection - Select (Last created unit) for (Owner of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PermInvBolo Equal to True
        • Then - Actions
          • Unit - Add Ghost to (Last created unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RequiredForCheat Equal to True
        • Then - Actions
          • Hero - Create More HP Cheat and give it to (Last created unit)
        • Else - Actions
      • Custom script: call RemoveLocation(udg_ChooseRegionUnit)
 
At the end of the trigger, add this line:
  • Trigger - Turn off (This trigger)
Just note that it will turn it off for all players. If you want to turn it off only for a particular player, I would recommend creating a boolean array called HasChosenHero, and doing something like this:

  • Thief Region
    • Events
      • Unit - A unit enters Thief Region <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Spirit of Warrior
    • Actions
      • If (All Conditions Are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HasChosenHero[(Player number of (Owner of (Triggering unit)))] Equal to True
        • Then - Actions
          • Skip remaining actions
        • Else - Actions
      • Set ChooseRegionUnit = (Random point in SHS_Conf_Region_Start)
      • Unit - Create 1 Thief for (Owner of (Triggering unit)) at ChooseRegionUnit facing Default building facing degrees
      • Camera - Lock camera target for (Owner of (Triggering unit)) to (Last created unit), offset by (0.00, 0.00) using Default rotation
      • Unit - Kill (Triggering unit)
      • Unit - Remove (Triggering unit) from the game
      • Selection - Clear selection for (Owner of (Triggering unit))
      • Selection - Add (Last created unit) to selection for (Owner of (Sold unit))
      • Selection - Select (Last created unit) for (Owner of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PermInvBolo Equal to True
        • Then - Actions
          • Unit - Add Ghost to (Last created unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RequiredForCheat Equal to True
        • Then - Actions
          • Hero - Create More HP Cheat and give it to (Last created unit)
        • Else - Actions
      • Custom script: call RemoveLocation(udg_ChooseRegionUnit)
      • Set HasChosenHero[(Player number of (Owner of (Triggering unit))] = True
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
ADD where the turn off trigger? under custom script line?
Yes as a custom script as the very last line in your trigger.
old said:
And if i make this haschoosenhero, i'll have to put turn off trigger under this line?
PurgeandFire's trigger includes a check on HasChosenHero to see if the player has already picked and if so it won't create another hero. Look at his If-Then-Else:
  • If (All Conditions Are True) then do (Then Actions) else do (Else Actions
    • If - Conditions
      • HasChosenHero[(Player number of (Owner of (Triggering unit)))] Equal to True
    • Then - Actions
      • Trigger - Skip remaining actions
    • Else - Actions
And make sure to add this line also at the end of your trigger to 'know' which players have chosen heroes:
  • Set HasChosenHero[(Player number of (Owner of (Triggering unit))] = True
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
Or just put the actions inside the if block that returns false statement so skip would be not needed.

Edit: Looks like you only want to deactivate that circle power to all players so duplication won't takes place like from AoS maps so turning off the trigger is a must.
 
Status
Not open for further replies.
Top