Post by Keets on Jul 31, 2008 14:36:24 GMT -5
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.
~~Download script~~
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:
- 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.
- 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.)
- Next, change "YOUR_NPC_RESREF" to the resref from the recruited NPC's utc. (I.E. "p_test")
- 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.