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

abilityString, what is it?

Status
Not open for further replies.
Level 13
Joined
Nov 7, 2014
Messages
571
Does someone have an idea what the abilityString parameter is supposed to look like for those?

native GetAbilityEffect takes string abilityString, effecttype t, integer index returns string
native GetAbilitySound takes string abilityString, soundtype t returns string
native AddSpellEffect takes string abilityString, effecttype t, real x, real y returns effect
native AddSpellEffectLoc takes string abilityString, effecttype t,location where returns effect
native AddSpellEffectTarget takes string modelName, effecttype t, widget targetWidget, string attachPoint returns effect

And yes I know there are "ById" equivalents:

native GetAbilityEffectById takes integer abilityId, effecttype t, integer index returns string
native GetAbilitySoundById takes integer abilityId, soundtype t returns string
native AddSpellEffectById takes integer abilityId, effecttype t,real x, real y returns effect
native AddSpellEffectByIdLoc takes integer abilityId, effecttype t,location where returns effect
native AddSpellEffectTargetById takes integer abilityId, effecttype t, widget targetWidget, string attachPoint returns effect

but I am intrested in the string versions.

For the Thunder Clap ability ('AHtc') I've tried:

JASS:
"AHtc" // yeah I was optimistic at the start..., I got (null)
"thunderclap" // again (null)
"Thunderclap" // and again
"Thunder Clap" // etc...
"Standard Abilities/Human/Heroes/Thunder Clap"
"Standard_Abilities/Human/Heroes/Thunder_Clap"
...
"Abilities\\Human\\Heroes\\Thunderclap" // nope, (null) again

And yes I am sure that the effecttype parameter is correct:

JASS:
GetAbilityEffectById('AHtc', EFFECT_TYPE_CASTER, 0) == "Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl"
GetAbilityEffect("<abilityString>", EFFECT_TYPE_CASTER, 0) == null // for every <abilityString> I've tested


So... has anyone ever actually used the string version natives and got anything else except null? =)
 
Level 13
Joined
Nov 7, 2014
Messages
571
JASS:
        if OrderId("defend") == 0x0D0057 then // 852055
            if GetAbilityEffectById('Adef', EFFECT_TYPE_CASTER, 0) == "Abilities\\Spells\\Human\\Defend\\DefendCaster.mdl" then
                call BJDebugMsg("okay")

                if GetAbilityEffect("0x0D0057", EFFECT_TYPE_CASTER, 0) == "Abilities\\Spells\\Human\\Defend\\DefendCaster.mdl" then
                    call BJDebugMsg("The Silent's guess is correct")
                else
                    call BJDebugMsg("nope")
                endif
                
                if GetAbilityEffect("0D0057", EFFECT_TYPE_CASTER, 0) == "Abilities\\Spells\\Human\\Defend\\DefendCaster.mdl" then
                    call BJDebugMsg("The Silent's guess is correct")
                else
                    call BJDebugMsg("nope")
                endif

                if GetAbilityEffect("852055", EFFECT_TYPE_CASTER, 0) == "Abilities\\Spells\\Human\\Defend\\DefendCaster.mdl" then
                    call BJDebugMsg("The Silent's guess is correct")
                else
                    call BJDebugMsg("nope")
                endif
                                
                // Is this what you meant by "actual name"?
                
                if GetAbilityEffect("defend", EFFECT_TYPE_CASTER, 0) == "Abilities\\Spells\\Human\\Defend\\DefendCaster.mdl" then
                    call BJDebugMsg("The Silent's guess is correct")
                else
                    call BJDebugMsg("nope")
                endif
                
                if GetAbilityEffect("Defend", EFFECT_TYPE_CASTER, 0) == "Abilities\\Spells\\Human\\Defend\\DefendCaster.mdl" then
                    call BJDebugMsg("The Silent's guess is correct")
                else
                    call BJDebugMsg("nope")
                endif                                
            endif
        endif

        // output:
        // okay
        // nope
        // nope
        // nope
        // nope
        // nope
 
I guess these natives are some of those features that have never truly been implemented by blizzard. They are probably placeholders and later got obsolete when the devs implemented the "byId" versions.

Interesting trivia, though:
These natives are not limited to abilities; you can enter the rawcode for units/destructables/items, etc. in the "byId" functions and they will retrieve the specified object data field properly (if it exists for this object type).

This can be used to get the missile SFX or Art - Special SFX of units, for example when scripting missile reflection systems.
 
Status
Not open for further replies.
Top