HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Native Integer Attachment

12-12-2009, 11:59 PM#1
TriggerHappy
Not really, but it works.

Yes, I benchmarked it and it's about the same speed as hashtables. With less functionality ofc.
The only sideeffects I could see are if the index is a tech-id.

I don't expect (or suggest) this to be used, I just thought it was neat. Oh and there are other Player-Tech natives that allow you to store/get.
These were just the fastest.

Collapse JASS:
library test

    globals
        player IDLE_PLAYER = Player(PLAYER_NEUTRAL_AGGRESSIVE)
    endglobals

    function HoldInteger takes integer index, integer value returns nothing
        call SetPlayerTechMaxAllowed(IDLE_PLAYER, index, value)
    endfunction

    function GetHeldInteger takes integer index returns integer
        return GetPlayerTechMaxAllowed(IDLE_PLAYER, index)
    endfunction

endlibrary
12-13-2009, 08:18 AM#2
DioD
more then useless, just boundless array.
12-13-2009, 11:37 AM#3
TheKid
Quote:
Originally Posted by DioD
more then useless, just boundless array.

Are you sure you don't mean "less than useless"? More than useless doesn't make a whole lot of sense. I really don't see why people post in these forums to give this kind of feedback. DioD your reply to his useless thread is useless in itself.

For a beginner, the concept displayed here could be used as a useful learning tool, so you're really out of place in saying its useless DioD.
12-13-2009, 03:00 PM#4
DioD
Use hashtables

Be happy

Dont troll on forums
12-13-2009, 03:15 PM#5
Rising_Dusk
Quote:
Originally Posted by TheKid
For a beginner, the concept displayed here could be used as a useful learning tool, so you're really out of place in saying its useless DioD.
No, I mean, it is useless. We have hashtables, which have 2 keys instead of one, and have no chance of conflict with some player state. This is inferior.
Quote:
Originally Posted by TheKid
Are you sure you don't mean "less than useless"?
He's Russian, and his English isn't perfect, so get off his balls for it. You knew what he meant, you're a smart bucko.
12-13-2009, 03:46 PM#6
ploks
Useless or not it is quite funny!
12-13-2009, 06:16 PM#7
TriggerHappy
Quote:
Originally Posted by Original Post
Yes, I benchmarked it and it's about the same speed as hashtables. With less functionality ofc.
The only sideeffects I could see are if the index is a tech-id.

I don't expect (or suggest) this to be used, I just thought it was neat. Oh and there are other Player-Tech natives that allow you to store/get.
These were just the fastest.

I know it's useless. Doesn't mean it's not neat.
12-15-2009, 01:41 AM#8
TheKid
Which is why it wasn't posted in the submissions, rather the Triggers & Scripts. A beginner may not understand how Hashtables works, in which case allowing them to begin with alternate means of integer attaching could be beneficial to their learning.

Quote:
Originally Posted by TriggerHappy
I don't expect (or suggest) this to be used

Even aside from this dumb argument, why would DioD need to comment on the quality/usefulness of this when TriggerHappy already agrees with him. That's just plain bad manners... has this site ever gotten unfriendly to the common folk. Everybody is on the moderators balls though.

Quote:
Originally Posted by Rising_Dusk
so get off his balls for it

You just make yourself sound less credible by talking like this.

I'm not even going to continue arguing, so pathetic lmao.
12-15-2009, 03:01 AM#9
chobibo
Diod was stating a fact, he meant no disrespect, nor did Rising Dusk. Even TriggerHappy admitted it was useless, he was just showing that it was a possibility, which is cool(?).
12-15-2009, 10:07 PM#10
DioD
Hold a moment...

DID you test this?

Code:
    call HoldInteger(50,25)
    call DisplayTextToForce( GetPlayersAll(), I2S(GetHeldInteger(50)) )

returns 0
12-16-2009, 01:32 AM#11
weaaddar
You need to use a valid technology.
12-16-2009, 03:12 AM#12
TriggerHappy
No you don't. I accidentaly posted the wrong version.

Updated.
12-16-2009, 08:08 AM#13
Anachron
Ehrm, what is this?