• 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.

[JASS] Need help with custom script

Status
Not open for further replies.
Level 2
Joined
Jan 25, 2011
Messages
25
Hey guys

I need help with a Jass code in Gui custome script.

  • Custom script: call UnitMakeAbilityPermanentBJ(GetSpellAbilityUnit(), true, 'A017')
When i want to enable the trigger i get an error:

Invalid argument type (integer) in the next code line. I never get this error before.
 
You are passing variables in wrong order to function UnitMakeAbilityPermanentBJ since it takes:
function UnitMakeAbilityPermanentBJ takes boolean permanent, integer abilityId, unit whichUnit returns boolean

The order you were using fits for function UnitMakeAbilityPermanent - native.
However, do not use BJ, so leave the order of passing variables and change the function used. Egzample:

  • Custom script: set udg_i = 'A017'
  • Custom script: UnitMakeAbilityPermanent (GetSpellAbilityUnit(), true, udg_i)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
JASS:
native UnitMakeAbilityPermanent takes unit whichUnit,boolean permanent,integer abilityId returns boolean
function UnitMakeAbilityPermanentBJ takes boolean permanent,integer abilityId,unit whichUnit returns boolean
    return UnitMakeAbilityPermanent(whichUnit, permanent, abilityId)
endfunction

Thus fixed version...
  • Custom script: call UnitMakeAbilityPermanent(GetSpellAbilityUnit(), true, 'A017')
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
None of you actually gave him corrected code.

Garfield1337, you told him how to make the correction without showing why or what the correction is.
Spinnaker, at the time I posted your code would have thrown a syntax error (was incorrect). You also use a variable for some reason which is not what he was asking.
 
None of you actually gave him corrected code.

Spinnaker, at the time I posted your code would have thrown a syntax error (was incorrect). You also use a variable for some reason which is not what he was asking.

!st sentence: wrong, we both did, sorry DSG dont lie.
Yeah, I've forgotten about ')' and Garfield mentioned it first, before you've even posted, it was corrected immidiately tho. However, eveyone can make mistakes and dont judge by it.
I just used to setting variables for such things, and thats nothing wrong with that.

Again, dont lie, you posted after two people gave answers and saying that any of them wasn't proper speaks that you do this only for reputation.
 
Status
Not open for further replies.
Top