REAL custom values

Korolen

New User (Why do I keep getting those red bars?)
Reaction score
69
OK, with a trigger, you can set the "Custom Value" of a unit, but all you can set it to is an integer. I want to pair other values with the unit, also. Is the only way to do this, to create a list of that type, and set the list value of the custom value of the unit? If so, then how do you easily determin a custom value that is not in use? I can easily do this in a programming language like Python, and I can fugure a few possibilitys in JASS, but if there is an easier way (Wich I dowbt), then that would be most usefull :cool:
 
P

Persen

Guest
You can use a bunch of variables (WEU-style), or handle vars (recommended).

For handle vars, you'll need a game cache variable only.

I can't get the whole code right now...
 

Korolen

New User (Why do I keep getting those red bars?)
Reaction score
69
I can make all that stuff just fine, but the handle variables won't help me, as I can easily store values, I just want to be able to pair them up with a unit.
 

phyrex1an

Staff Member and irregular helper
Reaction score
447
Korolen said:
I can make all that stuff just fine, but the handle variables won't help me, as I can easily store values, I just want to be able to pair them up with a unit.

That is exactly what the handle variables does, + that it works good with almost every other object in wc3.

The 'easiset' way is to make the multiply the real with 10000 or something, depending on how many digdits you want. And the use real to integer and store it with the custom vaule.

The 'best' is to use any version of the handle variables.
 
H

Heptameron

Guest
If you are very adamant about not using handle variables (bad idea), you can use parallel arrays and store the index you care about in the unit's custom value. So it'd look something like "udg_UnitValueKills[GetUnitUserData(u)]" whenever you got something. And, of course, you'd need to figure out what happens when the unit dies.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top