• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Jass Script Variable converted to Hashtable Variable

Status
Not open for further replies.
Level 8
Joined
Sep 23, 2007
Messages
357
I need to change:

  • Custom script: set udg_PlayerHeight_Terrain[GetPlayerId(GetEnumPlayer())+1] = GetLocationZ(udg_PlayerPosition[GetPlayerId(GetEnumPlayer())+1])
so that "PlayerHeight_Terrain" and "PlayerPosition" are hashtable variables rather than a normal real/integer. I don't know enough about Jass to implement hashtable variables into code, so I greatly appreciate any help given.
 
What do you mean exactly? The natives for saving a real and integer are as follows:
JASS:
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

For loading:
JASS:
native  LoadInteger                             takes hashtable table, integer parentKey, integer childKey returns integer
native  LoadReal                                        takes hashtable table, integer parentKey, integer childKey returns real

I'm not exactly sure what you mean though.
 
Level 8
Joined
Sep 23, 2007
Messages
357
Hashtables natives take 2 index arguments in addition to the actual hashtable object itself. You will need to explain more clearly what you want as you are missing a second index for both hashtable calls.

What I'm trying to do is save GetLocationZ(udg_PlayerPosition[GetPlayerId(GetEnumPlayer())+1]
to Player_Base_Table[player number of picked player] with the index (14,3). I'm not entirely sure how to write it out though.
 
Status
Not open for further replies.
Top