Jump to content

Home

Two Needed Scripts


harIII

Recommended Posts

Can anyone provide me with two scripts?

 

I need the first one to find an NPC and then make him go into stealth mode indefinitely upon him spawning.

 

The second one needs to take that NPC out of stealth mode whenever it's fired which will be dialog.

 

Thanks for any help in advance.

Link to comment
Share on other sites

To make the NPC go into stealth mode, you could do something like this:

 

void main()
{

  object oNPC = GetObjectByTag("NPC");
  object oBelt = GetObjectByTag("g_i_belt006");

     AssignCommand(oNPC, ActionUseSkill(SKILL_STEALTH, oNPC, 0, oBelt));

}

 

This requires the NPC to have gi_belt006 (the generic stealth field generator in KotOR 1) equipped. I'm pretty sure there's another way to go about using stealth, but I've never figured it out.

 

To make the NPC go out of stealth mode I assume you could just call a simple ClearAllActions and ClearAllEffects, such as below.

 

void main()
{

  object oNPC = GetObjectByTag("NPC");

     AssignCommand(oNPC, ClearAllActions());
     AssignCommand(oNPC, ClearAllEffects());


}

 

I'm pretty certain however that an active participant in a conversation is automatically taken out of stealth mode (at least the PC always is).

Link to comment
Share on other sites

Fallen Gaurdian nailed the first script but if your NPC was doing another action I wouldn't use the second script might I suggest just taking the belt away from the NPC?

 

 

Code:

void main ()
{

object oNPC = GetObjectByTag("my_npc");
object oArmor = GetItemInSlot(INVENTORY_SLOT_BELT,oNPC); 
AssignCommand(oNPC, ActionUnequipItem(oArmor, TRUE));
}

Link to comment
Share on other sites

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...