lfnetwork.com mark read register faq members calendar

Thread: Recruit Function
Thread Tools Display Modes
Post a new thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Prev Previous Post   Next Post Next
Old 06-16-2012, 07:54 PM   #1
Ferc Kast
@Ferc Kast
Ferc Kast's Avatar
Join Date: Jan 2007
Location: Tython
Posts: 1,587
Current Game: KotOR, SWTOR
Helpful!  Forum Veteran  Contest winner - Fan Fiction  Veteran Modder 
Recruit Function

Original Thread

Recruit Function

Latest Version: 1.0
Supports: KotOR I and KotOR II
Download: Kast's Echo | Deadly Stream

This Recruit Function allows you to recruit NPCs as new party members. It was designed to ease the amount of scripting to make a recruit mod.

Not-so-long in a galaxy not-too-far away, I once created a recruit script that eased the process of creating a recruit mod for TSL only. It always felt a little unjust that TSL modders should get that burden eased while KotOR I modders still had to suffer through the old (and semi-lengthy) way of coding a recruit script. I think this should both further ease the process of TSL recruitment mods & finally relieve the process for KotOR I recruitment mods somewhat.

This tutorial will not go over the process of making a (existing or new) NPC recruit mod; this tutorial only covers making the script which will recruit the NPC. For a tutorial about the rest of the process of making a recruit mod, see this tutorial by Darth333.

Installation and Use
You need to place the “ke_recruit.nss” script in your K1 or TSL override, depending upon the game for which you are making the recruit mod. To use the function, add the line
#include “ke_recruit”
at the beginning of your recruit script.

A) Recruit NPC
First, include this function in your script.
RecruitA(iNPC, sResRef);
iNPC = The integer value/variable of the replaced party member
sResRef = The string value of your post-recruitment UTC ResRef

These are the various NPC integer values/variables.
// KotOR I NPC integer values/variables.
int NPC_BASTILA         = 0;
int NPC_CANDEROUS       = 1;
int NPC_CARTH           = 2;
int NPC_HK_47           = 3;
int NPC_JOLEE           = 4;
int NPC_JUHANI          = 5;
int NPC_MISSION         = 6;
int NPC_T3_M4           = 7;
int NPC_ZAALBAR         = 8;

// KotOR II NPC integer values/variables.
int NPC_ATTON           = 0;
int NPC_BAO_DUR         = 1;
int NPC_CANDEROUS       = 2;
int NPC_G0T0            = 3;
int NPC_HANDMAIDEN      = 4;
int NPC_HK_47           = 5;
int NPC_KREIA           = 6;
int NPC_MIRA            = 7;
int NPC_T3_M4           = 8;
int NPC_VISAS           = 9;
int NPC_HANHARR          = 10;
int NPC_DISCIPLE        = 11;
B) Eliminate Twins
If you also wish to eliminate the original pre-recruited party member from the module, simply include this function in your script.
sNPC = The string value of your pre-recruitment UTC Tag

Example Script
I thought I'd be nice and show an example of a working script; This is for a K1 recruit mod, but it works the same for TSL aside from NPC integer values.
#include "ke_recruit"
void main(){
	string sResRef = "p_ice";
	string sNPC = "Ice021";
	RecruitA(iNPC, sResRef);
That’s all, folks! Please, leave your feedback below.

Last edited by Ferc Kast; 11-13-2012 at 07:58 PM.
Ferc Kast is offline   you may: quote & reply,
Post a new thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Star Wars Gamer > Community > The Star Forge > Knights of the Old Republic series > Holowan Laboratories > Tutorials > Tutorials: Scripting > Recruit Function

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -4. The time now is 08:01 PM.

Powered by vBulletin®
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.