Page 1 of 3

Two Handed Weapons and Dual Wielding

Posted: Mon Jun 23, 2014 12:04 am
by Gradunk
? is this possible?

Re: Two Handed Weapons?

Posted: Mon Jun 23, 2014 12:08 am
by JohnWordsworth
While I can't think of an easy way to 'block' the other hand, you could quite simply make it so that attacking with a certain weapon requires the other hand to be empty. You would create an onAttack hook for the Party. In there, check for the ID of the weapon used for the attack - if it matches your weapon ("two_handed_sword") say, then you would check that champions 'other hand' slot for an item. If it's got something in it, printHud("This weapon requires two hands") and return false (which cancels the attack).

Re: Two Handed Weapons?

Posted: Mon Jun 23, 2014 12:53 am
by Isaac
My thought a few days ago on this, would be to have code in the onEquipItem & onUnEquipItem hooks to forcibly add two weapon halves to slot 7 & 8.
Such that to add the weapon to either hand populates both, and to remove it removes both. All the designer needs is two icons (right & left) that meet, or even slightly overlap in the middle.
Image

Re: Two Handed Weapons?

Posted: Mon Jun 23, 2014 3:00 am
by Gradunk
Isaac you're bang on with how i was thinking to do it. but i'm wondering about the item swapping part. If the champion has things in both its hands, i can't make both of them go to the mouse pointer, and i can't be sure a specific inventory space would be empty. i don't know how i would code that.
and i can't find anywhere what the command for putting things in or out of the mouse pointer is.

Re: Two Handed Weapons?

Posted: Mon Jun 23, 2014 4:32 am
by msyblade
setMouseItem(spawn("brass_key"))

Re: Two Handed Weapons?

Posted: Mon Jun 23, 2014 4:35 am
by Isaac
Gradunk wrote:Isaac you're bang on with how i was thinking to do it. but i'm wondering about the item swapping part. If the champion has things in both its hands, i can't make both of them go to the mouse pointer, and i can't be sure a specific inventory space would be empty. i don't know how i would code that.
and i can't find anywhere what the command for putting things in or out of the mouse pointer is.
SetMouseItem(item)
One snag with this idea is that the icon may look great in the hands, but will look odd split apart in the character sheet. Odd looking, but you'd have two handed weapons. 8-)

**Aha... I was too slow. :D

Re: Two Handed Weapons?

Posted: Mon Jun 23, 2014 5:58 am
by Allanius2
Isaac wrote:SetMouseItem(item)
One snag with this idea is that the icon may look great in the hands, but will look odd split apart in the character sheet. Odd looking, but you'd have two handed weapons. 8-)
I believe I've seen this done in another game where the hand the 2H weapon was placed in had the full icon and the other hand was either greyed out or had a semi transparent copy of the icon. This would eliminate the problem of the inventory half icons.

Re: Two Handed Weapons?

Posted: Mon Jun 23, 2014 7:31 am
by Isaac
Allanius2 wrote:
Isaac wrote:SetMouseItem(item)
One snag with this idea is that the icon may look great in the hands, but will look odd split apart in the character sheet. Odd looking, but you'd have two handed weapons. 8-)
I believe I've seen this done in another game where the hand the 2H weapon was placed in had the full icon and the other hand was either greyed out or had a semi transparent copy of the icon. This would eliminate the problem of the inventory half icons.
Not really ~unless I'm missing something. The character sheet duplicates the item icon on the paper-doll. So where the two icons would meet on the portrait GUI (in the lower right); those duplicated icons would not meet up in the character sheet/ paper-doll.

The greyed out icon is easy to do as the [off-hand] weapon's icon, but not if it was to be ½ of the weapon image across both hands; it would have to be two swords, one grey-transparent, the other solid (as usual).

**Aside: It seems rather complicated to delete an item in a champion slot from within an onUnEquipItem hook. The item's onUnEquipItem hook is run when you call removeItem(). :shock:
It might have to require a script object on the map for a timer to call to delete both halves of the weapon. :(

I have a script that handles the double item two handed weapon... but deleting both items when the player can arbitrarily pick up either one of them first has been challenging to attempt ~without a spawned timer and separate script object.

Re: Two Handed Weapons?

Posted: Mon Jun 23, 2014 9:45 pm
by Gradunk
Instead of half items i was thinking of just making it two one handed weapons of the same type, but force the person to have both hands empty in order to equip it. Then once it is equipped, spawn the second weapon in the other hand. I think that would be the easiest way wouldn't it?

as you said the greyed out off hand. is that just an image that you'd place in the hand or something?

Re: Two Handed Weapons?

Posted: Mon Jun 23, 2014 10:13 pm
by Allanius2
Gradunk wrote:Instead of half items i was thinking of just making it two one handed weapons of the same type, but force the person to have both hands empty in order to equip it. Then once it is equipped, spawn the second weapon in the other hand. I think that would be the easiest way wouldn't it?

as you said the greyed out off hand. is that just an image that you'd place in the hand or something?
Exactly. :)