Jump to content

Home

Recruiting


darthtyren

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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);
   }
}

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...