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

[Solved] Trigger isn't working!

Status
Not open for further replies.
Level 20
Joined
Jun 27, 2011
Messages
1,864
I've created an afk trigger which makes the player's unit pause and invulnerable if they type -afk.

Now to the problem, why this two triggers isn't working?

  • AFK Dialog
    • Events
      • Player - Player 1 (Red) types a chat message containing -afk as An exact match
      • Player - Player 2 (Blue) types a chat message containing -afk as An exact match
      • Player - Player 3 (Teal) types a chat message containing -afk as An exact match
      • Player - Player 4 (Purple) types a chat message containing -afk as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -afk as An exact match
      • Player - Player 6 (Orange) types a chat message containing -afk as An exact match
      • Player - Player 7 (Green) types a chat message containing -afk as An exact match
      • Player - Player 8 (Pink) types a chat message containing -afk as An exact match
      • Player - Player 9 (Gray) types a chat message containing -afk as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -afk as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -afk as An exact match
      • Player - Player 12 (Brown) types a chat message containing -afk as An exact match
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AFK_Check[(Player number of (Triggering player))] Equal to False
        • Then - Actions
          • Game - Display to (All players) for TextTimer seconds the text: (|cffD6AE12[System]|r: + (Player_Colors[(Player number of (Triggering player))] + ((Name of (Triggering player)) + |r is now Away From Keyboard (AFK))))
          • Dialog - Change the title of AFK_Dialog[(Player number of (Triggering player))] to |cff00FFFFYou're aw...
          • Dialog - Create a dialog button for AFK_Dialog[(Player number of (Triggering player))] labelled |cff696969I'm back....
          • Dialog - Show AFK_Dialog[(Player number of (Triggering player))] for (Owner of Castaways[(Player number of (Triggering player))])
          • Set AFK_Check[(Player number of (Triggering player))] = True
          • Unit - Make Castaways[(Player number of (Triggering player))] Invulnerable
          • Unit - Pause Castaways[(Player number of (Triggering player))]
          • Trigger - Add to AFK Click <gen> the event (Dialog - A dialog button is clicked for AFK_Dialog[(Player number of (Triggering player))])
        • Else - Actions
  • AFK Click
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to AFK_Button[(Player number of (Triggering player))]
        • Then - Actions
          • Dialog - Clear AFK_Dialog[(Player number of (Triggering player))]
          • Game - Display to (All players) for TextTimer seconds the text: (|cffD6AE12[System]|r: + (Player_Colors[(Player number of (Triggering player))] + ((Name of (Triggering player)) + |r is now back.)))
          • Set AFK_Check[(Player number of (Triggering player))] = False
          • Unit - Make Castaways[(Player number of (Triggering player))] Vulnerable
          • Unit - Unpause Castaways[(Player number of (Triggering player))]
        • Else - Actions
+rep and credit for the helper ofcourse!
 
Level 5
Joined
Dec 8, 2012
Messages
149
[trigger=This is mine]afk
Events
Player - Player 1 (Red) types a chat message containing -afk as An exact match
Player - Player 2 (Blue) types a chat message containing -afk as An exact match
Player - Player 3 (Teal) types a chat message containing -afk as An exact match
Player - Player 4 (Purple) types a chat message containing -afk as An exact match
Player - Player 5 (Yellow) types a chat message containing -afk as An exact match
Player - Player 6 (Orange) types a chat message containing -afk as An exact match
Player - Player 7 (Green) types a chat message containing -afk as An exact match
Player - Player 8 (Pink) types a chat message containing -afk as An exact match
Player - Player 9 (Gray) types a chat message containing -afk as An exact match
Player - Player 10 (Light Blue) types a chat message containing -afk as An exact match
Player - Player 11 (Dark Green) types a chat message containing -afk as An exact match
Player - Player 12 (Brown) types a chat message containing -afk as An exact match
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
AFKdetector Equal to False
Then - Actions
Set human = (Random unit from (Units owned by (Triggering player)))
Game - Display to (All players) the text: ((Name of (Triggering player)) + is now afk.)
Unit - Pause human
Unit - Make human Invulnerable
Dialog - Change the title of AFKdialog to Away From Keyboard
Dialog - Create a dialog button for AFKdialog labelled I'm back!
Set AFKimback = (Last created dialog Button)
Dialog - Show AFKdialog for (Triggering player)
Set AFKdetector = True
Else - Actions
Set human = (Random unit from (Units owned by (Triggering player)))
Game - Display to (All players) the text: ((Name of (Triggering player)) + is now afk.)
Unit - Pause human
Unit - Make human Invulnerable
Dialog - Change the title of AFKdialog to Away From Keyboard
Set AFKimback = (Last created dialog Button)
Dialog - Show AFKdialog for (Triggering player)[/trigger]

