Random Number in HUD?

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

Moderators: WhiteRider, kraada, Flag_Hippo, morny, Moderators

Re: Random Number in HUD?

Postby 4StarGen » Fri Mar 20, 2015 2:30 pm

I would suggest the same solution, but it doesn't work... the parser expect to hit the DB somewhere... but with the this expression we don't

Image
4StarGen
 
Posts: 940
Joined: Sat Mar 08, 2014 6:58 am

Re: Random Number in HUD?

Postby kraada » Fri Mar 20, 2015 3:37 pm

This validates:

(select random() from cash_hand_player_statistics chps where chps.id_hand = cash_hand_player_statistics.id_hand limit 1)
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Random Number in HUD?

Postby BillGatesIII » Sun Mar 22, 2015 6:52 pm

If you want the random number to be cached, you can use this expression.
Code: Select all
avg(case
  when cash_hand_player_statistics.id_hand > 1
  then random() * 100 - 50
  else null end)
Keep in mind you will not know the precise lower and upper boundaries.
BillGatesIII
 
Posts: 740
Joined: Fri Dec 16, 2011 6:50 pm

Re: Random Number in HUD?

Postby Chamie » Sun Jan 12, 2020 11:46 pm

Hi sorry to relive old thread... Im trying to do this but getting error saying the column cant be cached. Im naming it correctly and everything, whats wrong?

I just want a stat that is a randomizer 1-100
Chamie
 
Posts: 52
Joined: Sat Nov 29, 2008 8:52 pm

Re: Random Number in HUD?

Postby WhiteRider » Mon Jan 13, 2020 4:01 am

I'm not sure how a random number could be cached - wouldn't you want it to be different every time it was used?
WhiteRider
Moderator
 
Posts: 54017
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Random Number in HUD?

Postby Chamie » Mon Jan 13, 2020 1:22 pm

WhiteRider wrote:I'm not sure how a random number could be cached - wouldn't you want it to be different every time it was used?


Oh I see, yeah thats right. So Im just supposed to do the stat uncached, thanks!
Chamie
 
Posts: 52
Joined: Sat Nov 29, 2008 8:52 pm

Re: Random Number in HUD?

Postby Chamie » Mon Jan 13, 2020 1:36 pm

Ok I have some more questions. Should the stat be sat to everyone, hero only or table average? Also should it be stored as percent or number or something else?

The last question is if PT4 has a limit to how many stat groups that be visible on the table since I try to add new stat groups and they wont show.
Chamie
 
Posts: 52
Joined: Sat Nov 29, 2008 8:52 pm

Re: Random Number in HUD?

Postby Flag_Hippo » Tue Jan 14, 2020 6:51 am

Chamie wrote:Ok I have some more questions. Should the stat be sat to everyone, hero only

Depends on whether you want one random number displayed or multiple random numbers.
Chamie wrote:or table average?

No.
Chamie wrote:Also should it be stored as percent or number or something else?

You mean 'Format Type:'? If so that would probably be 'Number'.
Chamie wrote:The last question is if PT4 has a limit to how many stat groups that be visible on the table since I try to add new stat groups and they wont show.

I am not aware of a limit so please send all relevant information to us in a Support Ticket with your log file and HUD Profile attached:

Tutorial: Reporting A Problem
Flag_Hippo
Moderator
 
Posts: 15174
Joined: Tue Jan 31, 2012 7:50 am

Re: Random Number in HUD?

Postby claytonhamm » Wed Jan 29, 2020 12:48 pm

Chamie wrote:Hi sorry to relive old thread... Im trying to do this but getting error saying the column cant be cached. Im naming it correctly and everything, whats wrong?

I just want a stat that is a randomizer 1-100


Im having similar problems, I created the column fine but not really sure how to create the stat. What needs to be put in "value expression"?
claytonhamm
 
Posts: 5
Joined: Tue Apr 24, 2012 5:03 pm

Re: Random Number in HUD?

Postby Flag_Hippo » Thu Jan 30, 2020 2:36 am

claytonhamm wrote:I created the column fine but not really sure how to create the stat. What needs to be put in "value expression"?

Your custom column name goes there.
Flag_Hippo
Moderator
 
Posts: 15174
Joined: Tue Jan 31, 2012 7:50 am

PreviousNext

Return to Custom Stats, Reports and HUD Profiles

Who is online

Users browsing this forum: No registered users and 51 guests

cron
highfalutin