Specific stat for specific player

Discuss how to create custom stats, reports and HUD profiles and share your creations.

Moderators: WhiteRider, kraada, Flag_Hippo, morny

Specific stat for specific player

Postby CygNu5X1 » Sat Jan 15, 2022 8:08 am

Hello,

I would like to know if it is possible to create a custom statistic (or a custom HUD profile) that would show a specific static text for a specific player based on their nickname.
For example:

For player1 whose nickname is "Bob" it would show in the HUD box "Bob is a nice guy"
For player2 whose nickname is "Rose" it would show in the HUD box "Rose is a fish"
For player3 whose nickname is "John" it would show in the HUD box "this guy is really weird and probably a nit"

Basically, this can be achieved by using the "note" button in the HUD, but the problem is I have to click it to display the info, it is not present on the screen for all the players all the time.

Is this possible in PT4 and if yes, how can I achieve this please?

Thanks!
CygNu5X1
 
Posts: 6
Joined: Sat Jul 21, 2018 12:03 pm

Re: Specific stat for specific player

Postby Flag_Hippo » Sun Jan 16, 2022 6:56 am

Duplicate the existing 'Player' statistic and use this expression in the 'Format Type:' field:

Code: Select all
if(this = 'Bob', format('Bob is a nice guy'), if(this = 'Rose', format('Rose is a fish'), if(this = 'John', format('this guy is really weird and probably a nit'), ignore_formatting(this))))

For further information see this guide for the basics on custom statistics creation and this guide for a deeper walkthrough. The latter was written for PokerTracker 3 but the techniques all apply to PokerTracker 4, the interface is just slightly different.
Flag_Hippo
Moderator
 
Posts: 12063
Joined: Tue Jan 31, 2012 7:50 am

Re: Specific stat for specific player

Postby CygNu5X1 » Sat Feb 05, 2022 9:38 am

Flag_Hippo wrote:Duplicate the existing 'Player' statistic and use this expression in the 'Format Type:' field:

Code: Select all
if(this = 'Bob', format('Bob is a nice guy'), if(this = 'Rose', format('Rose is a fish'), if(this = 'John', format('this guy is really weird and probably a nit'), ignore_formatting(this))))

For further information see this guide for the basics on custom statistics creation and this guide for a deeper walkthrough. The latter was written for PokerTracker 3 but the techniques all apply to PokerTracker 4, the interface is just slightly different.


Hello,

Thanks for your reply, it works exactly like I needed!

I have a few more questions regarding this problem.

1. Lets say we use the solution you proposed, but in the displayed text (for example "Bob is a nice guy") we also want to show a statistic from our database. Is this possible, and if so, how can I do it please? Example:
"Bob is a nice 25 guy" where "25" is bobs VPIP for example.

2. Is there an option to display this text if the player name is defined in those "if" statements, but show a regular HUD (statistics from our DB) if the condition is not met, IE if the player name is NOT on the list in those "if" statements?

3. Is there an option to format the text that I want to assign to a specific player? For example, if the text is "Bob is a nice guy" can I make the word "Bob" red? Same question applies for the statistics in question number 1 /if it is possible, of course/.

Thank you so much, you are very helpful!
CygNu5X1
 
Posts: 6
Joined: Sat Jul 21, 2018 12:03 pm

Re: Specific stat for specific player

Postby WhiteRider » Sat Feb 05, 2022 11:26 am

1.
Take a look at the "format" function described here.

If you replace:
format('Bob is a nice guy')
..with something like:
format('Bob is a nice guy {1}', STAT-EXPRESSION)
..that should give you what you want.

For example:
format('Bob is a nice guy {1}', ((cnt_vpip / (cnt_hands - cnt_walks)) * 100))

Actually, that will probably give you 25.000000 or something, so you will likely need to format the number too, like:

format('Bob is a nice guy {1}', format_number((cnt_vpip / (cnt_hands - cnt_walks)) * 100,2,false,false))

format_number is explained in the same guide linked above.

2. Yes. To do that replace:
ignore_formatting(this)
..with whatever stat expression you want.
That is the final "else" case of the "if", so will be used if none of the names match.

3. No, you can't colour parts of the text.
WhiteRider
Moderator
 
Posts: 53718
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Specific stat for specific player

Postby CygNu5X1 » Sat Feb 05, 2022 5:22 pm

WhiteRider wrote:1.
Take a look at the "format" function described here.

If you replace:
format('Bob is a nice guy')
..with something like:
format('Bob is a nice guy {1}', STAT-EXPRESSION)
..that should give you what you want.

For example:
format('Bob is a nice guy {1}', ((cnt_vpip / (cnt_hands - cnt_walks)) * 100))

Actually, that will probably give you 25.000000 or something, so you will likely need to format the number too, like:

format('Bob is a nice guy {1}', format_number((cnt_vpip / (cnt_hands - cnt_walks)) * 100,2,false,false))

format_number is explained in the same guide linked above.

2. Yes. To do that replace:
ignore_formatting(this)
..with whatever stat expression you want.
That is the final "else" case of the "if", so will be used if none of the names match.

3. No, you can't colour parts of the text.


Hello,

thanks, you helped me a lot!

Hopefully last question:
I used the formatting where I put format('Some text and {1} stat ', format_number((cnt_f_cbet_fold_to_raise / cnt_f_cbet_face_raise) * 100,0,false,false))
This statistic is a stat for Fold to raise after Flop cbet and I need IP and OOP variants, in my HUD I just set it in the HUD creator as IP and OOP on the flop, but not sure how to do it here.
Any idea how to do that?

THX!
CygNu5X1
 
Posts: 6
Joined: Sat Jul 21, 2018 12:03 pm

Re: Specific stat for specific player

Postby WhiteRider » Sat Feb 05, 2022 6:29 pm

If you set the Value Expression of the stat to be the normal expression (ie. "cnt_f_cbet_fold_to_raise / cnt_f_cbet_face_raise) * 100") then I believe that you should be able to set the in/out of position property as normal.

If you need the value expression to be something else then you would need to make in/out of position versions of the stat.
For 'has position' the database field you need is:
cash_hand_player_statistics.flg_f_has_position
This is true if the player is last to act on the flop, and false otherwise. There are turn and river versions of this too.

Guide: How to make a new version of a stat
WhiteRider
Moderator
 
Posts: 53718
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK


Return to Custom Stats, Reports and HUD Profiles

Who is online

Users browsing this forum: No registered users and 2 guests

cron
highfalutin