• 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.

The -ms command (how to get rid of decimal points?)

Status
Not open for further replies.
Level 30
Joined
Jan 31, 2010
Messages
3,552
There is no option of converting reals to integers. Here's my trigger:
  • Movespeed
    • Events
      • Player - Player 2 (Blue) types a chat message containing -ms as An exact match
      • Player - Player 3 (Teal) types a chat message containing -ms as An exact match
      • Player - Player 4 (Purple) types a chat message containing -ms as An exact match
      • Player - Player 6 (Orange) types a chat message containing -ms as An exact match
      • Player - Player 7 (Green) types a chat message containing -ms as An exact match
      • Player - Player 8 (Pink) types a chat message containing -ms as An exact match
    • Conditions
    • Actions
      • Set tempGroup = (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))
      • Unit Group - Pick every unit in tempGroup and do (Actions)
        • Loop - Actions
          • Game - Display to (Player group((Triggering player))) the text: (PlayerColors[(Player number of (Triggering player))] + ((Name of (Picked unit)) + (|r movement speed is + (String((Current movement speed of (Picked unit)), 7, 2)))))
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
This problem rises due to the fact that you chose Real to become your data transmission variable

You should use Integer variable to transmit the data (appear on the screen)

The default function of calculating Movement Speed of a unit is in Real data, that's why you should first use Integer, then convert it to Real

This way, you will remove the decimal place (because Integer does not contain any fractional parts/points) because it is a whole number
 
Status
Not open for further replies.
Top