• 🏆 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!

[Trigger] Ability Hashtable error crash exit WE?

Status
Not open for further replies.
Level 28
Joined
Jan 26, 2007
Messages
4,789
That's 'normal'... kind-of :p
Since abilities are nothing more than integers, you can store an ability inside a hashtable by using the raw ID.

Since I believe you use GUI, here are some options:
(integer variable tempInt required).

Saves the casted spell:
  • Actions
    • Custom script: set udg_tempInt = GetSpellAbilityId()
    • Hashtable - Save tempInt as value of key in hash
Saves a static spell:
  • Actions
    • Custom script: set udg_tempInt = 'AHbz'
    • Hashtable - Save tempInt as value of key in hash
('AHbz' is the raw ID of the ability, you can see it by going to the object editor and pressing CTRL + D).

Err... there are probably some things I'm forgetting, but you just tell me what it is you want to store :)
 
Thx but until I start learning that kinda scripts I will not do it like that. Idea is to store casting time of abylity in hash. New question: Is this okay way to save real:

Hash - Save 1.5 as (Key (Name of Avatar) of 1 in HashVar. Save 1.5 is casting time, key name avatar is hash get string id ability name of then avatar and last ting should be lvl of spell. How can I load that with out scripts pls and is saving alright
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
"Those kinda scripts" are just setting a variable :)

  • Custom script: set udg_tempInt = 'AHbz'
Is exactly the same as:
  • Set tempInt = 'AHbz'
With the exception that the above (the GUI one) isn't possible, so I use JASS to work my way around that.
(Everything inside the apostrophe's is an integer, but in ASCII instead of decimals - GUI cannot handle that).


There is no "Get casting time" function, so are there many abilities you want to store it for?
If not, then you can just use "Save Real" with the first value set to "1.5".

For the level of the ability, use "Save integer":
  • Actions
    • Hashtable - Save (Level of (Ability being cast) for (Triggering unit)) (Key (Name of Avatar) of 1 in HashVar
To load it all back, create an integer variable and a real variable.
Set the integer variable to "Hashtable - Load Integer Value" and restore all those values from before.
Do the same for the real variable.

I hope this kinda made sense? :p
 
Status
Not open for further replies.
Top