"Every Ten" script?

Post » Thu Jul 12, 2012 6:30 am

Hi, I was wondering if anyone could help me work out a script?

I want to count every ten "points" that the Player gains, and then add 1 "Bonus" for each "Point".

So, for example:
Player has 10 Strength = They have 1 Bonus
Player has 19 Strength = The have 1 Bonus
Player has 20 Strength = They have 2 Bonuses

I could do it by hand, but in the final Mod I'm expecting the Player to have 1000s, so it would be a LOT to code in.

I was thinking something like:
float Temp01Short Temp02Set Temp01 to ( Player.GetAV Strength )Set Temp01 to ( Temp01 /10 )Set Temp02 to Temp01Which using "10" for strength should be...Set Temp01 to 10Set Temp01 to ( 10 / 10 ) = 1Set Temp02 to 1And using "19" for strength should be...Set Temp01 to 19Set Temp01 to ( 19 / 10 ) = 1.9Set Temp02 to 2 (Assuming round-up on Shorts over .5)

Any ideas how I could get it to do what I want? Or to always make it round-down?
User avatar
Amy Gibson
 
Posts: 3540
Joined: Wed Oct 04, 2006 2:11 pm

Post » Thu Jul 12, 2012 7:49 am

You'd probably find the http://obse.silverlock.org/obse_command_doc.html#Math_Functions useful.
User avatar
R.I.P
 
Posts: 3370
Joined: Sat Dec 01, 2007 8:11 pm


Return to IV - Oblivion