"
Conversion - Convert Integer to Real" (aka
I2R) and "
Conversion - Convert Real to Integer" (aka
R2I) are the function you are looking for to set the number.
Hero - Modify Strength of (Triggering unit):
Set to (
R2I(
I2R(Attribute_of_hero) + 0.5)
What it does is basically this:
You convert attribute of hero (an integer) into real number. Then you add 0.5 to that number.
Doing just this:
Hero - Modify Strength of (Triggering unit): add R2I(0.5)
won't work imo. Afaik it will first convert the number into integer and then it will add that number to the unit. However converting 0.5 into integer is 0, so you end up adding nothing at all.
Edit:
I'm not even sure if the first one will work, because hero's attribute ingame is already an integer, so when the input is an integer, you cannot expect anything behind decimal point.
You would probably need to calculate how much of an attribute he should have.
To clarify:
Let's say hero's current Strength is equal to 39. When you do this:
-
Set IntegerVariable = (Strength of Unit)
-
Set RealVariable = (Conversion - Convert Integer to Real(Strength of Unit))
Both will return same number - 39 and 39.00 respectively. That is because the attribute itself is an integer number.
So doing this: 39.00 + 0.50 will get you 39.50, but after converting it back to integer, you will get 39 again.
If you set your hero in Object Editor like this:
Starting Strength = 20,
Strength per Level = 1.80;
then the ingame calculation for it is: Convert_to_Integer(Starting_strength + (Level * strength_per_level)).
For example at level 6 the calculation would be: Convert_to_Integer(20 + (6 * 1.80)) = conv_to_int (20 + 10.80)) = conv_to_int(30.80) = 30.
Now you probably want to round it up, so 30.8 would get rounded up to 31. That, however, requires you to somewhere save the "Starting Strength" and "Strength Per Level" manually. Then make trigger which fires when hero gains a level and you yourself will calculate how much Strength he is supposed to have.
-
Map Ini
-
Events
-

Map Initialization
-
Conditions
-
Actions
-

Set startStrength = 20.00
-

Set strengthPerLevel = 1.80
-
Calculation
-
Events
-

Hero gains level
-
Conditions
-

Triggering unit is your specified hero
-
Actions
-

Hero - Modify Strength of (triggering unit) set to (Convert Real to Integer((startStrength + (Convert Integer to Real(Level of unit) * strengthPerLevel) + 0.50)))
The above calculates the attribute. For example for the level 6 it would be: (20.00 + (6 * 1.8) + 0.50) => (20.00 + 10.80 + 0.50) => 31.30 => converted back to integer = 31.