• 🏆 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!

Weapon Attachment Special Effect won't remove

Status
Not open for further replies.
Level 10
Joined
Jan 20, 2011
Messages
492
Hey guys, I'm trying to make it when you acquire a sword (item) a model appears, but whenever I try to remove it, it does not remove (so I'm stuck with the sword even when I do not have the item equipped). Can someone tell me what I'm doing wrong?

I did this with separate triggers and it still didn't work

  • DSS Acquire
    • Events
      • Unit - A unit Acquires an item
      • Unit - A unit Loses an item
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Hunter
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has an item of type |c007d7d7dDull Short Sword|r) Equal to True
        • Then - Actions
          • Special Effect - Create a special effect attached to the left hand of (Triggering unit) using war3mapImported\Copper_Handled_Sword.mdx
          • Set SFXModel[0] = (Last created special effect)
        • Else - Actions
          • Special Effect - Destroy SFXModel[0]
  • DSS Acquire
    • Events
      • Unit - A unit Acquires an item
      • Unit - A unit Loses an item
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Hunter
    • Actions
      • Wait 0.00 game-time seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has an item of type |c007d7d7dDull Short Sword|r) Equal to True
        • Then - Actions
          • Unit - Add Dull Short Sword to (Triggering unit)
        • Else - Actions
          • Unit - Remove Dull Short Sword from (Triggering unit)


EDIT: Thank you the problem has been solved
 
Last edited:
There are actually two problems here, not just one:

1) The "unit loses an item" event fires before the item is removed from the inventory, which means the "has an item of type" condition will be true.
2) If your special effect does not have a death animation, the SFX will remain on the unit for 5 more seconds until it disappears.

You can fix the first issue by adding a small wait between the event and the actions.
You can only fix the second issue by using a model editor and add a death animation which sets the alpha of the models material to 0.

A more elegant solution, however, is adding a modified orc building spikes (I don't know what's it called) ability to the item and set the SFX to this ability.

This way you can get rid of those triggers.
 
Level 10
Joined
Jan 20, 2011
Messages
492
Thank you Zwiebelchen, I will give it ago, I didn't know about the loses an item fired before it, thank you for clarifying that with me.

I knew about using passive's or upgrades to give them special effects, but I didn't really want to do that unless last resort. I will edit this post if I have any other troubles
 
I knew about using passive's or upgrades to give them special effects, but I didn't really want to do that unless last resort. I will edit this post if I have any other troubles
If you use special effects instead of abilities, all your models require a death animation. Most attachment models available on hive do not have a death animation, so unless you can DIY those death animations, you shouldn't go for the special effects route.
 
Level 10
Joined
Jan 20, 2011
Messages
492
Ok then, can I use multiple pheonix passive (Pheonix Fire?) to use it for the attachment of a weapon? This is because it doesn't create an icon for the unit in the UI

EDIT: Nvm, I'm using sphere, and it's working now, thank you :)
 
Level 30
Joined
Nov 29, 2012
Messages
6,637
Easier without making triggers. AS what Adiktuz said make an ability based on Item Damage or anything you want but make it do NOTHING and attach the attachment and in the attachment point you want it. If you have an item that corresponds with this attachment ability. Give this ability to the corresponding item so when you have thaat item, the model will show up and when you removed the item... the model dissapears too.
 
Level 10
Joined
Jan 20, 2011
Messages
492
Easier without making triggers. AS what Adiktuz said make an ability based on Item Damage or anything you want but make it do NOTHING and attach the attachment and in the attachment point you want it. If you have an item that corresponds with this attachment ability. Give this ability to the corresponding item so when you have thaat item, the model will show up and when you removed the item... the model dissapears too.

Yes I understood adiktuz clearly
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
Easier without making triggers. AS what Adiktuz said make an ability based on Item Damage or anything you want but make it do NOTHING and attach the attachment and in the attachment point you want it. If you have an item that corresponds with this attachment ability. Give this ability to the corresponding item so when you have thaat item, the model will show up and when you removed the item... the model dissapears too.

Note that this way also has some cons. Mainly the fact that death animation is player on death and every attack(if the attachment has one). Using triggers to add attachments disables that.
 
Status
Not open for further replies.
Top