[Solved] Adding Abilities to Illusions

Status
Not open for further replies.
Level 8
Joined
Oct 2, 2013
Messages
288
I'm having a problem with the Mirror Image ability. The illusions don't have the passive abilities of their caster, like Critical Strike.

But I think I know why: The casting unit does not have critical strike to start with - meaning it is added through triggers and not setup in the Object Editor. The concept of the map is that Heroes have no abilities to start with and instead buy abilities of their choice.

I've been using triggers to try and add the passive abilities directly to the illusions, but I can't seem to make it work. Does anyone have any ideas on how to make it work or alternatives to an illusion spell?

Thank you so much for looking into this :)
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
It might pick it up if you make the critical strike ability permanent with a trigger. This is what keeps abilities on units when they morph into/back from other unit-types. This action doesn't exist in GUI, so you must use it through a JASS custom script:
  • Set UNIT_VAR = (Triggering Unit) //or however you refer to it
  • Set ABILITY_VAR = Critical Strike //the ability to make permanent
  • Custom script: call UnitMakeAbilityPermanent(udg_UNIT_VAR, true, udg_ABILITY_VAR) //change the variable names to match yours but keep the udg_ prefix
 
Level 8
Joined
Oct 2, 2013
Messages
288
It might pick it up if you make the critical strike ability permanent with a trigger. This is what keeps abilities on units when they morph into/back from other unit-types. This action doesn't exist in GUI, so you must use it through a JASS custom script:
  • Set UNIT_VAR = (Triggering Unit) //or however you refer to it
  • Set ABILITY_VAR = Critical Strike //the ability to make permanent
  • Custom script: call UnitMakeAbilityPermanent(udg_UNIT_VAR, true, udg_ABILITY_VAR) //change the variable names to match yours but keep the udg_ prefix

Very good! This is the solution I was looking for. Thank you so much :)
 
Status
Not open for further replies.
Top