LucasForums (
-   Holowan Laboratories (
-   -   Two Needed Scripts (

harIII 05-19-2013 02:02 PM

Two Needed Scripts
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.

Fallen Guardian 05-19-2013 02:24 PM

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).

supreme kotor 05-19-2013 02:37 PM

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?


void main ()

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

Hassat Hunter 05-20-2013 05:24 AM

Alternatively, just spawn him in case #2 with the out of stealth effect, like the Sith Assassins on Peragus. No need to have around before...

Qui-Gon Glenn 06-01-2013 03:35 PM

I did something almost exactly like this once.

Sith Stalker code in the Script Shack should cover 99% of this.

All times are GMT -4. The time now is 01:31 AM.

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