• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Round down system

Status
Not open for further replies.
Level 18
Joined
Aug 23, 2008
Messages
2,319
I want to make a system that rounds down a number to a full number. I got these statistical Integer values and want to calculate a stat with it. For example: 'Magic Defense = 20 + (0.3 * (Level of Unit))'. At for example level 12, you'd have 'Magic Defense = 20 + (0.3 * 12) = 23.6'. In this case, I want Magic Defense to be 23. Even at e.g. level 13 (resulting in 23.9), I want it to come out as 23. Is there any way to set the digits behind the comma to 00, or another way to round down this?


EDIT: Just got a solution through chat.
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
With INTEGERS? that makes no sense whatsoever.

Think before you post... Especially if you realise that it doesn't make sense.
If I'm talking about floating points, I'm obviously talking about warcraft 3 REALS, not INTEGERS. Especially when I'm replying to someone who's saying
So always use reals in counting, they have 3 numbers after comma.

He makes it sound like warcraft reals are implemented as fixed point reals, instead of floating point reals...
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
First of all: I'm 100% GUI except for leaks. If I ever need JASS because it's a requirement for my map and there's no way to do it in GUI, I ask a JASSer.

Second of all: If I'd have to put that in my trigger for 8 main playable characters and 3 temporary characters, doing that for 9 attributes each, I'd have to do that 99 times! I'd rather do it with just 1 GUI line. It's a bit faster ^^
 
Status
Not open for further replies.
Top