• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[JASS] Local Ability Variable Problems.

Status
Not open for further replies.
Level 6
Joined
Jul 2, 2008
Messages
156
Ok, honestly I'm sick of having to ask for help every trigger I decide to convert to JASS script, but I guess that is the price of learning JASS.

My situation:
Basically I need to add an ability to a unit, but which ability I add is dependent on some things, therefore I need the ability to be saved in a local variable.

JASS:
local ability a
    local integer index

    if ( CheckConversionDifficulty(u) >= (GetPlayerTechCount(p, 'R00O', true)) ) then
        call IssueImmediateOrder( u, "stop" )
        if ( CheckConversionDifficulty(u) >= 1 ) then
            set a= 'A000'
        else 
            set a= 'A002'
        endif
    else

I get the syntax problem: "Cannot convert from integer to ability" when I try to set a= an ability Id.

Can someone please say what I'm doing wrong?

TY in advance, as always.
 
ALL rawcodes (units, destructables, items, abilitys, buffs, upgrades) are integers. So Unit-type in GUI is integer in JASS, Item-Type in GUI is integer in JASS,, etc.

I cant even think of any use for the variable types Ability and Buff.. Unit,Item and Destructable are quite obvious, but Ability and Buff i dont know.
 
Status
Not open for further replies.
Back
Top