Your simplified scaling is nice, but won't work for me for the reasons specified above. I want the amount to scale per level to be calculated on a number of variables, and upon changing the variables I don't want to need to alter the formula.
I need Something that uses the Following Variables
StartSize - The size of the hero at level 1. it's a percentage times 100. 100 is default scale - It would be nice if this could take in whatever size I have set in the object editor somehow. The I can have it start from a different size depending on the unit
EndSize - The size we want him to grow to over however many levels a hero can get
CurrentLevel - Current Level of the hero. used to calculate what amount of the MaxSize to apply to the hero
MaxLevel - The Max level used in the map. If someone can make this actually use the customdata specifiec in the map without rewriting it into the variable that would be nice.
Scaler - This is just a variable to hold the answer.
If someone can adjust my formula to use the variables to better create the effect I'm looking for it would help alot.
Sidenote, I'm adjusting movement speed by the same amount. is there a way to access the default movement speed of a unit instead of what it's currently set to?
JASS:
//variables
local real scaler //the number to set the scale to in setunitscalepercent()
local integer maxlevel
local integer currentlevel
local real startsize
local real finalsize
//This formula assumes you're starting scaled at 100% To use another number I have no idea, and I don't want to try to figure it out right now. too much math.
set scaler=StartSize-(1/(maxlevel-1)*StartSize)+((I2R(currentlevel))*(finalsize-StartSize)/(maxlevel-1))
Here are some examples as to how the current formula works out.
CurrentLevel=10
MaxLevel=10
FinalSize=200
StartSize=100
scaler=100-(1/(10-1)*100)+((I2R(10))*(200-100)/(10-1)
scaler=100-(1/(9)*100)+(10)*(100)/(9)
scaler=100-(100/9)+(1000/9)
200=100-11.1~+111.1~ YAY!
StartSize=150
scaler=150-(1/(10-1)*150)+((I2R(10))*(200-150)/(10-1)
scaler=150-(150/(9))+(10)*(50)/(9)
199.8~=150-(16.6~)+(55.5~)YAY!(Close enough that I'm happy)
StartSize=90
scaler=90-(1/(10-1)*90)+((I2R(10))*(200-90)/(10-1)
scaler=90-(90/(9))+(10)*(110)/(10-1)
scaler=90-(10)+(122.2~)Boo!
222.2~=80+122
StartSize=80
scaler=80-(1/(10-1)*80)+((I2R(10))*(200-80)/(10-1)
scaler=80-(1/(9)*80)+(10)*(120)/(9)
scaler=80-(80/(9))+(1200)/(9)
204=80-(8.8~)+(133.3~) BOO!
StartSize=30
scaler=30-(1/(10-1)*30)+((I2R(10))*(200-30)/(10-1)
scaler=30-(30/9)+(1700)/(9)
215=30-(3.3~)+(188.8~) Boo!
StartSize=100
Maxlevel=30
scaler=100-(1/(30-1)*100)+(30)*(200-100)/(30-1)
scaler=100-(100/29)+(3000/29)
~106.89=100-(3100/29)
SHIT
Apparently my formula only works at all if the maxlevel is 10. Can someone help me?
Conditions the formula needs to meet. (which my formula does not)
If CurrentLevel=Maxlevel, scaler = FinalSize
If CurrentLevel=1, scaler = StartSize
it should not matter what startsize, finalsize, or maxlevel are.