PDA

View Full Version : K1: How Do I Put NPCs In Cages?


e-varmint
07-15-2007, 11:27 PM
Does anyone know how to put an NPC in a force cage or regular cage, and how to remotely open several cages at once? I tried looking for script examples, but there are no .nss files for Koriban or Taris that show how the force cages open from computer panels.

Will ActionOpenDoor work on a placeable like a cage?

TheRealDem
07-15-2007, 11:28 PM
I think theres a mod that will let you open the nearest door for K1

swfan28
07-16-2007, 04:13 AM
Originally Posted by vornskrsrevenge
Does anyone know how to put an NPC in a force cage or regular cage, and how to remotely open several cages at once? I tried looking for script examples, but there are no .nss files for Koriban or Taris that show how the force cages open from computer panels.

Will ActionOpenDoor work on a placeable like a cage?
I think you can put an NPC into a cage just by spawning the cage and an NPC in same location by editing the GIT-file. To open the cages use the ANIMATION_PLACEABLE_OPEN by attaching this script to the computer panel's dialogue.
void main()
{
object ocage1 = GetObjectByTag("Cage1_tag", 0);
object ocage2 = GetObjectByTag("Cage2_tag", 0);

AssignCommand(oCage1, ActionPlayAnimation(202, 1.0, 0.0));
AssignCommand(oCage2, ActionPlayAnimation(202, 1.0, 0.0));
}
You should probably also teleport the NPC's outside the cages when opened or they might get stuck in them.

stoffe
07-16-2007, 06:33 AM
Does anyone know how to put an NPC in a force cage or regular cage, and how to remotely open several cages at once? I tried looking for script examples, but there are no .nss files for Koriban or Taris that show how the force cages open from computer panels.


I'm not sure if it works the same in KOTOR 1, but in KOTOR 2 a force cage is turned on using placeable animations to make the force field appear. This is just a visual effect though, and you could walk right through the force field. To prevent this an invisible blocker placeable (using the "ForceCageBlocker" placeable type) is spawned around the cage that prevents NPCs or the player to move out of it. This placeable has no visible model, but has a circular walkmesh that prevents walking through it. When the force field is deactivated this placeable is destroyed as well to allow moving out of the cage.

e-varmint
07-16-2007, 03:54 PM
Thanks swfan28 and stoffe!!! I'll put this info. to good use.