• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

move speed as real

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
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