Jump to content

Home

Recruiting


darthtyren

Recommended Posts

Posted

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?

Posted

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?

Posted

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.

Posted

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?

Posted

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();
          [color="DarkOrange"]DelayCommand(1.5, StartNewModule("003EBO","","","","","","",""));[/color]
   }
}

 

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.

Posted

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();
          [color="DarkOrange"]DelayCommand(1.5, StartNewModule("003EBO","","","","","","",""));[/color]
          SendMessageToPC(oPC, cmMessage);
   }
}

Posted

OK so this is the party selection screen before the conversation:

 

Show spoiler
(hidden content - requires Javascript to show)
swkotor2201107192100069.jpg

 

And after:

 

Show spoiler
(hidden content - requires Javascript to show)
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.

Posted

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

Posted

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?

Posted

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

Posted

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?

Posted

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

Archived

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

×
×
  • Create New...