-afk players

IcatiaNight

New Member
Reaction score
1
Hi i am new and I like creating maps, so i decided to register here.
I need the afk trigger and i don t know how do it.:(
So pls someone can help me?:):):)

P.s. i didn t see the Welcome section...
If i must introduce myself say it to me


P.p.s. i am horrible in english :banghead:
 

DiFm

New Member
Reaction score
35
there is an introduction forum somewhere but it's not neccecary. but you have togive a little more information.


When someone types -afk

Does he gets paused or what?


Can anyone type -afk (player)

and that guy gets paused.

Is their specail condition the unit most have not moved in 1 min. or atleast 6 players must have typed afk (player)

and so on. a little more information is needed.
 

Igor_Z

You can change this now in User CP.
Reaction score
61
There is a vote kick teplate somewhere.. Use search function on search in the hive... If u don't know how i will help u just reply here
 

IcatiaNight

New Member
Reaction score
1
there is an introduction forum somewhere but it's not neccecary. but you have togive a little more information.


When someone types -afk

Does he gets paused or what?


Can anyone type -afk (player)

and that guy gets paused.

Is their specail condition the unit most have not moved in 1 min. or atleast 6 players must have typed afk (player)

and so on. a little more information is needed.
example a player type
-afk
and the trigger showes how much time all players didn t move their heroes...

Igor what is a kick teplate? :confused::(
 

saw792

Is known to say things. That is all.
Reaction score
280
Ignore the kick template bit, that is only if you want to be able to kick the players after they are afk for a certain time. First you need the actual triggers.

Create an integer array in the variable editor. Then have a periodic event (i.e. an event that runs every second) increase the integer[Player Number] variable by 1.

Then you need another trigger that registers orders given to units. Just use three events on the one trigger ('A unit is issued an order with no target/issued and order targeting a point/targeting a unit') with no conditions. The Actions for that trigger should be to set integer[Player Number of Owner of Triggering Unit] to 0.

Finally, you need a trigger to actually display the message. Create a real variable (eg: TempReal) in the variable editor. Then you need a chat event for every player that registers when they type '-afk' as an exact match. Then you use a simple 'For Every Integer A... to set the real variable to integer[Integer A] / 60, and display that real.

That's all there is too it. If i had world editor in front of me I would make the actual triggers for you, but I don't. Sorry.
 

DiFm

New Member
Reaction score
35
Oke I Dunno how to remove this location. something like this i guess.

call removelocation(udg_AFK_point1[Bj_getplayerindex()]) so however this wont work unless you let it leak and remove the removeloaction actions. dunno if you should use Local variables or what however this works but leaks which sucks :p. some guy could fill in this last piece?

Code:
Melee Initialization
    Events
        Map initialization
    Conditions
    Actions
        Set Colours[0] = |cffffcc00
        Set Colours[1] = |cffFF0202
        Set Colours[2] = |cff0041FF
        Set Colours[3] = |cff1BE6B8
        Set Colours[4] = |cff530080
        Set Colours[5] = |cffFFFC00
        Set Colours[6] = |cffFE890D
        Set Colours[7] = |cff1FBF00
        Set Colours[8] = |cffE55AAF
        Set Colours[9] = |cff949596
        Set Colours[10] = |cff7DBEF1
        Set Colours[11] = |cff0F6145
        Set Colours[12] = |cff4D2903
        Set End_tag = |r

Code:
AFK TIME
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Set PlayerGroup = (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)))
        Player Group - Pick every player in PlayerGroup and do (Actions)
            Loop - Actions
                Set AFKUNITS = (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to True) and ((Owner of (Matching unit)) Equal to (Picked player))))
                Unit Group - Pick every unit in AFKUNITS and do (Actions)
                    Loop - Actions
                        Set AFKUNIT = (Picked unit)
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Distance between AFK_point1[(Player number of (Picked player))] and AFK_point2[(Player number of (Picked player))]) Greater than or equal to 30.00
                            Then - Actions
[COLOR="Red"]                                Custom script:   call RemoveLocation(udg_AFK_point1)
                                Custom script:   call RemoveLocation(udg_AFK_point2)[/COLOR]
                                Set AFK_point1[(Player number of (Picked player))] = (Position of AFKUNIT)
                                Set AFK_point2[(Player number of (Picked player))] = (Position of AFKUNIT)
                                Set Time[(Player number of (Picked player))] = 0
                            Else - Actions
                                [COLOR="Red"]Custom script:   call RemoveLocation(udg_AFK_point2)[/COLOR]
                                Set AFK_point2[(Player number of (Picked player))] = (Position of AFKUNIT)
                                Set Time[(Player number of (Picked player))] = (Time[(Player number of (Picked player))] + 1)
                Custom script:   call DestroyGroup(udg_AFKUNITS)
        Custom script:   call DestroyForce(udg_PlayerGroup)

Code:
AFK Command
    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
        Set PlayerGroup = (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)))
        Player Group - Pick every player in PlayerGroup and do (Actions)
            Loop - Actions
                Game - Display to (All players) for 7.00 seconds the text: (Colours[(Player number of (Picked player))] + ((Name of (Picked player)) + (End_tag + (Has been afk for:  + ((String(Time[(Player number of (Picked player))])) + seconds.)))))

