Hashtables - Few questions

Skippy

Active Member
Reaction score
39
Hi,
I am trying to learn how to use hashtables, but I am confused. Hashtable functions are not in the function list in NewGen so I can't find out what are their parameters and return types and so on.
So, my questions:

1) How to use function SetHandle?
2) What does function H2Tx do?
3) What does function FastFlush do?

Thanks for answers.
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
Um, last I checked, those functions doesn't exist in the Hashtable API.

Are you sure those aren't for some system?

Edit:

Here's the API:

JASS:

native  InitHashtable    takes nothing returns hashtable

native  SaveInteger                        takes hashtable table, integer parentKey, integer childKey, integer value returns nothing
native  SaveReal                        takes hashtable table, integer parentKey, integer childKey, real value returns nothing
native  SaveBoolean                        takes hashtable table, integer parentKey, integer childKey, boolean value returns nothing
native  SaveStr                            takes hashtable table, integer parentKey, integer childKey, string value returns boolean
native  SavePlayerHandle                takes hashtable table, integer parentKey, integer childKey, player whichPlayer returns boolean
native  SaveWidgetHandle                takes hashtable table, integer parentKey, integer childKey, widget whichWidget returns boolean
native  SaveDestructableHandle            takes hashtable table, integer parentKey, integer childKey, destructable whichDestructable returns boolean
native  SaveItemHandle                    takes hashtable table, integer parentKey, integer childKey, item whichItem returns boolean
native  SaveUnitHandle                    takes hashtable table, integer parentKey, integer childKey, unit whichUnit returns boolean
native  SaveAbilityHandle                takes hashtable table, integer parentKey, integer childKey, ability whichAbility returns boolean
native  SaveTimerHandle                    takes hashtable table, integer parentKey, integer childKey, timer whichTimer returns boolean
native  SaveTriggerHandle                takes hashtable table, integer parentKey, integer childKey, trigger whichTrigger returns boolean
native  SaveTriggerConditionHandle        takes hashtable table, integer parentKey, integer childKey, triggercondition whichTriggercondition returns boolean
native  SaveTriggerActionHandle            takes hashtable table, integer parentKey, integer childKey, triggeraction whichTriggeraction returns boolean
native  SaveTriggerEventHandle            takes hashtable table, integer parentKey, integer childKey, event whichEvent returns boolean
native  SaveForceHandle                    takes hashtable table, integer parentKey, integer childKey, force whichForce returns boolean
native  SaveGroupHandle                    takes hashtable table, integer parentKey, integer childKey, group whichGroup returns boolean
native  SaveLocationHandle                takes hashtable table, integer parentKey, integer childKey, location whichLocation returns boolean
native  SaveRectHandle                    takes hashtable table, integer parentKey, integer childKey, rect whichRect returns boolean
native  SaveBooleanExprHandle            takes hashtable table, integer parentKey, integer childKey, boolexpr whichBoolexpr returns boolean
native  SaveSoundHandle                    takes hashtable table, integer parentKey, integer childKey, sound whichSound returns boolean
native  SaveEffectHandle                takes hashtable table, integer parentKey, integer childKey, effect whichEffect returns boolean
native  SaveUnitPoolHandle                takes hashtable table, integer parentKey, integer childKey, unitpool whichUnitpool returns boolean
native  SaveItemPoolHandle                takes hashtable table, integer parentKey, integer childKey, itempool whichItempool returns boolean
native  SaveQuestHandle                    takes hashtable table, integer parentKey, integer childKey, quest whichQuest returns boolean
native  SaveQuestItemHandle                takes hashtable table, integer parentKey, integer childKey, questitem whichQuestitem returns boolean
native  SaveDefeatConditionHandle        takes hashtable table, integer parentKey, integer childKey, defeatcondition whichDefeatcondition returns boolean
native  SaveTimerDialogHandle            takes hashtable table, integer parentKey, integer childKey, timerdialog whichTimerdialog returns boolean
native  SaveLeaderboardHandle            takes hashtable table, integer parentKey, integer childKey, leaderboard whichLeaderboard returns boolean
native  SaveMultiboardHandle            takes hashtable table, integer parentKey, integer childKey, multiboard whichMultiboard returns boolean
native  SaveMultiboardItemHandle        takes hashtable table, integer parentKey, integer childKey, multiboarditem whichMultiboarditem returns boolean
native  SaveTrackableHandle                takes hashtable table, integer parentKey, integer childKey, trackable whichTrackable returns boolean
native  SaveDialogHandle                takes hashtable table, integer parentKey, integer childKey, dialog whichDialog returns boolean
native  SaveButtonHandle                takes hashtable table, integer parentKey, integer childKey, button whichButton returns boolean
native  SaveTextTagHandle                takes hashtable table, integer parentKey, integer childKey, texttag whichTexttag returns boolean
native  SaveLightningHandle                takes hashtable table, integer parentKey, integer childKey, lightning whichLightning returns boolean
native  SaveImageHandle                    takes hashtable table, integer parentKey, integer childKey, image whichImage returns boolean
native  SaveUbersplatHandle                takes hashtable table, integer parentKey, integer childKey, ubersplat whichUbersplat returns boolean
native  SaveRegionHandle                takes hashtable table, integer parentKey, integer childKey, region whichRegion returns boolean
native  SaveFogStateHandle                takes hashtable table, integer parentKey, integer childKey, fogstate whichFogState returns boolean
native  SaveFogModifierHandle            takes hashtable table, integer parentKey, integer childKey, fogmodifier whichFogModifier returns boolean
native  SaveAgentHandle                    takes hashtable table, integer parentKey, integer childKey, agent whichAgent returns boolean
native  SaveHashtableHandle                takes hashtable table, integer parentKey, integer childKey, hashtable whichHashtable returns boolean


