darthtyren Posted July 18, 2011 Share Posted July 18, 2011 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. Link to comment Share on other sites More sharing options...
Fastmaniac Posted July 18, 2011 Share Posted July 18, 2011 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 More sharing options...
darthtyren Posted July 18, 2011 Author Share Posted July 18, 2011 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? Link to comment Share on other sites More sharing options...
Fastmaniac Posted July 19, 2011 Share Posted July 19, 2011 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 More sharing options...
darthtyren Posted July 19, 2011 Author Share Posted July 19, 2011 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? Link to comment Share on other sites More sharing options...
Fastmaniac Posted July 20, 2011 Share Posted July 20, 2011 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 More sharing options...
darthtyren Posted July 20, 2011 Author Share Posted July 20, 2011 It's not showing me the party selection screen at all, nor is it warping me to the Ebon Hawk. Link to comment Share on other sites More sharing options...
Fastmaniac Posted July 20, 2011 Share Posted July 20, 2011 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. Link to comment Share on other sites More sharing options...
Ferc Kast Posted July 20, 2011 Share Posted July 20, 2011 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 More sharing options...
darthtyren Posted July 20, 2011 Author Share Posted July 20, 2011 OK so this is the party selection screen before the conversation: Show spoiler (hidden content - requires Javascript to show) And after: Show spoiler (hidden content - requires Javascript to show) 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 More sharing options...
Fastmaniac Posted July 20, 2011 Share Posted July 20, 2011 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... Link to comment Share on other sites More sharing options...
darthtyren Posted July 20, 2011 Author Share Posted July 20, 2011 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 More sharing options...
Fastmaniac Posted July 20, 2011 Share Posted July 20, 2011 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 More sharing options...
darthtyren Posted July 21, 2011 Author Share Posted July 21, 2011 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? Link to comment Share on other sites More sharing options...
Fastmaniac Posted July 21, 2011 Share Posted July 21, 2011 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 More sharing options...
darthtyren Posted July 21, 2011 Author Share Posted July 21, 2011 That worked. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.