Add Strength as decimal

Weyrling

New Member
Reaction score
25
Integer, as known by a computer, is a whole number, meaning no decimals, it doesn't matter what humans perceive it as, a computer perceives it as no decimals.
 

Choppa

www.warcraft-gamers.po.gs
Reaction score
59
Integer, as known by a computer, is a whole number, meaning no decimals, it doesn't matter what humans perceive it as, a computer perceives it as no decimals.

Actually, an integer ANYWHERE is a whole number, the only thing different about an integer with humans and computers is I guess... Integer and long integer.
 

The Undaddy

Creating with the power of rage
Reaction score
55
You can always store the bonus str into a real variable,and when it goes higher than one,subtract one and add it to the hero's base str :rolleyes:
 

warroom99

New Member
Reaction score
15
> when it goes higher than one

Actually, you can just add it as is.
Any decimals will be cut off anyway from converting to integer.
you mean to add a decimal to the hero attribute we need to use jass?

is that the only way?
 

rodead

Active Member
Reaction score
42
no like if the number is 1.45 the number will be cut off to 1 and if the umber is 1.55 it wil automaticly cut off to 2 so it stores it into a integer what acehart said!
 

Choppa

www.warcraft-gamers.po.gs
Reaction score
59
no like if the number is 1.45 the number will be cut off to 1 and if the umber is 1.55 it wil automaticly cut off to 2 so it stores it into a integer what acehart said!

Lol no cutting off doesn't mean rounding...

Real to Integer conversion
1.12 = 1
1.43 = 1
1.94 = 1

2.4 = 2
2.8 = 2
etc.
 

Choppa

www.warcraft-gamers.po.gs
Reaction score
59
the WE doesnt round off correctly?

it only gets the whole integer(even if it has a decimal)?

No, WE is fine, converting and rounding are two different things, in computer programming rounding a number is usally a function in it's self...
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
with items you can add decimals mabye....
i think you could take the strenght book stat ability and use it on the hero to increase his strenght by decimals but im not sure if it might work thought you should try and see
 

NetherHawk

New Member
Reaction score
26
so manmy pages i dint bother reading but, if you want to add strength in decimels, for example every time killing a unit add 0.07 str, use a real variable. Every time u kill a unit, add 0.07 to the variable. when it reaches 1, add 1 str to the hero, minus 1 from the variable.
 

Choppa

www.warcraft-gamers.po.gs
Reaction score
59
OK, I made something that rounds real numbers off, rather then cuts off the decimals... I don't know why I made it, Lol. I'll post it up soon...
 

Choppa

www.warcraft-gamers.po.gs
Reaction score
59
Ok here it is, uses two variables I think... Can't remember lol, i'm tired it's 11pm...

HOW TO USE:
IN GAME TYPE "set int4 (plus a number)" e.g set int4 213 this will make the number 213.45 {lower then 0.5}
OR
IN GAME TYPE "set int5 (plus a number)" e.g set int5 213 this will make the number 213.65 {higher then 0.5}
THEN TYPE "round" TO SHOW THE ROUNDED NUMBER

Made by Choppa
 

Attachments

  • RoundNumberOff.w3x
    13.6 KB · Views: 201

Somatic

You can change this now in User CP.
Reaction score
84
What you want is Dota's Flesh Heap

Let me give you an easier idea of how to do this

Code:
Hidden Potential
    Events
        Unit - A unit Dies
    Conditions
        (Level of Hidden Potential for (Killing unit)) Not equal to 0
        ((Dying unit) is A structure) Not equal to True
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Dying unit) is A Hero) Equal to True
            Then - Actions
                Set HiddenPotentialGrowth[(Player number of (Owner of (Killing unit)))] = (HiddenPotentialGrowth[(Player number of (Owner of (Killing unit)))] + (0.30 x (Real((Level of Hidden Potential for (Killing unit))))))
            Else - Actions
                Set HiddenPotentialGrowth[(Player number of (Owner of (Killing unit)))] = (HiddenPotentialGrowth[(Player number of (Owner of (Killing unit)))] + (0.03 x (Real((Level of Hidden Potential for (Killing unit))))))

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        (HiddenPotentialGrowth[(Player number of (Owner of (Killing unit))) Greater than or equal to 1.00
    Then - Actions
        Hero - Modify Strength of (Killing unit): Add 1
        Set (HiddenPotentialGrowth[(Player number of (Owner of (Killing unit))) = ((HiddenPotentialGrowth[(Player number of (Owner of (Killing unit))) - 1.00)
    Else - Actions

This works if this skills is only on 1 unit for each player.
 

NetherHawk

New Member
Reaction score
26
dont see why this had to go on for 3 pages. -.-

anyway choppa, dosnt converting real to integers automatically round them off? -- i could be wrong judging from ace's answer.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top