• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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

Status
Not open for further replies.
Level 30
Joined
Jan 31, 2010
Messages
3,551
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