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

Dual-wielding system?

Status
Not open for further replies.
Level 3
Joined
Mar 17, 2011
Messages
34
Hey. I'm currently working on a map(Check signature), and I would like for the majority of its heroes to be able to pick up and wield two (attached) weapons. I know how to do this part. But my problem is that I am trying to make the SECOND item picked up to attach the weapon model to the heroes left hand, if that makes sense.

Eg. My hero has an axe already in his inventory, and it is attached to his right hand. Say he wants to pick up a sword to use as well, how would I make it so that this item goes to his left hand instead of his right? ( And if there was no axe in his right hand, the sword would go there instead.)

I would prefer not to make a complete set of left handed weapons and a complete set of right handed weapons.

So I ask you, how can I do this, if at all?

Thanks.
 
Level 9
Joined
Oct 17, 2009
Messages
370
You could use a boolean array for each hero, when a hero got a weapon attached to first hand, set the boolean to true. And then if the boolean is true when the hero pick up a weapon make it attack to left hand. With this you could make the boolean always true for those that can use only 1 weapon or something :p
 
Level 7
Joined
Feb 26, 2011
Messages
238
What a difficult one...

I could make you a system if it's really important to you.
But It's pretty much impassible if you have over 25 weapons
(not impossible but would take forever) sorry but the way i see it you would have to create a different set of weapons for each hand :(
 
Last edited:
Level 9
Joined
Oct 17, 2009
Messages
370
  • Attach weapon
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • weaponattached[(Player number of (Owner of (Triggering unit)))] Equal to False
        • Then - Actions
          • Set weaponattached[(Player number of (Owner of (Triggering unit)))] = True
          • -------- Attach the weapon to the right hand --------
        • Else - Actions
          • -------- Attach the weapon to the left hand --------
Ofc you would need to set it false if he drop the First item, thats a bit trickier...
 
Status
Not open for further replies.
Top