• 🏆 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] How do I get rawcode of ability being cast?

Status
Not open for further replies.

TKF

TKF

Level 19
Joined
Nov 29, 2006
Messages
1,266
SOLVED


set udg_IDSpell = GetSpellAbilityId(???GetCastingAbility???GetObjectName???GetAbilityName???)


I'm learning JASS

I want the ASCII integer value of the current casting ability. I'm not sure what JASS code I need for getting it. Do I need something between the ( to get the current casting ability )?

Does this work or?

set udg_IDSpell = S2I(GetAbilityName(GetSpellAbilityId()))
Edit: No it doesn't only fetch the name

EDIT:

I want to avoid looping 200+ abilities. I want only the integer value of casting ability which removes loop like I've done with unit-type system.

GetAbilityName is from blizzard.j, I don't know of any other function doing the same.


But I want to fetch the ability rawcode, not the name rawcode which is my problem.
 
Last edited:
Level 25
Joined
Jul 10, 2006
Messages
3,315
Yeah I realised my method wasn't that good... I'm taking a look now

EDIT: Found this in jasscraft:
JASS:
function GetAbilityName takes integer abilcode returns string
    return GetObjectName(abilcode)
endfunction

Maybe you can use GetObjectName?

There's also:
JASS:
constant native GetSpellAbilityId           takes nothing returns integer
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
The closest to I can get is the ID in hexadecimal, not the converted ones like 'Aloc' and such.
  • Melee Initialization
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Custom script: call BJDebugMsg(I2S(GetSpellAbilityId()))
The ID is set udg_IDSpell = GetSpellAbilityId()
 
  • Like
Reactions: TKF
Status
Not open for further replies.
Top