• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Item Wielding

Status
Not open for further replies.
Level 2
Joined
May 20, 2009
Messages
7
I'm trying to create a trigger is when a unit clicks on a weapon a model will appear on the units arm. Kind of like Master crafters. But you click on the item to equip it.
 
Level 12
Joined
May 21, 2009
Messages
994
You mean like when you pick up a sword then you get it in the right hand ?
Or
if you click the weapon on the ground you get it in the hand ?

if 1 then Download a weapon model then create an ability for instance: Devetion aura set everything to 0 and make the effect to the weapon model add the ability to the item you want and you get it.
Attachments: hand, right or hand, left if weapon

if 2 then make trigger
  • Event Response - Unit is selected
  • Condition - selected unit equal to YOURITEM/UNIT
  • action
  • destroy special effect - udg_Specialeffect
  • Create special effect on unit - hand, right (the effect).
  • set special effect = last created special effect
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Are the items actually items, or can you create units instead?
If you can create units instead of those items, you can use a selection-event.

e.g.: When the unit is right-clicked (A units is issued targetting an object), you can remove the unit and replace it with an item (and give the item to the hero), but when it is selected, your trigger activates...
 
Level 2
Joined
May 20, 2009
Messages
7
Well actually i want the thing to be the same model except with the weapon equiped on it. For example when they equip a sword the sword appears on the model's hand.
 
Level 4
Joined
Apr 25, 2008
Messages
75
Quick answer here. I don't really know much but my map making buddy has done something like this, I'll open his map up in like 5 mins and see how he does it. But you might want to read this:
http://world-editor-tutorials.thehelper.net/attachments.php
It's a tutorial on attachments. That's where I would go to start with.
You can also just use a trigger to attach a model or special effect. Just use this trigger action.
Special Effect - Create a special effect attached to the left hand of (Triggering unit) using Sword1.mdx

EDIT: Okay, I checked my mate's map. The way he's done is like the tutorial. He's added attachment points to an ability and given the ability to an item. Of course this shows when you pick it up. Maybe you could try making the item turn into another item (or another form) which has the ability with the attachments. Because a problem I see with your way is that it will still get the bonus (eg. +100 damage) even if the item hasn't been clicked (it's just sitting in their inventory).

As for how to switch the item I would have no idea (through object editor) because I'm pretty bad with object editor but it could be simple in the trigger editor. (Be sure to remove the old item first so that there is an empty slot).
 
Level 6
Joined
Sep 5, 2007
Messages
264
What you do to "swap" an item:
Create a "dummy" ability using an ability that doesn't need a target, but still requires it to be used (eg: berserk)
Loop through all 6 slots of the characters inventory, finding which one the item being used is in.... store that slot number in a variable.
Remove the "swapping" item, and create the new one in slot number that you stored. :thumbs_up:
 
Level 12
Joined
May 21, 2009
Messages
994
You make a dummy ability whit got the target your self on your hand, right if its a weapon then you make the target effect to the weapon you want and then give the ability to an item so when you equip it you get it in your right hand
 
Status
Not open for further replies.
Top