Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google Log In with Steam Sign In
  • Create Account
Photo

KR/PRW Lua


Best Answer gaoesa, 24 September 2014 - 10:44 PM

Sorry, I didn't realize the field names were missing. I added them now. They are sess.overall_killrating and sess.rating for PRW. If you want them in the same format as they are in the scoreboard, the formula for kill rating is:

 

(1.0 / (1.0+exp(-(sess.overall_killrating*(1.0 / sqrt(1.0+sess.overall_killvariance*3.0/(M_PI*M_PI))))))) / (1.0 - (1.0 / (1.0+exp(-(sess.overall_killrating*(1.0 / sqrt(1.0+sess.overall_killvariance*3.0/(M_PI*M_PI))))))))

 

,where M_PI is 3.14159265358979323846

 

Maybe a bit clearer in Lua

function kill_probability(net, g_of_x_margin)
    return 1.0 / (1.0+math.exp(-(net*g_of_x_margin)))
end

function g_of_x(variance)
    local M_PI = 3.14159265358979323846
    return 1.0 / math.sqrt(1.0+variance*3.0/(M_PI*M_PI))
end

function GetKillRating
    local probability = kill_probability(rating,g_of_x(variance))
    return probability / (1.0f - probability)
end

No guarantees that the script works.

Go to the full post »


  • Please log in to reply
4 replies to this topic

#1
OFFLINE   TimOOn

TimOOn

    Newbie

  • Members
  • Pip
  • 7 posts
1
A step in the right direction

Hello,

 

Is it possible to access player's KR and/or PRW values by lua?



#2
OFFLINE   gaoesa

gaoesa

    Advanced Member

  • Management
  • PipPipPipPip
  • 4391 posts
341
Will become famous
  • LocationFinland

Yes. Use this http://mygamingtalk....Lua#gentity_get



#3
OFFLINE   TimOOn

TimOOn

    Newbie

  • Members
  • Pip
  • 7 posts
1
A step in the right direction

OK, and what fieldname should I use?



#4
OFFLINE   gaoesa

gaoesa

    Advanced Member

  • Management
  • PipPipPipPip
  • 4391 posts
341
Will become famous
  • LocationFinland
✓  Best Answer

Sorry, I didn't realize the field names were missing. I added them now. They are sess.overall_killrating and sess.rating for PRW. If you want them in the same format as they are in the scoreboard, the formula for kill rating is:

 

(1.0 / (1.0+exp(-(sess.overall_killrating*(1.0 / sqrt(1.0+sess.overall_killvariance*3.0/(M_PI*M_PI))))))) / (1.0 - (1.0 / (1.0+exp(-(sess.overall_killrating*(1.0 / sqrt(1.0+sess.overall_killvariance*3.0/(M_PI*M_PI))))))))

 

,where M_PI is 3.14159265358979323846

 

Maybe a bit clearer in Lua

function kill_probability(net, g_of_x_margin)
    return 1.0 / (1.0+math.exp(-(net*g_of_x_margin)))
end

function g_of_x(variance)
    local M_PI = 3.14159265358979323846
    return 1.0 / math.sqrt(1.0+variance*3.0/(M_PI*M_PI))
end

function GetKillRating
    local probability = kill_probability(rating,g_of_x(variance))
    return probability / (1.0f - probability)
end

No guarantees that the script works.



#5
OFFLINE   TimOOn

TimOOn

    Newbie

  • Members
  • Pip
  • 7 posts
1
A step in the right direction

Thanks a lot. This is perfect!

Script works fine.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users