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

[Trigger] AFK Timer

Status
Not open for further replies.
Level 10
Joined
Jun 20, 2017
Messages
333
I wanna set afk timer in multiboard that a player is not moving for 30 sec the timer start and after moving the timer reset. But the trigger does not work!
  • Multiboard AFK
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set Integer_AFK = (Player number of (Triggering player))
        • Do Multiple ActionsFor each (Integer A) from 1 to 12, do (Actions)
          • Loop - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Rect_AFK[(Integer A)] contains (Triggering unit)) Equal to (==) True
              • Then - Actions
                • Set Integer_AFK = ((Player number of (Triggering player)) + 1)
              • Else - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Integer_AFK Equal to (==) 29
              • Then - Actions
                • Do Multiple ActionsFor each (Integer A) from 1 to 3, do (Actions)
                  • Loop - Actions
                    • Multiboard - Set the text for Multiboard[(Integer B)] item in column 2, row (Integer_RowPlayers[(Player number of (Picked player))] + 2) to (String_PlayerColors[15] + (String((Integer_AFK + (Player number of (Picked player))))))
                • Set String_TimeTag = (((String(Integer_TimeHour)) + :0) + (((String(Integer_TimeMinutes)) + :0) + (String(Integer_TimeSeconds))))
              • Else - Actions
 
Level 5
Joined
Dec 25, 2014
Messages
111
You use a timer, so the simplest is pick the unit you want to check in a unit group. Inside the unit group, use 'picked unit' to refer the unit. While you are going to check a unit's owner/player, use 'Owner of picked unit' not 'Triggering player'. Remember if a 'Triggering' unit/player is only for the event like 'A unit starts the effect of an ability' or 'Player 1 skips a cinematic'.

Well, i don't know anything about multiboard so, i just could give you this.

EDIT :

Do not use 'For each integer' actions to your triggers if you want to count the time. Just put your integer count variable below the 'Action'.

And not to offend, but sorry, i think your trigger is a mess (cmiiw). I can't really 'read' what the trigger is doing. I want to help fixing that but i'm not on my laptop now.
 
Last edited:
Level 5
Joined
Dec 25, 2014
Messages
111
Wait, where is your 'counting' variable?
And why you set 'IntegerAFK' to player numbers?

EDIT :

Do this 'IntegerAFK = IntegerAFK + 1'

And for your condition, do 'IntegerAFK less than or equal to 30' and do actions that show the timer in multiboa

EDIT :

Oh sorry, the biggest problem. What system do you use to check if the unit is moving or not?
 
Last edited:
Level 5
Joined
Dec 25, 2014
Messages
111
Wait, stop right there. I'm confused. I'm even not sure if my last solution worked. Wait a minute.

EDIT :

I AM so sorry about anything i said above :( :D i'm so confused then, here's maybe what you need based on the map you give to me :

  • Multiboard AFK
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set Integer_AFK = (Player number of (Picked player))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_AFKCount[Integer_AFK] Less than or equal to 30
            • Then - Actions
              • Set Integer_AFKCount[Integer_AFK] = (Integer_AFKCount[Integer_AFK] + 1)
              • Game - Display to (All players) the text: (String(Integer_AFKCount[Integer_AFK]))
              • For each (Integer B) from 1 to 3, do (Actions)
                • Loop - Actions
                  • Multiboard - Set the text for Multiboard[(Integer B)] item in column 2, row (Integer_RowPlayers[Integer_AFK] + 2) to (String_PlayerColors[15] + (String(Integer_AFKCount[Integer_AFK])))
              • Set String_TimeTag = (((String(Integer_TimeHour)) + :0) + (((String(Integer_TimeMinutes)) + :0) + (String(Integer_TimeSeconds))))
            • Else - Actions
              • // You want to do something here (?) //

Ah, don't forgot to remove leaks on your triggers, there's so much :eek:
 
Last edited:
Level 10
Joined
Jun 20, 2017
Messages
333
Nice job, But it does not start at X minutes when the unit is AFK, And the timer stops in 31 seconds! and what can i to do to not show number 1, look at level section for player 2 is nothing there just like that
Example when unit is not moving after 30 second the timer run
a.jpg
 
Last edited:
Level 10
Joined
Jun 20, 2017
Messages
333
Still has a problem
  • Multiboard AFK
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set Integer_AFK = (Player number of (Picked player))
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Integer_AFKCount[Integer_AFK] Greater than or equal to (>=) 0
              • Then - Actions
                • Set Integer_AFKCount[Integer_AFK] = (Integer_AFKCount[Integer_AFK] + 1)
                  • Do Multiple ActionsFor each (Integer A) from 1 to 3, do (Actions)
                    • Loop - Actions
                      • Multiboard - Set the text for Multiboard[(Integer A)] item in column 2, row (Integer_RowPlayers[(Player number of (Picked player))] + 2) to (String(Integer_AFKCount[(Player number of (Picked player))]))
              • Else - Actions
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • Boolean_AFK Equal to (==) True
                    • Integer_AFKCount[Integer_AFK] Less than or equal to (<=) 29
                  • Then - Actions
                    • Set Integer_AFKCount[Integer_AFK] = (Integer_AFKCount[Integer_AFK] + 0)
                  • Else - Actions
 
Status
Not open for further replies.
Top