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

Help with attachment abilities

Status
Not open for further replies.
Level 11
Joined
Oct 9, 2015
Messages
721
Hi, it's me seeking for help again.

So I'm on a project where I have around 50 weapon attachments, and about 10 shield attachments, and I'm having problem implementing them, let me show you why:

If a unit acquires an item, let's say a short sword, I need the "short sword (right hand)" ability to be added to the unit, however, if that unit already has an shield, then the ability I need to be added is the "short sword (left hand)", so the shield will fit the right hand, as shields on my project are only right handed. but when there's no shield, the weapon should go to the right hand. When the unit drops the weapon, it's attachment ability should be removed, but if the shield is dropped and the unit still has a weapon, the left hand weapon ability is then removed, and the right hand abiltiy is added. I don't know if you see the point, but I need an good, fast and efficient way of triggering it. my first tought was to store the itens and abilities into variables and check for then once the unit acquires/loses an item. Other tought was to make an item table (which I don't know why) and link each item to the ability. Can anyone help me achieving it?

PS: Adding the ability to the item via object editor is out of question, because then I would need to have 2 itens of each one (one left, other right) which is inviable.
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
Rather than using abilities I would just use the special effect action.

Use a unit indexer and do something like:
unit gets item
if item being manipulated is equal to someSword
if(leftHand[index] equal to true
add sword effect to right hand


You would have to set leftHand[index] to false in another trigger where you check if such an item is dropped.
 
Last edited:
Status
Not open for further replies.
Top