Jump to content

Home

[TSL] Recruit Script


Ferc Kast

Recommended Posts

This is a recruit script I made a while back for TSL. I decided to finally release this as free source. You can use it in your TSL recruit mods, as long as you credit me in your readme file. This script has been tested, to ensure best results.

 

void main(){
   int iAction = GetScriptParameter(1);
   if ( iAction == 1 ){
       // Recruit "sNPC"
       int iNPC = GetScriptParameter(2);
       string sNPC = GetScriptStringParameter();
          RemoveAvailableNPC(iNPC);
          AddAvailableNPCByTemplate(iNPC, sNPC);
          DelayCommand(1.5,ShowPartySelectionGUI());
   }
   else if ( iAction == 2 ){
       // Eliminate "Twins"
       string sNPC = GetScriptStringParameter();
       object oNPC = GetObjectByTag(sNPC);
          ActionPauseConversation();
          SetGlobalFadeOut(1.0, 0.5);    
          DelayCommand(1.0, DestroyObject(oNPC));
          DelayCommand(1.0,SetGlobalFadeIn(0.7,0.0));
          ActionResumeConversation();
   }
}

 

Here's how to attach the script to your dialog:

recruit.png

  1. Click on your last entry or reply in your dialog, then fill in the script #1 & script #2 rows with the values from the above picture.
  2. In script #1, replace the 3 with the number of the NPC that you will replace. (Here is a list of the TSL NPC numbers.)
  3. Next, change "YOUR_NPC_RESREF" to the resref from the recruited NPC's utc. (I.E. "p_test")
  4. In script #2, replace "YOUR_NPC_TAG" to the tag of the pre-recruited NPC's utc. (I.E. "p_test001")

 

Note that this script & tutorial will only work in KotOR II: The Sith Lords, and not in KotOR I.

Link to comment
Share on other sites

  • 1 month later...

Archived

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

×
×
  • Create New...