Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Recruiting

Page: 1 of 1
 darthtyren
07-18-2011, 8:33 AM
#1
I've been following this tutorial to recruit an NPC : http://lucasforums.com/showthread.php?t=190717)

I do everything specified in this tutorial, but when I come to choose the option to recruit them, they just disappear.
 Fastmaniac
07-18-2011, 9:24 AM
#2
There are some reasons for the script not working... Did you check the party selection screen, whether your NPC has been added?

- If yes, the script is running fine. You should rebuild your party by unselecting, applying, and reselecting the party.

- If no, are you sure you entered the Template_Resref in the dialog options and not the tag? Or did you enter a wrong number inside of the boxes?
 darthtyren
07-18-2011, 1:10 PM
#3
The answer is yes, so I'm guessing it's because I'm using one of the Malachor modules, because I just can't select him into my party.

With that said, how do I fix that?
 Fastmaniac
07-19-2011, 3:16 AM
#4
Well, when you're on a malachor module you can't choose your party because you have to use one character at a time (your main character, Mira/Hanharr, Remote...). You can fix that by recruiting the NPC on another module (not Malachor) or you can use the KSE to build your party (haven't tried that before, but I guess it'll work). But if your NPC shows up in the party screen, then the script has done its job.
 darthtyren
07-19-2011, 7:31 AM
#5
OK, so how about after the script fires to recruit the NPC, then I want to automatically leave the planet, with my NPC and me both inside the ship. How would I do that?
 Fastmaniac
07-19-2011, 9:02 PM
#6
So what your saying is: You have nearly made it through the whole game and you want to be back at the Ebon Hawk? Hmm... ok...

I'd do that with a little modification to Ferc Kast's script (Changes in orange):


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();
DelayCommand(1.5, StartNewModule("003EBO","","","","","","",""));
}
}


That will cause the script to wait 1.5 Seconds for you to open the Party screen (which is triggered by the script itself) and then it will warp you to the Ebon Hawk Module.

Now you put this new script into the dialog instead of a_recruit.
 darthtyren
07-19-2011, 9:28 PM
#7
It's not showing me the party selection screen at all, nor is it warping me to the Ebon Hawk.
 Fastmaniac
07-19-2011, 9:36 PM
#8
Well, are you sure your NPC is even being recruited? According to the script the party screen has to open when your npc is recruited.
 Ferc Kast
07-19-2011, 10:00 PM
#9
To make sure the script is actually running properly, use this script. (Needs to be compiled into .ncs, of course) Look for the 2 messages in the Feedback menu; Then, report if either both show up, only 1 shows up or if neither show up.



void main(){
int iAction = GetScriptParameter(1);
if ( iAction == 1 ){
// Recruit "sNPC"
int iNPC = GetScriptParameter(2);
string cmMessage = "NPC has been recruited";
string sNPC = GetScriptStringParameter();
object oPC=GetFirstPC();
RemoveAvailableNPC(iNPC);
AddAvailableNPCByTemplate(iNPC, sNPC);
DelayCommand(1.5,ShowPartySelectionGUI());
SendMessageToPC(oPC, cmMessage);
}
else if ( iAction == 2 ){
// Eliminate "Twins"
string cmMessage = "Original UTC eliminated";
string sNPC = GetScriptStringParameter();
object oNPC = GetObjectByTag(sNPC);
object oPC=GetFirstPC();
ActionPauseConversation();
SetGlobalFadeOut(1.0, 0.5);
DelayCommand(1.0, DestroyObject(oNPC));
DelayCommand(1.0,SetGlobalFadeIn(0.7,0.0));
ActionResumeConversation();
DelayCommand(1.5, StartNewModule("003EBO","","","","","","",""));
SendMessageToPC(oPC, cmMessage);
}
}
 darthtyren
07-19-2011, 10:19 PM
#10
OK so this is the party selection screen before the conversation:

http://img12.imageshack.us/img12/6674/swkotor2201107192100069.jpg)

And after:

http://img847.imageshack.us/img847/8440/swkotor2201107192100325.jpg)

The way it looks, I am doing things right. I don't have a portrait yet.

EDIT
Also, Ferc Kast, I tried to compile the above script and it didn't recognize the new commands.
 Fastmaniac
07-20-2011, 11:42 AM
#11
Well compiling is not a problem... But I tried to use it ingame and it really isn't showing the party selection screen nor it warps to the ebon hawk... It isn't even showing the Message...That seems very odd to me...
 darthtyren
07-20-2011, 12:25 PM
#12
I'm glad I'm not the only one having this problem.

Hmm, I look in the nwscript at the StartNewModule function, and this is what shows:

// 509: Shut down the currently loaded module and start a new one (moving all
// currently-connected players to the starting point.

void StartNewModule(string sModuleName, string sWayPoint="", string sMovie1="", string sMovie2="", string sMovie3="", string sMovie4="", string sMovie5="", string sMovie6="");

Concerning the void at the beginning of the base function, maybe it's supposed to be at the beginning of the script?
 Fastmaniac
07-20-2011, 1:08 PM
#13
Void is being used when no data is initially going to be returned. It's different from Conditionals that return either FALSE or TRUE. Now: On the top of the script it says: "void main()". that means you can use void functions that are declared in nwscript.nss. The order of the functions doesn't matter. Plus: If you start a new module on the beginning the rest of the script will be aborted...
 darthtyren
07-20-2011, 9:26 PM
#14
Then maybe I can make a new script and have it fire immediately after the NPC becomes a part of my party. Maybe I could use the ExecuteScript command?

Or, another thought, maybe it's not working because there is no movie playing?
 Fastmaniac
07-21-2011, 9:44 AM
#15
Okay, I got it working now...


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));
ActionWait(1.5);
StartNewModule("003EBO","","","","","","","");
ActionResumeConversation();

}
}


Seemed like the StartnewModule function doesn't fit with DelayCommand... But I tested it and this should work...
 darthtyren
07-21-2011, 10:59 AM
#16
That worked. Thanks.
Page: 1 of 1