• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Help with trigger

Status
Not open for further replies.
Level 6
Joined
Jul 2, 2013
Messages
156
Ok I want to do this thing, event, every 120 seconds of game time, add X spell to X unit and make him cast it, but if every player types -block in 3.5 seconds, spell is not cast. The hard part is to detect when 1 player types -block to remove him from the players that can type -block. So if 1 player types -block 4 times it won't work. It will require 4 players. That's what I need. Any ideas? I prefer GUI.
 
  • Block Count
    • Events
      • Player - Player 1 (Red) types a chat message containing -block as An exact match
      • Player - Player 2 (Blue) types a chat message containing -block as An exact match
      • Player - Player 3 (Teal) types a chat message containing -block as An exact match
      • Player - Player 4 (Purple) types a chat message containing -block as An exact match
    • Conditions
    • Actions
      • Set BlockIndex = (Player number of (Triggering player))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Blocked[BlockIndex] Equal to False
        • Then - Actions
          • Set Blocked[BlockIndex] = True
        • Else - Actions
  • Block Ability
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Blocked[1] Equal to True
          • Blocked[2] Equal to True
          • Blocked[3] Equal to True
          • Blocked[4] Equal to True
        • Then - Actions
          • Unit - Order CastingUnit to Stop
          • Unit - Remove Tranquility from CastingUnit
          • Set Blocked[1] = False
          • Set Blocked[2] = False
          • Set Blocked[3] = False
          • Set Blocked[4] = False
        • Else - Actions
You also need to make a variable for the unit you are going to give the ability to, so you will keep track of him and remove the ability once it's blocked.
 
What type of variable is BlockIndex, and What if there are 9 players, can u change the trigger a little bit so it fits if there are 9 players and if 4 of them type -block, spell is blocked. Thanks
 
BlockIndex is an integer variable, you will only need this trigger:

[hidden="Trigger 1]
  • Block Count
    • Events
      • Player - Player 1 (Red) types a chat message containing -block as An exact match
      • Player - Player 2 (Blue) types a chat message containing -block as An exact match
      • Player - Player 3 (Teal) types a chat message containing -block as An exact match
      • Player - Player 4 (Purple) types a chat message containing -block as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -block as An exact match
      • Player - Player 6 (Orange) types a chat message containing -block as An exact match
      • Player - Player 7 (Green) types a chat message containing -block as An exact match
      • Player - Player 8 (Pink) types a chat message containing -block as An exact match
      • Player - Player 9 (Gray) types a chat message containing -block as An exact match
    • Conditions
    • Actions
      • Set BlockIndex = (Player number of (Triggering player))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Blocked[BlockIndex] Equal to False
        • Then - Actions
          • Set Blocked[BlockIndex] = True
          • Set BlockCount = (BlockCount + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • BlockCount Equal to 4
            • Then - Actions
              • Unit - Order CastingUnit to Stop
              • Unit - Remove Tranquility from CastingUnit
              • Set Blocked[1] = False
              • Set Blocked[2] = False
              • Set Blocked[3] = False
              • Set Blocked[4] = False
              • Set Blocked[5] = False
              • Set Blocked[6] = False
              • Set Blocked[7] = False
              • Set Blocked[8] = False
              • Set Blocked[9] = False
              • Set BlockCount = 0
            • Else - Actions
        • Else - Actions
[/hidden]
 
Status
Not open for further replies.
Back
Top