• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

move speed as real

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
What is your problem?

You simply convert reals into integers. If the decimal values are needed you buffer them in a variable and only apply the whole numbers leaving the decimals off the actual movement speed but stored elsewhere.

When you get the speed its current speed + the buffer real (which sould equal exactly what you had before).

The native R2I(real) converts a real into an integer by simply ignoring all decimal places and making it a whole number (no rounding).
You do not need to convert integers into reals as WC3 lets you mix them with reals with no type problems (However a real value will be created).
 
Status
Not open for further replies.
Top