Jump to content

Home

K1: How Do I Put NPCs In Cages?


e-varmint

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...