Two Handed Weapons and Dual Wielding

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Gradunk
Posts: 54
Joined: Tue Oct 22, 2013 2:26 am
Location: Calgary, Canada

Two Handed Weapons and Dual Wielding

Post by Gradunk »

? is this possible?
Last edited by Gradunk on Mon Jun 23, 2014 11:53 pm, edited 1 time in total.
I smell you, i do! You GRADUNK! No be hiding on TORGAL!
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: Two Handed Weapons?

Post 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).
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: Two Handed Weapons?

Post 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
Gradunk
Posts: 54
Joined: Tue Oct 22, 2013 2:26 am
Location: Calgary, Canada

Re: Two Handed Weapons?

Post 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.
I smell you, i do! You GRADUNK! No be hiding on TORGAL!
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: Two Handed Weapons?

Post by msyblade »

setMouseItem(spawn("brass_key"))
Currently conspiring with many modders on the "Legends of the Northern Realms"project.

"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: Two Handed Weapons?

Post 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
User avatar
Allanius2
Posts: 124
Joined: Mon Apr 14, 2014 10:12 pm

Re: Two Handed Weapons?

Post 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.
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: Two Handed Weapons?

Post 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.
Gradunk
Posts: 54
Joined: Tue Oct 22, 2013 2:26 am
Location: Calgary, Canada

Re: Two Handed Weapons?

Post 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?
I smell you, i do! You GRADUNK! No be hiding on TORGAL!
User avatar
Allanius2
Posts: 124
Joined: Mon Apr 14, 2014 10:12 pm

Re: Two Handed Weapons?

Post 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. :)
Post Reply