[trigger=The Dialog]AFKimback
Events
Dialog - A dialog button is clicked for AFKdialog
Conditions
(Clicked dialog button) Equal to AFKimback
Actions
Unit - Unpause human
Unit - Make human Vulnerable
Game - Display to (All players) the text: ((Name of (Triggering player)) + is back!)[/trigger]
That's working for me :) OGRE Face :ogre_hurrhurr:
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
This works for me:

  • InitDialogs
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: if udg_AFK_DIALOG[bj_forLoopAIndex] == null then
          • Custom script: set udg_AFK_DIALOG[bj_forLoopAIndex]= DialogCreate()
          • Custom script: endif
          • Trigger - Add to SetAFKOff <gen> the event (Dialog - A dialog button is clicked for AFK_DIALOG[(Integer A)])
          • Dialog - Create a dialog button for AFK_DIALOG[(Integer A)] labelled I'm back
  • SetAFKOn
    • Events
      • Player - Player 1 (Red) types a chat message containing afk as An exact match
    • Conditions
    • Actions
      • Set I = (Player number of (Triggering player))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AFK[I] Equal to False
        • Then - Actions
          • Set AFK[I] = True
          • Dialog - Change the title of AFK_DIALOG[I] to You're AFK
          • Dialog - Show AFK_DIALOG[I] for (Triggering player)
          • Unit - Pause HEROES[I]
          • Unit - Make HEROES[I] Invulnerable
        • Else - Actions
  • SetAFKOff
    • Events
    • Conditions
    • Actions
      • Set I = (Player number of (Triggering player))
      • Set AFK[I] = False
      • Unit - Unpause HEROES[I]
      • Unit - Make HEROES[I] Vulnerable
 

Attachments

  • DiaTest.w3x
    13.3 KB · Views: 44
Last edited:
Level 20
Joined
Jun 27, 2011
Messages
1,864
This works for me:

  • InitDialogs
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: if udg_AFK_DIALOG[bj_forLoopAIndex] == null then
          • Custom script: set udg_AFK_DIALOG[bj_forLoopAIndex]= DialogCreate()
          • Custom script: endif
          • Trigger - Add to SetAFKOff <gen> the event (Dialog - A dialog button is clicked for AFK_DIALOG[(Integer A)])
          • Dialog - Create a dialog button for AFK_DIALOG[(Integer A)] labelled I'm back
  • SetAFKOn
    • Events
      • Player - Player 1 (Red) types a chat message containing afk as An exact match
    • Conditions
    • Actions
      • Set I = (Player number of (Triggering player))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AFK[I] Equal to False
        • Then - Actions
          • Set AFK[I] = True
          • Dialog - Change the title of AFK_DIALOG[I] to You're AFK
          • Dialog - Show AFK_DIALOG[I] for (Triggering player)
          • Unit - Pause HEROES[I]
          • Unit - Make HEROES[I] Invulnerable
        • Else - Actions
  • SetAFKOff
    • Events
    • Conditions
    • Actions
      • Set AFK[I] = False
      • Set I = (Player number of (Triggering player))
      • Unit - Unpause HEROES[I]
      • Unit - Make HEROES[I] Vulnerable

Oh thanks, it works!

Solved.
 
Status
Not open for further replies.
Top