Multiply with Integer

nicolas

New Member
Reaction score
2
I got this trigger where i have to get 25% of a hero's strenght so i made a trigger for it:

set (Variable_Integer X (1)) = Strenght of the unit

Now i want 25% of that strenght but the probleme is the following:

(So the next action):

Set (Variable_Integer X (2))) = (Arithmetic) (Variable_Integer) (1)) x !!Should be 0.25!!


So what the probleme is is that i cant multiply the integer i can only multiply it by 1 or 2 or 3 and so on but it wont do numbers with . in it so no 0.5 or 1.5 or what i actally need 0.25

So can anyone help me to get this right:)
 

trb92

Throwing science at the wall to see what sticks
Reaction score
142
Change to variable to type Real instead of Integer to do this. Real numbers are numbers such as 1.3, 0.742, and the 0.25 that you need.
 

Romek

Super Moderator
Reaction score
964
Set Integer2 = integer1 / 4
Arithmetic.
If the number needs decimal points, use real.
 

MoonSlinger

I Love using Cheap Tricks... only Results matters
Reaction score
74
two ways to handle the situation:

First, you can try conversion 'Real to Integer' and "Integer to Rea"
- Something like Integer(Real(Strength) X 0.25)

Next way is simply use division instead.
- Strength x 0.25 = Strength / 4

Edit:
Lost by a min :( and to so many
 

nicolas

New Member
Reaction score
2
Thx guys ofc stupid i didnt think of that myself /4 -_- seems my missing of math lessons start paying of
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top