• 🏆 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] String to spellability ID?

Status
Not open for further replies.
Level 18
Joined
Apr 15, 2004
Messages
1,396
Ive been trying to convert a string to a spellability ID the 4 integerletter code but I cannot figure out how to do so.

I tried,
Code:
        set udg_itemnameidcode = SubStringBJ(udg_Itembase[udg_rowp[udg_pagenumber]], ( StringLength(udg_Itembase[udg_rowp[udg_pagenumber]]) - 7 ), ( StringLength(udg_Itembase[udg_rowp[udg_pagenumber]]) - 4 ))

        set udg_spells = S2I(udg_itemnameidcode)

        set udg_itemnameidcode2 = SubStringBJ(udg_Itembase[udg_rowp[udg_pagenumber]], ( StringLength(udg_Itembase[udg_rowp[udg_pagenumber]]) - 3 ), StringLength(udg_Itembase[udg_rowp[udg_pagenumber]]))

        set udg_spells_attackspeed = S2I(udg_itemnameidcode2)

which takes item Longsword A00AA00V
and chops the end of its name into
A00A
A00V
the S2I converts it to an integer so it should be a usable spell ID right?

and the spell longsword is A00A while its swingspeed modifier is spellid A00V.

And when i use the:

Code:
        Unit - Add spells to Hero
              Unit - Add spells_attackspeed to Hero

it will not give the ability to the guy! i know it works because if i do it manually it does.
but i cannot get it to use the string to apellID.

Please help.
 
Status
Not open for further replies.
Top