HandleVars == BJ ?

--Thanatos--

New Member
Reaction score
33
It's so damn short. >_>
So I guess we can replace GetHandleInt and etc with it's main use, isn't it ?
 

Waaaaagh

I lost all my rep and my title being a jerk
Reaction score
70
Umm... sure. I mean, I write my own functions... yes. I don't use handle attaching, just id storing. Just store H2! on the handle, and then write a function to get exactly what you stored (that's how I do it). I have a weird method I guess...

JASS:
...
call StoreInteger(GameCache(),I2S(H2I(timer)),"Unit1",H2I(unit))
...

function T_Unit1 takes timer t returns unit
    local integer i=GetStoredInteger(GameCache(),I2S(H2I(t)),"Unit1")
    if(i!=0)then
        return i
    endif
    return null
endfunction
 

Cohadar

master of fugue
Reaction score
209
So many hacks just to avoid my Ultra-Giga-Mega-Uber system
that does not have that "Unit1" issue.

EDIT:

also

I2S() equals:
Code:
for i=0 to NumberOfDigits
    tmpstring(i) = number mod 10
    number = number / 10
endfor
think about it...
 

Waaaaagh

I lost all my rep and my title being a jerk
Reaction score
70
Actually, I enjoy being able to attach Unit2 to the handle as well. So that, should I, say, use:

JASS:
function T_Unit2 takes timer t returns unit
    local integer i=GetStoredInteger(GameCache(),I2S(H2I(t)),"Unit2")
    if(i!=0)then
        return i
    endif
    return null
endfunction


I can have TWO UNITS! (Rather than only one)


I2S is extremely taxing, yes, but I enjoy its versatility, and therefore continue to use it.
 

Vexorian

Why no custom sig?
Reaction score
187
I2S is extremely taxing,

It isn't.

for i=0 to NumberOfDigits
tmpstring(i) = number mod 10
number = number / 10
endfor

you tend to jump into conclussions, do you?

It's so damn short. >_>

It isn't, it is full of nonsense including return bug which is impossible to read.

Umm... sure. I mean, I write my own functions... yes. I don't use handle attaching, just id storing. Just store H2! on the handle, and then write a function to get exactly what you stored (that's how I do it). I have a weird method I guess.

You got a terrible method.

--
I mean, any attempt to speed up handle vars by making the thing less readable or over-complicating everything is terrible. It is totally useless since gamecache will always be very slow, so much that removing a function call is not effective as an optimization, and besides, gamecache's ways require you to ship at least 2 functions which makes going low-level ineffective distribution-wise ...
 

Cohadar

master of fugue
Reaction score
209
So Vexorian what should we use for attaching "things" to handles ...

you tend to jump into conclussions, do you?

Yes I really do... I need to better myself...
I go bang my head some more:banghead:
 

Cohadar

master of fugue
Reaction score
209
Well I am using structs - HEAVILY
Abusing is better word.

But it does not help when you need to attach a handle to a timer.

So I made my little System where I use global recycling array for attaching structs , and I called it a system because it uses functions and
a moderately complicated hash algorithm to do it.

And people say oh it's just shitty recycling array I do it also...
Yes you do it biach, just 8192 times slower.


To Waaaaaaargh:
I will expand the system function set to allow attaching
up to 3 "things" on a handle.
If you say you need more than that...
I will find you and give you a very very slow death...
 

Waaaaagh

I lost all my rep and my title being a jerk
Reaction score
70
I use gamecache because of its infiniteness. Currently, I am working on a system that could need anywhere from 104+ handles attached to a single object. If your system does that... well then, I'll use it.
 

Cohadar

master of fugue
Reaction score
209
Are you sure you are not doing something really really wrong?

If you are sure you need 104+ attachments on a handle
will you please explain me what are you making
and what is it supposed to do,
It might help me to better my system,
and in the same time provide a nice solution for you.
 

Waaaaagh

I lost all my rep and my title being a jerk
Reaction score
70
Bag. It is an item, which you can drop other items into. All those items are held under reference of the bag item (And some people would want a bag with 100+ items (although I would never do that)). Also, I have to store handling information for the bag - The unit that currently owns it, and a few dummy units used for temporary item storage (like when I open up a move item menu in the bag). So, we get 104, if you store 100 items in the bag. Of course, you could just as easily store 40,000, or just 12. It really needs an infinite range.
 

Cohadar

master of fugue
Reaction score
209
Loool I already made that one, and it uses only one handle.

I will give you the code if you promise not to publish it.

I made it for my new map that I am currently working on
so I don't want it spreading around until I finish it.

When I finish the map I will publish the code as a system.
 

--Thanatos--

New Member
Reaction score
33
> I mean, any attempt to speed up handle vars by making the thing less readable or over-complicating everything is terrible. It is totally useless since gamecache will always be very slow, so much that removing a function call is not effective as an optimization, and besides, gamecache's ways require you to ship at least 2 functions which makes going low-level ineffective distribution-wise ...

Then, how the hell... I'm using these to attach structs to things. What should I doooo ?
 

Cohadar

master of fugue
Reaction score
209
Bag. It is an item, which you can drop other items into. All those items are held under reference of the bag item (And some people would want a bag with 100+ items (although I would never do that)). Also, I have to store handling information for the bag - The unit that currently owns it, and a few dummy units used for temporary item storage (like when I open up a move item menu in the bag). So, we get 104, if you store 100 items in the bag. Of course, you could just as easily store 40,000, or just 12. It really needs an infinite range.

http://www.thehelper.net/forums/showthread.php?p=507236#post507236

I hope this helps.

EDIT:

sorry for double-posting,
I didn't realize I was the last one on the thread
 
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