• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Comparing integer spell id to alpha numeric ID

Level 3
Joined
Feb 25, 2013
Messages
16
Hi,

So I might just be daft but I'm trying to compare spell IDs in a AbilityCast function, and the ID's I'm getting are not matching.

I have a spell with ID 'a002' (if I print this I get 1630548018), however, when I cast the spell and print "GetSpellAbilityId()" it prints 1093677106

2024-05-29_22-23-37.PNG


Can anyone shine some light on what I'm doing wrong?

JASS:
globals
    trigger gg_trg_CopterSpellcast      
    integer SPL_AC_CAST_ID = 'a002'  
endglobals

function StartSpellAutocannon takes player p returns nothing
    //Logic for autocannon spell
endfunction

function CheckSpellCast takes nothing returns nothing
    call BJDebugMsg(I2S(GetSpellAbilityId()))   //Prints 1093677106
    call BJDebugMsg(I2S(SPL_AC_CAST_ID))        //Prints 1630548018
    if(GetSpellAbilityId() == SPL_AC_CAST_ID) then
        call StartSpellAutocannon(GetOwningPlayer(GetTriggerUnit()))
    endif
endfunction

function Init_SpellAutocannon takes nothing returns nothing  
    set gg_trg_CopterSpellcast = CreateTrigger()  
    call TriggerRegisterAnyUnitEventBJ(gg_trg_CopterSpellcast, EVENT_PLAYER_UNIT_SPELL_CAST)
    call TriggerAddAction(gg_trg_CopterSpellcast, function CheckSpellCast)
endfunction
 
Level 18
Joined
Jun 13, 2016
Messages
586
What Uncle said is correct. Rawcodes are base-62 and as such are case sensitive: 0-9, A-Z, a-z.
wc3 will also sometimes accept punctuation and non-latin characters (including invisible ones) in rawcodes technically, at least i seem to recall that from some of my limited testing

internally '+' shows up in some engine-specific 4ccs
 

LeP

LeP

Level 13
Joined
Feb 13, 2008
Messages
545
You can pretty much put whatever you want into rawcodes. Any four bytes really (when we're talking about fourcc's). The single char variant has slightly different rules because it accepts escaped chars. But you could just put those escape characters verbatim in your script. pjass should tell when you're doing it wrong.
 
Top