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

[Spell] How to AbilityId ('XXXX') to #####

Status
Not open for further replies.
Level 13
Joined
Jul 26, 2008
Messages
1,009
Alright so I was going through the list of this stuff and I can't figure out how to do it. The abilityid crap is rather confusing sometimes.

What I don't want is the order string. I want to find the unique number of the ability. I just don't know how to convert the Rawcode to something like 85958. I thought it was doable, as I could have sworn I got it to return as a number before.

The reason I want to do this is so I can save the number as the integer of an array and then call it using the Rawcode.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
The only way I can think of is callinng BJDebug(OrderId2String(GetIssuedOrder())) or something like that. Take note of the order id, and do your thing.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
I'm not sure if the OrderId is based on the Text Order String or in the ability base ID.

Having 2 abilities with the same orderId would be 2 abilities based on the same ability... I don't know =/
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
And what about using the HandleId of the ability instead?
This of course in case it needs to be unique to an ability being cast.

Titanhex said:
I want to find the unique number of the ability.
If the ability is being cast then yep, that's a handleId allright.

Any created handle gets a unique ID assigned to itself which can be retrieved with:

JASS:
call GetHandleId()

However if you are trying to get an Id of a RAW code.
This is simply impossible since a RAW code is not a handle but an integer.
A handle needs to be created in order to retrieve the handleId.
Therefore you can retrieve the unique ID of a specific ability being cast but not the unique id of a RAW code of this ability in generall.
This last sentence sounds quite stupid since a RAW code already defines the type of the ability.
Why have a unique ID for that if the RAW code itself already indicates which ability it is?

Why not save the RAW code? A RAW code is an actual integer!
 
Last edited:
Level 13
Joined
Jul 26, 2008
Messages
1,009
Well I know GetSpellAbilityId returns the rawcode in form 'A000'.

I have a table in my possession that attaches the rawcodes to a string.

I want to be able to save the description of the spell in a string, and I want the array of that string to be a number.

I want to be able to check the unique #### of that ability with the rawcode saved in the hash so I can get it's description.

Player type "firebolt" and it gets the rawcode from the Hash.

Then I convert the rawcode to it's ##### integer. Then, I get the description by using that in the array.
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
Well I know GetSpellAbilityId returns the rawcode in form 'A000'.

I have a table in my possession that attaches the rawcodes to a string.

I want to be able to save the description of the spell in a string, and I want the array of that string to be a number.

I want to be able to check the unique #### of that ability with the rawcode saved in the hash so I can get it's description.

Player type "firebolt" and it gets the rawcode from the Hash.

Then I convert the rawcode to it's ##### integer. Then, I get the description by using that in the array.

You do realise that you can use the RAW code of an ability as the index of an array since it's an actual integer?
I don't really see the problem.

JASS:
function solution takes nothing returns nothing
   local string array description
   set description['A000'] = "some description"
endfunction
 
Last edited:
Level 13
Joined
Jul 26, 2008
Messages
1,009
There may be an issue with saving abilcodes into strings but correct me if I'm wrong.

I know this:

JASS:
        call BJDebugMsg(I2S(skillhash[text]) + " " + I2S('BlWa'))

Creates the same number when the text I pull up is the name of the 'BlWa' spell.

However, after setting this:
DESCR['BlWa'] = "Description of Spell Here"

and calling this: DESCR[skillhash[text]] using the same text returns null.
The globals are being initialized fine because they're being set with a ton of other vital globals. Also just calling DESCR['BlWa'] to be displayed returns nothing.

What's the problem now? Anyone else have problems setting Rawcodes as Array integers?
 
Status
Not open for further replies.
Top