Hashtable

Leazy

You can change this now in User CP.
Reaction score
50
Hello!

In my map I need to store a certain real value to many different spells (casting time for my casting bar system). This is what I got so far:

Saves the value:
Hashtable - Create a hashtable
Set CASTINGBAR_Hashtable = (Last created hashtable)
Set CASTINGBAR_Ability = Healing Wave
Custom script: call SaveReal(udg_CASTINGBAR_Hashtable,udg_CASTINGBAR_Ability, 2, 1.0)

The casting time here should be 2.00 seconds.

Loads the value:
Custom script: set udg_Real[1] = LoadReal(udg_CASTINGBAR_Hashtable, GetSpellAbilityId(),1)
Set CASTINGBAR_CastingTime[(Player number of (Owner of Caster))] = Real[1]

The reason why I'm using custom scripts for this is that my WE crashes when I try to use hashtables with abilities in GUI. My question is: why does udg_Real[1] return a value of 0, and now 2.0? How do I store the value properly depending on the ability, and how do I properly load it? Thanks in advance!
 

Bribe

vJass errors are legion
Reaction score
67
You save 1.0 to the value of "abilityid, 2", but you load it from the value "abilityid, 1".
 

Leazy

You can change this now in User CP.
Reaction score
50
Aha! Should have thought of that myself, but first time I use hashtables :p Thanks for the help!
 
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