• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Different attachments per level of ability?

Status
Not open for further replies.
Level 8
Joined
Mar 5, 2011
Messages
199
Hello again...

I'm wondering if it is possible for a unit who has an ability which has 4 levels and for each level, there are different attachments. Like for example, when he learns the ability(level 1), an axe is attached to his hand and for level 2, a different axe is attached to the same hand and the previous axe is removed.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
it is possible to do in 2 ways:

In object editor, if the spell has attachments, you can put it there, or you could trigger it as special effect, which you would create as model of the axe in his hand and store in variable, then when he levels the ability up, you destroy the previous effect(axe performs death animation and disappears) and then set the same variable(array preferred for MUIness) the new effect(with different axe)
 
Level 8
Joined
Mar 5, 2011
Messages
199
it is possible to do in 2 ways:

In object editor, if the spell has attachments, you can put it there, or you could trigger it as special effect, which you would create as model of the axe in his hand and store in variable, then when he levels the ability up, you destroy the previous effect(axe performs death animation and disappears) and then set the same variable(array preferred for MUIness) the new effect(with different axe)

can you show me a sample trigger?
 
Level 25
Joined
Sep 26, 2009
Messages
2,381
What you need is to set up those attachments at map init - like in the trigger below.

  • Map Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Attachment[1] = Abilities\Spells\Other\AcidBomb\BottleImpact.mdl
      • Set Attachment[2] = Abilities\Spells\NightElf\Barkskin\BarkSkinTarget.mdl
      • Set Attachment[3] = Abilities\Spells\Orc\Bloodlust\BloodlustTarget.mdl
      • Set Attachment[4] = Units\Undead\PlagueCloud\PlagueCloudtarget.mdl
Attachment is "string" variable array. Each string has different path to the effect - in my example [1] is AcidBomb buff, [2] Barkskin buff, [3] Bloodlust buff and [4] Disease Cloud buff.

Then second trigger fires when your hero learns the skill:
  • Weapon Mastery
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Weapon Mastery
    • Actions
      • Set integer = (Level of Weapon Mastery for (Triggering unit))
      • Special Effect - Destroy Weapon_effect
      • Special Effect - Create a special effect attached to the hand left of (Triggering unit) using Attachment[integer]
      • Set Weapon_effect = (Last created special effect)
When hero learns skill "Weapon Mastery", I delete his previous weapon (= special effect) and create a new one instead. As a path for the new special effect, I use the "Attachment" string array I created at map ini.

Note: Weapon_effect is "special effect" variable. This trigger will work for 1 hero only. If you want it to work for multiple heroes, you will need to make Weapon_effect into array and learn indexing and deindexing to make that MUI.

"integer" is Integer variable
 
Level 8
Joined
Mar 5, 2011
Messages
199
What you need is to set up those attachments at map init - like in the trigger below.

  • Map Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Attachment[1] = Abilities\Spells\Other\AcidBomb\BottleImpact.mdl
      • Set Attachment[2] = Abilities\Spells\NightElf\Barkskin\BarkSkinTarget.mdl
      • Set Attachment[3] = Abilities\Spells\Orc\Bloodlust\BloodlustTarget.mdl
      • Set Attachment[4] = Units\Undead\PlagueCloud\PlagueCloudtarget.mdl
Attachment is "string" variable array. Each string has different path to the effect - in my example [1] is AcidBomb buff, [2] Barkskin buff, [3] Bloodlust buff and [4] Disease Cloud buff.

Then second trigger fires when your hero learns the skill:
  • Weapon Mastery
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Weapon Mastery
    • Actions
      • Set integer = (Level of Weapon Mastery for (Triggering unit))
      • Special Effect - Destroy Weapon_effect
      • Special Effect - Create a special effect attached to the hand left of (Triggering unit) using Attachment[integer]
      • Set Weapon_effect = (Last created special effect)
When hero learns skill "Weapon Mastery", I delete his previous weapon (= special effect) and create a new one instead. As a path for the new special effect, I use the "Attachment" string array I created at map ini.

Note: Weapon_effect is "special effect" variable. This trigger will work for 1 hero only. If you want it to work for multiple heroes, you will need to make Weapon_effect into array and learn indexing and deindexing to make that MUI.

"integer" is Integer variable

It works. Thank you :D
 
Status
Not open for further replies.
Top