• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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 40
Joined
Feb 27, 2007
Messages
5,092
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