harIII Posted May 19, 2013 Share Posted May 19, 2013 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 More sharing options...
Fallen Guardian Posted May 19, 2013 Share Posted May 19, 2013 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 More sharing options...
supreme kotor Posted May 19, 2013 Share Posted May 19, 2013 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 More sharing options...
Hassat Hunter Posted May 20, 2013 Share Posted May 20, 2013 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... Link to comment Share on other sites More sharing options...
Qui-Gon Glenn Posted June 1, 2013 Share Posted June 1, 2013 I did something almost exactly like this once. Sith Stalker code in the Script Shack should cover 99% of this. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.