Page 1 of 1

Specific stat for specific player

PostPosted: Sat Jan 15, 2022 8:08 am
by CygNu5X1
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!

Re: Specific stat for specific player

PostPosted: Sun Jan 16, 2022 6:56 am
by Flag_Hippo
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.

Re: Specific stat for specific player

PostPosted: Sat Feb 05, 2022 9:38 am
by CygNu5X1
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!

Re: Specific stat for specific player

PostPosted: Sat Feb 05, 2022 11:26 am
by WhiteRider
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.

Re: Specific stat for specific player

PostPosted: Sat Feb 05, 2022 5:22 pm
by CygNu5X1
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!

Re: Specific stat for specific player

PostPosted: Sat Feb 05, 2022 6:29 pm
by WhiteRider
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