Something wrong with unequip slot/ hands

I’ve got a conversation and I’m trying to get some companions to have nothing in their hands, I’ve put in their tags and slot numbers ( if required ) and used the ga_unequip slot/ hands scripts on the relevant conversation line… But nothing happens, they’re still waving their weapons about.

I put the unequip slot scripts on another conversation for one of the companions and it worked just fine, exactly the same tag and slot numbers, nothing different. The only difference being that this time the companion clearing the slots owned the conversation.

So do the ga_unequip scripts only work for the owner of the conversation and is something wrong with them because it looks like it ?

Any ideas ? My companions are looking daft waving weapons about when their supposed to be drinking, one keeps poking her eye out with a dagger and drinking whilst holding a scythe just has to be impossible !

fighting bugs but this is workin on my end

// 'ga_nohands'
/*
    Conversation action script.

    Unequips left and right hands of
    - PC and Companions if sTarget is PC faction
    - a single NPC if sTarget is not PC faction

    sTarget - tag or $const in 'ginc_param_const'
              eg. "$PC" for GetPCSpeaker()
*/

#include "ginc_param_const"
#include "nw_i0_spells"

void unequip(object oTarget);

//
void main(string sTarget)
{
    float fDelay = 0.f;

    object oTarget = GetTarget(sTarget);
    if (GetIsObjectValid(oTarget))
    {
        if (GetIsObjectValid(GetFactionLeader(oTarget))) // is PC faction
        {
            object oParty = GetFirstFactionMember(oTarget, FALSE);
            while (GetIsObjectValid(oParty))
            {
                if (GetAssociateType(oParty) == ASSOCIATE_TYPE_NONE)
                    DelayCommand(fDelay, AssignCommand(oParty, unequip(oParty)));

                fDelay += GetRandomDelay(0.1f, 0.65f);
                oParty = GetNextFactionMember(oTarget, FALSE);
            }
        }
        else // is NPC
            AssignCommand(oTarget, unequip(oTarget));
    }
    else
        SendMessageToPC(GetFirstPC(FALSE), "ga_nohands - target not found");
}

//
void unequip(object oTarget)
{
    ClearAllActions();

    object oIt = GetItemInSlot(INVENTORY_SLOT_LEFTHAND);
    if (GetIsObjectValid(oIt))
        ActionUnequipItem(oIt);

    oIt = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND);
    if (GetIsObjectValid(oIt))
        ActionUnequipItem(oIt);
}
2 Likes

I might try your script too, @kevL_s . Thanks for your addition!

@Tsongo Most of the time I’ve noticed that the ga_unequip works, but not all the time. I’ve experienced this bug as well, as a matter of fact. Don’t know why it doesn’t always work. I’ve just added this ga_unequip to three dialogues myself where I had forgotten to. I’ll try and see if it works there, but otherwise I might be inclined to try out kevL_s’ script here.

What’s nice about kevL_s’ script is that it goes through all the companions and the PC and unequips all, instead of doing like 6 “lines” in a dialogue node where you unequip stuff for the PC and maybe two companions.

2 Likes

at first i thought ClearAllActions() would break the dialog, but it turned out to be key to getting things working

1 Like

Before I try your script out, @kevL_s… Do I interpret your script correctly by assuming if I in the conversation node type sTarget as $PC, then the PC and all companions will unequip their hands?

Gaah! Forget it. I’m stupid. I didn’t read your description. It says it there. Sigh.

hehe
those $const things had me boggled back in the day …

Sometimes I just doesn’t read carefully.

I tried your script out ingame. Works like a charm!

1 Like

exercise for the observer …

  1. narrow the scope of fDelay
  2. don’t increment fDelay unnecessarily (perhaps)
  3. find and remove the unused var in unequip()

kevL_s… Sorry for posting and disappearing I went to bed having spent ages reloading and trying different ga unequip combinations but now there is no need because… Your script works perfectly and now my companions can drink without looking ridiculous ! You’ve done a better job than ChazM ( original script writer whoever he may be ) did fourteen years ago !

So many thanks for that and give yourself a pat on the back safe in the knowledge that no eyes will be poked out by drunken npcs in the future ! Your masterpiece, that I’m not going to attempt to understand, is now a template known as kevL_s hands free kit !

andgalf… There’s definitely something wrong with it but I can’t see why it’s not wrong all the time unless it’s something to do with who owns the conversation or is talking at the time. Maybe if it’s a pc faction member talking it works or vice versa when the conversation isn’t owned by a companion. A mystery ! But kevL_s’ scripts much better and you’re right only typing in one tag is really good too !

Another weird thing that happened with equipping/ unequipping slots was that I’ve got a companion who puts some robes and a hood on before meeting the public because she’s a bit strange and sometimes it works and other times it works but the change doesn’t show up in the cutscene when it happens.

If you click on her portrait she instantly changes clothes. I’m not really bothered about it but it’s strange because it’s the same script and same disguise every time.

3 Likes

one of the problems I think with the stock scripts is that as soon as a partymember starts a dialog the rest of the party stops in its tracks, with their ActionMoveToPoint put temporarily on pause in their action queues. But since unequipping is also an action, the paused move-action prevents the unequip-action from occurring … maybe

Wow there’s a solution button and it goes green if the original poster presses it !

1 Like

I noticed something that sounds very similar when fooling around with unequipping partymembers. The uncontrolled characters did not unequip – only the controlled character (ie. pc-speaker) did. But when i then stopped the dialog and clicked to take control of an uncontrolled character (eg. click on its portrait) it immediately unequipped … wtf? (but then if i clicked yet another uncontrolled character it was too late, no more unequips happened although id think they should have…)

the issue was resolved w/ short delays and ClearAllActions()

kevL_s… There’s definitely something strange going on and it’s erratic so there’s some sort of confusion which must mean the reset of ClearAllActions helps it concentrate on the task at hand. I’m just going to use your script and unequip everybody from now.

If I’d had it before it would’ve been good for city guards and starting fights if you don’t sheathe your weapons but I don’t think I’ve got any city guards to make now.

1 Like