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

[Solved] "Remove Ability/Buff" in jass with strings?

Status
Not open for further replies.
Level 7
Joined
Jun 14, 2009
Messages
235
I need to remove abilities and buffs with custom code, however im not exactly sure how. Im trying to make a system but you can't save abilities in hashtables so im trying to save the string of the ability, then remove ability with the ability code as a string.

In theory it would be something like "remove "udg _ability from target" but I don't have any clue for the syntax.

Sorry if this is sloppy im on my phone
 
first thing ability ids are not strings they are integers. More exact they are ascii values.
'hpea' is a peasant.

here is an easy way to remove them. one sec
  • Custom script: call UnitRemoveAbility( udg_tempUnit, udg_tempInt)
u can set the tempUnit to whatever u need it to b4 this action and set tempInt before this to the ability u want it to be.

like this
  • Actions
    • Set tempUnit = (Triggering unit)
    • Set tempInt = urAbilityArray[0]
    • Custom script: call UnitRemoveAbility( udg_tempUnit, udg_tempInt)
note: u have to store ur abilities raw code into the array.

if its in the same trigger that u use to cast it then u can use this
  • Custom script: call UnitRemoveAbility( udg_tempUnit, GetSpellAbilityId())
 
Level 7
Joined
Jun 14, 2009
Messages
235
I hate to post again, but I can't seem to set the integer to equal the ascii code. Do i set Temp_Into to convert string to integer? or how do I do this?
 
I hate to post again, but I can't seem to set the integer to equal the ascii code. Do i set Temp_Into to convert string to integer? or how do I do this?

atually i think u need to use custom script for that i always forget about that in GUI.

if u use the ones i gave u with the tempInt use this
  • Custom script: set udg_tempInt = 'hpea'
change the hpea part and leave those ' in
 
Level 7
Joined
Jun 14, 2009
Messages
235
Ok testin

EDIT 1: YAY it passed the first test of working. Now I need to see if I can save the integer in a hashtable!!!

EDIT 2: YESSS thanks man!
 
Status
Not open for further replies.
Top