lfnetwork.com mark read register faq members calendar

Thread: Scripting: one one-handed weapon is wielded
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 04-30-2011, 05:09 PM   #1
aristey
Rookie
 
Join Date: May 2009
Posts: 10
Scripting: one one-handed weapon is wielded

Greetings.
I'm having some scripting problem. I need to check, if OBJECT_SELF is wielding only one one-handed weapon (in his right hand, obviously). How can this be achieved? I'm trying to do this for K1 to specify.

I tried this variant
Code:
    object leftweapon = GetItemInSlot(INVENTORY_SLOT_LEFTWEAPON , OBJECT_SELF);
    if (!GetIsObjectValid (leftweapon))
    // no weapon in left hand
    {
        object rightweapon = GetItemInSlot(INVENTORY_SLOT_RIGHTWEAPON, OBJECT_SELF);
        if (GetIsObjectValid (rightweapon))
        // some weapon in right hand; added in order to block bonuses for unarmed combat
        {
            <additional code; not related to the problem>
        }
    }
While it does work correctly for two one-handed weapons (i.e. 2 blasters) and for one one-handed weapon (i.e. blaster), it treats all two-handed weapons (i.e. blaster rifle) as one-handed.

Last edited by aristey; 04-30-2011 at 05:17 PM.
aristey is offline   you may: quote & reply,
Old 04-30-2011, 05:21 PM   #2
TimBob12
I'm in space!
 
TimBob12's Avatar
 
Join Date: Feb 2010
Location: Dantooine
Posts: 515
Current Game: Mass Effect 2!
Helpful! 
Just a guess but could it be that when you equip a two handed weapon it equips in one slot and just disables the other slot.

I will have another look though.


Hey
TimBob12 is offline   you may: quote & reply,
Old 05-01-2011, 11:19 AM   #3
aristey
Rookie
 
Join Date: May 2009
Posts: 10
Quote:
Originally Posted by TimBob12 View Post
Just a guess but could it be that when you equip a two handed weapon it equips in one slot and just disables the other slot.

I will have another look though.
Hm... Now that you've mentioned it, the idea seems quite logical. Thanks for the reply.
I've made a workaround by using GetBaseItemType(rightweapon) to exclude all two-handed weapons. Though it works, this solution is far from well-favored. I steel would prefer something else.
aristey is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > Holowan Laboratories > Scripting: one one-handed weapon is wielded

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:10 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.