Aller au contenu

Photo

Henchman atacking Chest or locked objects


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
Calva64

Calva64
  • Members
  • 16 messages
Hi All,

I know this is old news probably, but I wanted to post this for the community anyway.

As some of us know the problem with a party of multiple henchman especially one with a rogue is that the AI in NWN causes the rogue to pick the lock and the others mele henchman to attack it.

I wrote a script to stop the behavior of the melee unit only when a rogue is in the party.

So basically the rogue can pick the lock  with out interference from the other members.

It attaches to the click event of the locked object.

Here it is its for a pary of 3 henchman. Modify it to your hearts content.

void main()
{
    object oPC = GetFirstPC();
    object oHenchman1 = GetHenchman(oPC,1);
    object oHenchman2 = GetHenchman(oPC,2);
    object oHenchman3 = GetHenchman(oPC,3);
    if ((GetclassByPosition(1,oHenchman1) == class_TYPE_ROGUE && oHenchman1 != OBJECT_INVALID) ||
        (GetclassByPosition(1,oHenchman2) == class_TYPE_ROGUE && oHenchman2 != OBJECT_INVALID) ||
        (GetclassByPosition(1,oHenchman3) == class_TYPE_ROGUE && oHenchman3 != OBJECT_INVALID))
    {
        if (GetclassByPosition(1,oHenchman1) != class_TYPE_ROGUE)
        {
           DelayCommand(2.0,AssignCommand(oHenchman1,ClearAllActions()));
        }
        if (GetclassByPosition(1,oHenchman2) != class_TYPE_ROGUE)
        {
            DelayCommand(2.0,AssignCommand(oHenchman2,ClearAllActions()));
        }
        if (GetclassByPosition(1,oHenchman3) != class_TYPE_ROGUE)
        {
            DelayCommand(2.0,AssignCommand(oHenchman3,ClearAllActions()));
        }
    }
}

As you can see the possiblities for manipulation are endless this works for my upcomming game/

Regards,

Calva64

Modifié par Calva64, 03 mars 2012 - 10:42 .


#2
Shadooow

Shadooow
  • Members
  • 4 471 messages
its actually new for me, I will be able to fix it inside AI, will send the real fix as soon as I get back to the patch project again

#3
Calva64

Calva64
  • Members
  • 16 messages
well i found a real simple fix. here ti is.

    SetAssociateState(NW_ASC_RETRY_OPEN_LOCKS,FALSE);

this command stops bashing and picking of locks for a henchman.

use need the henchman include file. Thats it.

regards,

Calva64
  • Tolkiens Padawan aime ceci