Something like this. this is untested though. And it leaks the removelocation is redlighted coz it only works if you could do something like i did in the top of this topic.
 

Yizzy

New Member
Reaction score
20
@DiFm that still wont work if the player has more than one hero..?

Don't know how to fix your code though, saw792's way is easier

Code:
AFK Reset Time
    Events
        A unit is issued an order with no target
	A unit is issued and order targeting a point
	A unit is issued and order targeting a unit
    Conditions
	((Ordered unit) is a Hero) Equal to True
    Actions
	Set Time[(Player number of (Triggering player))] = 0

and
Code:
AFK TIME
    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 Time[(Player number of (Picked player))] = (Time[(Player number of (Picked player))] + 1)

Use DiFm's two other triggers for output. This will however only show how much time it has been since the players' heroes has been given an order. While DiFm's trigger shows the sum of all seconds that the player didn't move their hero 30 units (that's roughly the side of the square in the small grid in WE).

To use these triggers you will need to define a few variables though.
For saw792's way (my triggers) you will need:
An Integer array, named Time, with dimension of the number of players.

For DiFm's way you need:
An Integer array, named Time, with dimension of the number of players.
A PlayerGroup variable, named PlayerGroup.
A UnitGroup variable, named AFKUNITS.
A Point array, named AFK_point1, with dimension of the number of players.
A Point array, named AFK_point2, with dimension of the number of players.

I would modify his "AFK TIME" a bit though:
Code:
AFK TIME
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Set PlayerGroup = (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)))
        Player Group - Pick every player in PlayerGroup and do (Actions)
            Loop - Actions
                Set AFKUNITS = (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to True) and ((Owner of (Matching unit)) Equal to (Picked player))))
                Unit Group - Pick every unit in AFKUNITS and do (Actions)
                    Loop - Actions
                        Set AFKUNIT = (Picked unit)
			Custom script:   call RemoveLocation(udg_AFK_point2)
			Set AFK_point2 = (Position of AFKUNIT)
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Distance between AFK_point1[(Player number of (Picked player))] and AFK_point2) Greater than or equal to 30.00
                            Then - Actions
                                Set AFK_point1[(Player number of (Picked player))] = (Position of AFKUNIT)
                                Set Time[(Player number of (Picked player))] = 0
                            Else - Actions
                                Set Time[(Player number of (Picked player))] = (Time[(Player number of (Picked player))] + 1)
                Custom script:   call DestroyGroup(udg_AFKUNITS)
        Custom script:   call DestroyForce(udg_PlayerGroup)

and change AFK_point2 to a Point variable. That would fix ½ the "leak".

afaik point variables (or arrays) shouldn't leak, but most ppl seems to think that, so don't trust me ;) :p
 

saw792

Is known to say things. That is all.
Reaction score
280
Code:
Set Time[(Player number of (Triggering player))] = 0

should be
Code:
Set Time[(Player number of (Owner of (Triggering unit)))] = 0
 

Weegee

Go Weegee!
Reaction score
102
Made a Map for you IcatiaNight...

It contains 2 things:

1. The afk system
2. A Dota Style Timer system

It describes them in the trigger comments but just so you know...

:thup: = Requested Info
:D = Extra Info

Other players have 0 because they aren't actually "playing" meaning they aren't actual players which makes the system does not care about them :D

Type -afk Ingame to show player AFK time :thup:

All those extra strings clean up the older ones so you cant mass your screen with shit :D

The timer goes by 60 seconds equaling a minute :D

Good luck with all your projects and may you be a great TH.net member :D
 

WolfieeifloW

WEHZ Helper
Reaction score
372
The -afk command with your map is...well...bad.
It displays a plain number, no "seconds/minutes".
It also displays ALL players AFK time, even when they aren't in the game, this is just unneeded spam.
Also, there's green icons for lumber/food.
And, the timer starts before the game starts...
 

Weegee

Go Weegee!
Reaction score
102
All of them (but the txt thing that was my bad) had reasons for being so

1. The hero took up 5 food
2. In the triggers I told him to either use a different one or import a time icon
3. added the text line at the end (its always in seconds)

Please think about these things before you post (sorry if I sound offensive right now)

ALL WORKS AND I UPDATED THE POST WITH THE MAP
 

Weegee

Go Weegee!
Reaction score
102
Ok in game interface look around for the icon sections food and lumber

and so to get there you do...

Start World Editor---> Go to the main screen on the map you want to change the icons (the window were you can see terrain)---> go to advanced---> Gameplay Interface---> And search for the icon names food and lumber (so it would read "Icon- Food" & "Icon- Lumber")

and change them to the icon you want (If you want to use custom imports import the file, change the file name of the import to w/e, then in the gameplay consent section just replace the current icon (if there is one) with the imported

and your done :thup:

LOL I laugh at myself for brackets inside brackets

If anything is unclear please tell me :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top