Author Topic: Need help with a Formula Please  (Read 1469 times)

Asegzamfire

  • Jr. Member
  • **
  • Posts: 70
    • View Profile
Need help with a Formula Please
« on: July 13, 2014, 10:41:44 AM »
Im having a bit of a hard time with the If in my formula, just not sure I use it correctly

assign("PtRebuy",(abs(nr-1)))
if(PtRebuy=0,1,if(r<=mr,(((n + tnr) - r  + 1 + nh + ((pw / pp) * (n+tnr))) * PtRebuy),((n + tnr) - r  + 1 + nh)*PtRebuy))

I think its just too long for nothing lol

What I need is 1 pts par rank, 1 pts per Kill and the players in the money get the %  of the prizes in points added to the rank and kill. My problem is with the rebuy, before that it was 1 pts for the rebuy. I want it to give Half of the pts they would have without rebuy.

Thanks for the help

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6220
    • View Profile
Re: Need help with a Formula Please
« Reply #1 on: July 31, 2014, 11:17:09 AM »
Been meaning to come back with a clear head and try to understand this formula.  I'm still not getting it.

So:

assign("PtRebuy",(abs(nr-1)))

PtRebuy is going to be, basically, one less rebuy than the player actually purchased.  Except in the case that the player purchased no rebuys, in which case PtRebuy will be "1".  (Which means PtRebuy will be "1" if the player bought 2 rebuys or 0 rebuys.)

Next,

if(PtRebuy=0, 1, ...

So, if the player bought 1 rebuy (in which case PtRebuy will be 0), then the player ends up with 1 point.  Otherwise, they get points from this formula:

if(r<=mr,(((n + tnr) - r  + 1 + nh + ((pw / pp) * (n+tnr))) * PtRebuy),((n + tnr) - r  + 1 + nh)*PtRebuy)

Which says if the player is "in the money", they get points from this:

(((n + tnr) - r  + 1 + nh + ((pw / pp) * (n+tnr))) * PtRebuy)

And if the player is NOT "in the money", then they get points from this:

((n + tnr) - r  + 1 + nh)*PtRebuy))

I'm not even trying to figure out those last two (yet).  I'm firstly confused by how PtRebuy is created.  Why the abs()?  And I guess, what's the overall goal?