TF2 Event Win Reasons

Please post any questions about developing your plugin here. Please use the search function before posting!
DoopieWop
Junior Member
Posts: 3
Joined: Thu Sep 22, 2022 9:41 pm

TF2 Event Win Reasons

Postby DoopieWop » Thu Sep 22, 2022 9:45 pm

I'm making my first plugin with this and generally i have done barely any TF2 "modding" before. I want to use some of the round related events and one of them is related to round wins (teamplay_round_win). One of the keys is called winreason and it returns a number, however I haven't found some kind of list or documentation on what each number means. I can only assume but I don't know for sure. Is there a piece of documentation I missed about that?
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: TF2 Event Win Reasons

Postby L'In20Cible » Fri Sep 23, 2022 1:34 am

Syntax: Select all

# ../resource/tf_english.txt

"Winreason_AllPointsCaptured" "%s1 captured all control points"
"Winreason_FlagCaptureLimit" "%s1 captured the enemy intelligence %s2 times"
"Winreason_FlagCaptureLimit_One" "%s1 captured the enemy intelligence %s2 time"
"Winreason_OpponentsDead" "%s1 killed all opponents during sudden death"
"Winreason_DefendedUntilTimeLimit" "%s1 successfully defended until time ran out"
"Winreason_TimeLimit" "%s1 had more points when the time limit was reached"
"Winreason_WinLimit" "%s1 had more points when the win limit was reached"
"Winreason_WinDiffLimit" "%s1 was ahead by the required difference to win"
"Winreason_Stalemate" "You're all losers"
"Winreason_Arena" "%s1 killed all opponents"
"Winreason_PayloadRace" "%s1 won the payload race"
"Winreason_ReactorCaptured" "%s1 won by capturing the enemy reactor core"
"Winreason_CoresCollected" "%s1 won by destroying robots and collecting power cores"
"Winreason_ReactorReturned" "%s1 won by defending their reactor core until it returned"
"Winreason_PlayerDestructionPoints" "%s1 won by collecting enough points"
"Winreason_ScoreLimit" "%s1 won by scoring %s2 times"
"Winreason_ScoreLimit_One" "%s1 won by scoring"
DoopieWop
Junior Member
Posts: 3
Joined: Thu Sep 22, 2022 9:41 pm

Re: TF2 Event Win Reasons

Postby DoopieWop » Fri Sep 23, 2022 2:19 am

Hmmm. I'm not sure if that's it. I tried to find a pattern, I only really found out that winreason 5 is for stalemate (i assume). There must be some other list.
DoopieWop
Junior Member
Posts: 3
Joined: Thu Sep 22, 2022 9:41 pm

Re: TF2 Event Win Reasons

Postby DoopieWop » Fri Sep 23, 2022 2:25 am

Ah I found it in the 2008 tf2 source code.
https://github.com/NicknineTheEagle/TF2 ... ules.h#L70

Code: Select all

enum {
   WINREASON_NONE =0,
   WINREASON_ALL_POINTS_CAPTURED,
   WINREASON_OPPONENTS_DEAD,
   WINREASON_FLAG_CAPTURE_LIMIT,
   WINREASON_DEFEND_UNTIL_TIME_LIMIT,
   WINREASON_STALEMATE,
};
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: TF2 Event Win Reasons

Postby L'In20Cible » Fri Sep 23, 2022 2:37 am

You can find the enumeration declaration in the SDK. However, I'm not sure how up-to-date it is, nor if it is complete. The translations files usually have the whole list that allows you to compare the index with the message, etc.

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 27 guests