native  LoadInteger                    takes hashtable table, integer parentKey, integer childKey returns integer
native  LoadReal                    takes hashtable table, integer parentKey, integer childKey returns real
native  LoadBoolean                    takes hashtable table, integer parentKey, integer childKey returns boolean
native  LoadStr                     takes hashtable table, integer parentKey, integer childKey returns string
native  LoadPlayerHandle            takes hashtable table, integer parentKey, integer childKey returns player
native  LoadWidgetHandle            takes hashtable table, integer parentKey, integer childKey returns widget
native  LoadDestructableHandle        takes hashtable table, integer parentKey, integer childKey returns destructable
native  LoadItemHandle                takes hashtable table, integer parentKey, integer childKey returns item
native  LoadUnitHandle                takes hashtable table, integer parentKey, integer childKey returns unit
native  LoadAbilityHandle            takes hashtable table, integer parentKey, integer childKey returns ability
native  LoadTimerHandle                takes hashtable table, integer parentKey, integer childKey returns timer
native  LoadTriggerHandle            takes hashtable table, integer parentKey, integer childKey returns trigger
native  LoadTriggerConditionHandle    takes hashtable table, integer parentKey, integer childKey returns triggercondition
native  LoadTriggerActionHandle        takes hashtable table, integer parentKey, integer childKey returns triggeraction
native  LoadTriggerEventHandle        takes hashtable table, integer parentKey, integer childKey returns event
native  LoadForceHandle                takes hashtable table, integer parentKey, integer childKey returns force
native  LoadGroupHandle                takes hashtable table, integer parentKey, integer childKey returns group
native  LoadLocationHandle            takes hashtable table, integer parentKey, integer childKey returns location
native  LoadRectHandle                takes hashtable table, integer parentKey, integer childKey returns rect
native  LoadBooleanExprHandle        takes hashtable table, integer parentKey, integer childKey returns boolexpr
native  LoadSoundHandle                takes hashtable table, integer parentKey, integer childKey returns sound
native  LoadEffectHandle            takes hashtable table, integer parentKey, integer childKey returns effect
native  LoadUnitPoolHandle            takes hashtable table, integer parentKey, integer childKey returns unitpool
native  LoadItemPoolHandle            takes hashtable table, integer parentKey, integer childKey returns itempool
native  LoadQuestHandle                takes hashtable table, integer parentKey, integer childKey returns quest
native  LoadQuestItemHandle            takes hashtable table, integer parentKey, integer childKey returns questitem
native  LoadDefeatConditionHandle    takes hashtable table, integer parentKey, integer childKey returns defeatcondition
native  LoadTimerDialogHandle        takes hashtable table, integer parentKey, integer childKey returns timerdialog
native  LoadLeaderboardHandle        takes hashtable table, integer parentKey, integer childKey returns leaderboard
native  LoadMultiboardHandle        takes hashtable table, integer parentKey, integer childKey returns multiboard
native  LoadMultiboardItemHandle    takes hashtable table, integer parentKey, integer childKey returns multiboarditem
native  LoadTrackableHandle            takes hashtable table, integer parentKey, integer childKey returns trackable
native  LoadDialogHandle            takes hashtable table, integer parentKey, integer childKey returns dialog
native  LoadButtonHandle            takes hashtable table, integer parentKey, integer childKey returns button
native  LoadTextTagHandle            takes hashtable table, integer parentKey, integer childKey returns texttag
native  LoadLightningHandle            takes hashtable table, integer parentKey, integer childKey returns lightning
native  LoadImageHandle                takes hashtable table, integer parentKey, integer childKey returns image
native  LoadUbersplatHandle            takes hashtable table, integer parentKey, integer childKey returns ubersplat
native  LoadRegionHandle            takes hashtable table, integer parentKey, integer childKey returns region
native  LoadFogStateHandle            takes hashtable table, integer parentKey, integer childKey returns fogstate
native  LoadFogModifierHandle        takes hashtable table, integer parentKey, integer childKey returns fogmodifier
native  LoadHashtableHandle            takes hashtable table, integer parentKey, integer childKey returns hashtable

