• 🏆 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] Attachments

Status
Not open for further replies.
Level 20
Joined
Aug 29, 2012
Messages
845
You have to create an ability with the attachment (based on item damage +X for instance), set your weapon model in the "Art - Target" field, set the attachment point to the one you want, and then add this ability to your unit via trigger.

Note that you'll have to import the weapon model first, you can't just edit model parts from the editor alone.
 
Level 10
Joined
Jun 20, 2017
Messages
337
I knows that method, I used ability or buff without trigger before, But now I'm using trigger without ability or buff.
Example:
  • Wings
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to (==) Vampiric-Sword
    • Actions
      • Special Effect - Create a special effect attached to the chest of (Hero manipulating item) using war3mapImported\BlackWings.mdx
      • Special Effect - Destroy (Last created special effect)
I think that the standard weapon is somewhere in WE. So I can use it like this?!
  • Weapon Builder
    • Events
      • Map initialization
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to (==) Security Helper
    • Actions
      • Special Effect - Create a special effect attached to the left hand of (Hero manipulating item) using abilities\weapons\TuskarSpear\TuskarSpear.mdl
      • Special Effect - Destroy (Last created special effect)
 
Level 10
Joined
Jun 20, 2017
Messages
337
good question, when the item sold or drop or looses.
I think something like this!
  • Wings
    • Events
      • Unit - A unit Acquires an item
      • Unit - A unit Loses an item
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to (==) Vampiric-Sword
        • Then - Actions
          • Special Effect - Create a special effect attached to the chest of (Hero manipulating item) using war3mapImported\BlackWings.mdx
        • Else - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item being manipulated)) Equal to (==) Vampiric-Sword
            • Then - Actions
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
 
Yeah, on the Acquire-Event you create the effect.
On the Lose-Event you destroy it.
But you should split them into 2 triggers.
  1. On Acquire
  2. On Lose

But there is a problem, if you create another effect during this 2 events "Last created special effect" will not point to the "wings"-effect.

Thats why you need someway to save the effect.

hashtable might be your friend here.
 
Level 10
Joined
Jun 20, 2017
Messages
337
I don't know anything about hashtable.
Mybe this one work fine?!
  • Wings
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to (==) Vampiric-Sword
    • Actions
      • Special Effect - Create a special effect attached to the chest of (Hero manipulating item) using war3mapImported\BlackWings.mdx
      • Set SpecialEffect[1] = (Last created special effect)
      • Trigger - Turn on Wings2 <gen>
  • Wings2
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to (==) Vampiric-Sword
    • Actions
      • Special Effect - Destroy SpecialEffect[1]
 
How many vampire swords are there?
How many units per player have an inventory?

depending on that answers you can simple down the variable reference usage.

If there is only 1 vampire sword overall, you can use a non array variable.

If there is 1 vampire sword user per player, you can use the players number.

1 per unit: well you need some advanvced stuff, Either hashtable or unit Indexer.
 
Level 10
Joined
Jun 20, 2017
Messages
337
I did this one, and I have no idea what going on ;d
  • Wings Copy
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to (==) Vampiric-Sword
    • Actions
      • Hashtable - Create a hashtable
      • Hashtable - Save Handle Of(Item being manipulated) as (Key (Name of (Owner of (Item being manipulated)))) of (Player number of (Owner of (Item being manipulated))) in (Last created hashtable)
      • Special Effect - Create a special effect attached to the chest of (Hero manipulating item) using war3mapImported\BlackWings.mdx
  • Wings2
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to (==) Vampiric-Sword
    • Actions
      • Special Effect - Destroy (Load (Key (Name of (Item being manipulated))) of (Player number of (Owner of (Item being manipulated))) in (Last created hashtable))
 
Last edited:
Status
Not open for further replies.
Top