custom stat didn't import well

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

Moderators: WhiteRider, kraada, Flag_Hippo, morny, Moderators

custom stat didn't import well

Postby pasita » Fri Jul 20, 2012 4:53 pm

A custom stat (that I imported in working form from PT3) fails, I get a red error in both hud and a report. Here's a clip from log showing the error text:
2012/07/20 23:28:34.760 [00020]: [0000FC54][QueryExpression (Error)] Query: Cash Player/Replayer - 6 max - Cash-Cash - repl1 Exception: Expression: Parameters on the left and right side of an operation must be compatible (there are 8 of these messages in the log on a table with 4 players showing the stat, so 2 messages per player).

My stat's value expression is

if (var_live_players=3 or var_live_players=4,format('3-4 ',format_number(cnt_hands_34handed,0,false,false)),
(if (var_live_players=5 or var_live_players=6,format('5-6 ',format_number(cnt_hands_56handed,0,false,false)),
(if (var_live_players>6,format('7+ ',format_number(cnt_hands_710handed,0,false,false)),
format('Any ',format_number(cnt_hands,0,false,false))
)))))

and the columns are like
sum(if[cash_hand_player_statistics.id_hand > 0 and (cash_hand_summary.cnt_players = 3 or cash_hand_summary.cnt_players = 4) , 1, 0])

All of this validates in PT4 (and worked fine in PT3). Any ideas how to fix?
pasita
 
Posts: 605
Joined: Tue May 06, 2008 4:05 pm

Re: custom stat didn't import well

Postby kraada » Fri Jul 20, 2012 5:24 pm

That's odd - could you attach that stat to a support ticket for us so that we could look into it? The stat and column look fine and I even double checked that your parentheses match.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: custom stat didn't import well

Postby pasita » Fri Jul 20, 2012 9:01 pm

I created a simple hud in which the problem is shown, I also reduced the stat to a minimum. Same thing happens if I use the value expression instead of format expression. For some reason I was forced to use PT3 version numbering when creating the ticket (EDIT: #124133), please fix if possible.

value:
cnt_hands_34handed
format:
if (var_live_players=3 or var_live_players=4,format('3-4 ',format_number(this,0,false,false)),1)

Also (and this was a problem already with PT3): when I edit a stat, I haven't figured any other way to make the change effective in the replayer hud but to restart PT4. With PT3 I could start importing, stop hud, stop importing and re-open the replayer (there's a thread about it somewhere); at least with quick trial even that didn't work. Is there a documented way of making the change happen?
Note that this is about editing a stat, I believe editing the columns used by a stat work better.
pasita
 
Posts: 605
Joined: Tue May 06, 2008 4:05 pm

Re: custom stat didn't import well

Postby WhiteRider » Sat Jul 21, 2012 5:24 am

Your "format" expression has a parameter but nowhere to display it. You're giving it some data to display, but not telling it where to put it.

You need to include a marker for where to display the value you're trying to insert.
Use {1} in the format string to specify where the first value will be inserted. You only have one value here, which is: format_number(this,0,false,false)
..but if you had more values then you would also use {2}, {3}, etc.

Try this:

if (var_live_players=3 or var_live_players=4,format('3-4 {1}',format_number(this,0,false,false)),1)
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: custom stat didn't import well

Postby pasita » Sat Jul 21, 2012 9:50 am

Didn't work either. Please note that the stat worked in PT3 exactly the way it is. Also note that it was constructed by trial an error (try googling "format" for documentation :( )

I reduced the value expression to
cnt_hands (to make it a built in stat)
and format to
if (var_live_players=3 or var_live_players=4,1,0) (yeah, this makes no sense)

still the same "Exception: Expression: Parameters on the left and right side of an operation must be compatible"

Then I further reduced the format expression to
if (this < 100 or this >1000,1,0)

And now no error (obv the stat is meaningless too). So this might have to do with the live stats. Were there some problems with those? I should be able to use them in a replayer table without errors in PT4 also?
pasita
 
Posts: 605
Joined: Tue May 06, 2008 4:05 pm

Re: custom stat didn't import well

Postby WhiteRider » Sat Jul 21, 2012 10:09 am

Do you have variables with those names, which generate numeric answers?

Since you have a ticket open it will be easiest for us to get back to you there. Please bear with us as we're very busy with preparations for the PT4 launch at the moment.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: custom stat didn't import well

Postby pasita » Sat Jul 21, 2012 6:59 pm

Those were imported from PT3 where they worked, var_live_players was defined as live_table_stat( 'cnt_players').
Seems that someone else ran into a similar problem at https://www.pokertracker.com/forums/vie ... rs#p210536
So this wont work in PT4.

btw, when I try to validate the variable, I get the Invalid Expression dialog but with only PT4 logo in the body of the dialog, no text.

When trying to set up a new variable with expression live_cash_table.cnt_players it fails to validate. Also can't use that inside the value expression of a statistic.
Seems that I can use it as a value expression for a column but haven't figured out how to use it in a sensible way.

So I guess what I'm asking is: how do I pull up the live number of players in a variable so I can use it like in PT3?
pasita
 
Posts: 605
Joined: Tue May 06, 2008 4:05 pm

Re: custom stat didn't import well

Postby kraada » Sun Jul 22, 2012 9:33 am

You should be able to set up a Column that uses live_cash_table.cnt_players - that works for me. If you do that then refer to the Column in your stat that should work.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: custom stat didn't import well

Postby pasita » Sun Jul 22, 2012 10:17 am

I have a column "cnt_players_live", the expression is live_cash_table.cnt_players.
I have a stat where the value expression is "cnt_players_live".

When I try to display the stat in the hud, nothing gets displayed. (If I have other stats in the hud too, my stat is shown as "-" , there's even not a tooltip on that.)
What get's in the log is
; Reason: Fatal Error (ERROR: syntax error at or near "{" LINE 1: ...id_limit) AND live_cash_player.id_live_table = {live_tabl... ^ )
The same with a live table or a replayer table.

I believe it's pointing to "AND live_cash_player.id_live_table = {live_table_id}". Is there supposed to be a variable by that name, or is it something you handle internally?

If you have a working stat, using the live count of players, that can be displayed in the hud, could you please post it here? I could try to work from there.
pasita
 
Posts: 605
Joined: Tue May 06, 2008 4:05 pm

Re: custom stat didn't import well

Postby kraada » Sun Jul 22, 2012 11:49 am

That should work - could you please export that stat and attach it plus the log file to a support ticket for me and PM me the ticket number? I'll make sure this gets looked into - I think {live_table_id} is something we have internally to refer to the table in question. Do you have any problem with the built in live stats?
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Next

Return to Custom Stats, Reports and HUD Profiles

Who is online

Users browsing this forum: No registered users and 2 guests