native  HaveSavedInteger                    takes hashtable table, integer parentKey, integer childKey returns boolean
native  HaveSavedReal                        takes hashtable table, integer parentKey, integer childKey returns boolean
native  HaveSavedBoolean                    takes hashtable table, integer parentKey, integer childKey returns boolean
native  HaveSavedString                        takes hashtable table, integer parentKey, integer childKey returns boolean
native  HaveSavedHandle                     takes hashtable table, integer parentKey, integer childKey returns boolean

native  RemoveSavedInteger                    takes hashtable table, integer parentKey, integer childKey returns nothing
native  RemoveSavedReal                        takes hashtable table, integer parentKey, integer childKey returns nothing
native  RemoveSavedBoolean                    takes hashtable table, integer parentKey, integer childKey returns nothing
native  RemoveSavedString                    takes hashtable table, integer parentKey, integer childKey returns nothing
native  RemoveSavedHandle                    takes hashtable table, integer parentKey, integer childKey returns nothing

native  FlushParentHashtable                        takes hashtable table returns nothing
native  FlushChildHashtable                    takes hashtable table, integer parentKey returns nothing


Source: http://wiki.thehelper.net/wc3/jass/common.j

And remember: You can only have a total of 255 hashtables in a map (0-255).
 

Skippy

Active Member
Reaction score
39
Thanks a lot.

And you are right, those functions are probably part of some system. FAIL ...
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
Any chance you could share the name of that system? :D
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
Oh, that's a spell from DotA. The functions are probably from a system he made.
 

tooltiperror

Super Moderator
Reaction score
231
Icefrog does not use vJASS, everything is in vanilla syntax. Which is probably part of why he has never released anything.
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
Kingking, vJASS is JASS. Everything that can be done in vJASS (and Zinc) can be done in straight JASS2. It just takes more work.
(Okay, well almost everything.)

JASS is probably more efficent than vJASS, in the hands of a highly experienced coder, since you have complete control over everything. You don't rely on the implementation of a feature that someone else has made (I'm not saying Vexorians' code is bad. It's worked perfectly so far.).
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Kingking, vJASS is JASS. Everything that can be done in vJASS (and Zinc) can be done in straight JASS2. It just takes more work.
Yes, but IceFrog used HandleVars which slower than struct(array). :banghead:
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Speed isn't everything.
Faster speed is able to let users to create more complicated stuff without losing much performance.
 

SerraAvenger

Cuz I can
Reaction score
234
Speed isn't everything.
Faster speed is able to let users to create more complicated stuff without losing much performance.

jass is fast enough. The only problems are the op limit and the graphical interface of the program; Both aren't affected by JASS/vJASS/cJASS/GUI (if you remove handles and such).
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
jass is fast enough. The only problems are the op limit and the graphical interface of the program; Both aren't affected by JASS/vJASS/cJASS/GUI (if you remove handles and such).

Yes, Jass is enough fast. My statement is for the style of coding. :banghead:
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
Faster speed is able to let users to create more complicated stuff without losing much performance.

If your that concerned about speed, you shouldn't use JASS.

Speed isn't required to make a complicated system. Yeah, it helps, but the system will run without it.
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Yeah, it helps, but the system will run without it.
Yes, it will but requires more horsepower.
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
Yes, but it works without it, which is the point I'm trying to make.
 

Shaggi

New Member
Reaction score
1
Hi,
I am trying to learn how to use hashtables, but I am confused. Hashtable functions are not in the function list in NewGen so I can't find out what are their parameters and return types and so on.
So, my questions:

1) How to use function SetHandle?
2) What does function H2Tx do?
3) What does function FastFlush do?

Thanks for answers.

I did research and those are functions Icefrog made for faster coding

What they do is writing in a GameCache to save information (wich is like a Hashtable but I like GameCache more than Hashtables, well I'm kinda strange to begin with)

Answer to the questions

1) SetHandle is the function to save an integer in the GC as pTable(param1), pKey(param2) and whatever(param3)

the whatever is gonna give birth to an integer with another hand made function

2) H2Tx changes an handle into a string

3) FastFlush is only a "Clear GameCache "param1 of first question" function

As you all work with hashtables you don't care about that but I gave you this for your personal knowledge ;) if you're not happy then sorry 'bout that
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
[ljass]gamecache[/ljass] is a lot slower than a [ljass]hashtable[/ljass], if I remember correctly.
 

Shaggi

New Member
Reaction score
1
maybe, but as for me hashtables doesn't work so I use a gamecache even though I got another problem that seems to bother no one other than myself u_u''

first problem (hashtable)
I can do anything (YES I initialised my hashtable u_u) it's always empty

second problem (handles)
I saw many triggers using this

JASS:
function H2I takes handle pHandle returns integer
    return pHandle
    return 0
endfunction


but if I do that (or any other double return things) my map becomes non-playable in WC...the map's in the list but when I click on it, the players are invisible (in single player) and starting it bring back the chose map screen or just don't open in lan or BN
 
General chit-chat
Help Users
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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