lfnetwork.com mark read register faq members calendar

Thread: [TSL] Recruit Script
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 07-09-2008, 03:07 PM   #1
Ferc Kast
Modder
 
Ferc Kast's Avatar
 
Join Date: Jan 2007
Location: Tython
Posts: 1,586
Current Game: SWTOR
Helpful! Forum Veteran Contest winner - Fan Fiction Veteran Modder 
[TSL] Recruit Script

Original Thread

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.

Code:
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:
  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.

Last edited by ILoveCookies; 09-04-2009 at 08:32 PM.
Ferc Kast is offline   you may: quote & reply,
Old 07-10-2008, 07:06 AM   #2
The Betrayer
Forumite
 
The Betrayer's Avatar
 
Join Date: Nov 2007
Posts: 716
Current Game: The Godfather II
Helpful! 
Is this just a script for the recruiting part?



OMNIA MUTANTUR NIHIL INTERIT.
The Betrayer is offline   you may: quote & reply,
Old 07-10-2008, 09:55 AM   #3
Ferc Kast
Modder
 
Ferc Kast's Avatar
 
Join Date: Jan 2007
Location: Tython
Posts: 1,586
Current Game: SWTOR
Helpful! Forum Veteran Contest winner - Fan Fiction Veteran Modder 
Yes, this script is for the recruiting itself. Aside from this script, one would only need to follow Darth333's tutorial to recruit an NPC.

Ferc Kast is offline   you may: quote & reply,
Post a new thread. Add a reply to this 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 > Knights of the Old Republic > Editing / Modding > Holowan Laboratories > Tutorials: Scripting > [TSL] Recruit Script

Tags
burritos

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:40 PM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.