• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] How to use Vexorian's Table? :]

Status
Not open for further replies.
Level 10
Joined
Sep 21, 2007
Messages
517
err... im personally doing 2 functions, one for attaching a real to a trackable, and one for getting the real from the trackable, how do we do this? i tried doing the 2d Array syntax like
JASS:
RealTable[t][ index ]
but it didnt work out... anyhow can you tell me how to attach using vexorians table, specifically doing 2d arrays? (cus i already know its hashtable)
 
Level 10
Joined
Sep 21, 2007
Messages
517
Though, due to the fact that its a hashtable, just a vJassified one, why cant we store integers? i mean we can do that even in normal GUI hashtable functions >_< btw thanks for help il try the techinque.... o and we hhave to use vJass ?? lol... im doing normal Jass :S [should have known from pointer vJassified hashtable... Lol]

btw i also want to attach multiple reals to the table object, so :] the 2d array things, u know anything baout that?
 
Level 7
Joined
Mar 8, 2009
Messages
360
Table ~ hashtable, just another syntax.
If you use jass and know how hashtables work, then i suggest just using hashtables.

I can store integers,
JASS:
set table[GetHandleId(GetTriggerUnit())] = spell

This works for me (spell is struct instance, struct instances are referred to with integers)
 
Level 10
Joined
Sep 21, 2007
Messages
517
yea i know, thanks for saying, but still this isnt a 2D Array like in Vexorian's, im not planning to store integers, but integer is the index of the type of data, which is unlimited due to the fact that it is a hashtable, so its Hashtable [Trackable] [ Index] = Data but i dont know how to do it, tho im pretty sure its possible using vex's table. Since its also possible in normal Hashtables. BTW: only reason im not using hashtables now is because i cant find the functions in JNGP, or atleast natives >_>
 
Level 10
Joined
Sep 21, 2007
Messages
517
hehe il try xP Does the string have to be a string?!? >_> i know you wrote that in array but, not quite sure XP and so basically no handle attaching in 2d arrays? im thinking H2S, but... eh! hmm do you think this works?:
JASS:
function H2S takes handle h returns string
    return h
    return ""
endfunction
function S2H takes string s returns handle
    return h
endfunction
 
Level 10
Joined
Sep 21, 2007
Messages
517
hehe thanks, now im just using gamecache lmfao >_>

anyways they never outlined that function in JNGP, the GetHandleId, i assume its parameters are only handle? :p

thanks alot for help bro ^^

maybe il use table cus vexorian says its faster, but its only for Init >_<

yea im just going to use Arrays since its more suited to what im going to do... lol ty for help >_<
 
Level 11
Joined
Apr 29, 2007
Messages
826
Table ~ hashtable, just another syntax.
If you use jass and know how hashtables work, then i suggest just using hashtables.

I can store integers,
JASS:
set table[GetHandleId(GetTriggerUnit())] = spell

This works for me (spell is struct instance, struct instances are referred to with integers)

Since when can you use an array index with numbers over 1000000?
 
Level 4
Joined
Apr 16, 2009
Messages
85
if you want to save a value for a integer use Table
if you want to save a value for a string use StringTable
if you want to save a value for a handle use HandleTable

(if testtable is a HandleTable you can just use set testtable[GetTriggerUnit()] = spell instead of set table[GetHandleId(GetTriggerUnit())] = spell)

and btw its just a wrapper for hashtables and before that it was just a wrapper for gamechache - but it has its purposes as its more user friendly and avoids the creation of billions of hashtables
 
Status
Not open for further replies.
Top