Jump to content

Recommended Posts

Posted

Okay, this is kinda hard to explain, and the script itself is pretty long (I'll post anyway) so I'll do the best I can.

 

I have 5 GlobalVariables

-DropRate Common

-DropRate Uncommon

-DropRate Rare

-DropRate VeryRare

-Luck

 

Luck is a player stat that I'm making for my mod. The others are obviously global variables to be used on the drop tables. Now, with that out of the way, I need to know if it's possible to obtain the integer variable from luck, convert it to a float, then subtract that value from a DropRate global variables. Math isn't my strong point, and I have only been doing this for a little over a month, so I'm not sure where to go with this one. The method I am currently using does not work, as it results in negative values way too early, or doesn't make a difference enough to make Luck a stat worth going for. So, here's the script. Just search GetCommon() and it'll take you to the part in question. Thanks in advance.

 

 

  Reveal hidden contents

 

Posted

Internally all global variables are stored as floats. Thus instead of using GetValueInt to obtain the integer use GetValue to obtain the float.

 

i.e If you assign a GV the value of 15

GetValueInt will return 15

GetValue will return 15.0

Posted

Okay, with that knowledge, I can just take the Luck stat and call a GetValue() on it and divide it by 10 to get 1.5 which is much more acceptable than what I was using. Ishara for the win, once again!

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...