Reztea 34 Posted February 20, 2017 Has anyone found this out yet? I'm currently restarting my Atris project, however, I need to learn how to change my PC into one of the party members, like how the PC turns into Mira when she is about to face Hanharr? Or when your PC changes to Atton to face Sion? Get my drift? Any help is appreciated! Thanks. Quote Share this post Link to post Share on other sites
JCarter426 1,214 Posted February 21, 2017 The function is: // 11: Switches the main character to a specified NPC // -1 specifies to switch back to the original PC int SwitchPlayerCharacter(int nNPC); It looks simple enough but there are a lot of eccentricities that can cause the game to crash, and I don't entirely remember what they are. If you want to look at some examples of it in use, it can be found in my Toolbox in the script jc_party. Quote Share this post Link to post Share on other sites
Reztea 34 Posted February 21, 2017 Thanks for the quick reply! So if I wanted to switch to the original PC, the script would look like this? // 11: Switches the main character to a specified NPC// -1 specifies to switch back to the original PCint SwitchPlayerCharacter(int n-1); Sorry, it's been so long since I've even TOUCHED KotOR. Quote Share this post Link to post Share on other sites
Fair Strides 509 Posted February 21, 2017 It looks simple enough but there are a lot of eccentricities that can cause the game to crash, and I don't entirely remember what they are. If you want to look at some examples of it in use, it can be found in my Toolbox in the script jc_party. Seeing you link to the mediafire made me wonder and double-check something: was there a particular reason this never got uploaded to DS? I forget if you might have mentioned something in the LF thread or not. Quote Share this post Link to post Share on other sites
JCarter426 1,214 Posted February 21, 2017 Thanks for the quick reply! So if I wanted to switch to the original PC, the script would look like this? // 11: Switches the main character to a specified NPC // -1 specifies to switch back to the original PC int SwitchPlayerCharacter(int n-1); Sorry, it's been so long since I've even TOUCHED KotOR. No, it would be more like: void main() { int nNPC = 1; SwitchPlayerCharacter(nNPC); } Seeing you link to the mediafire made me wonder and double-check something: was there a particular reason this never got uploaded to DS? I forget if you might have mentioned something in the LF thread or not. I didn't want to upload an old version from years ago and I've been too lazy to update it to version 1.3. I meant to update it... almost exactly a year ago now. Before LF was down and I didn't have to link directly to MediaFire. I'm going to get to it in the near future, though! 1 Quote Share this post Link to post Share on other sites
Reztea 34 Posted February 21, 2017 The function is: // 11: Switches the main character to a specified NPC // -1 specifies to switch back to the original PC int SwitchPlayerCharacter(int nNPC); It looks simple enough but there are a lot of eccentricities that can cause the game to crash, and I don't entirely remember what they are. If you want to look at some examples of it in use, it can be found in my Toolbox in the script jc_party. Wow, that's a really handful tool. One more thing (Last thing aswell) May I see an example script if I wanted to switch to Mira, how would it look? As kind of a foundation script. Quote Share this post Link to post Share on other sites
JCarter426 1,214 Posted February 21, 2017 Mira is #7, so it would be like: void main() { SwitchPlayerCharacter(7): } Quote Share this post Link to post Share on other sites
Reztea 34 Posted February 21, 2017 Script worked perfectly! I can finally continue this mod with Atris! Many thanks Quote Share this post Link to post Share on other sites
Kexikus 995 Posted February 21, 2017 No, it would be more like: void main() { int nNPC = 1; SwitchPlayerCharacter(nNPC); } It should be int nNPC = -1; right? 1 would be the first party member (whoever that is) 1 Quote Share this post Link to post Share on other sites
DarthTyren 103 Posted February 21, 2017 It should be int nNPC = -1; right? 1 would be the first party member (whoever that is) Actually, it would be the second, 0 would be the first - either Bastila or Atton, depending on which game. But yes it would in fact be -1 as stated in the function description. 1 Quote Share this post Link to post Share on other sites
bead-v 251 Posted February 21, 2017 Or you can just use NPC_* constants:NPC_PLAYERNPC_ATTONNPC_BAO_DURNPC_CANDEROUSNPC_G0T0NPC_HANDMAIDENNPC_HK_47NPC_KREIANPC_MIRANPC_T3_M4NPC_VISASNPC_HANHARRNPC_DISCIPLE Wow, I even got the order right without checking Quote Share this post Link to post Share on other sites
JCarter426 1,214 Posted February 21, 2017 It should be int nNPC = -1; right? 1 would be the first party member (whoever that is) Oh, yes. -1 is the player. Move along. Quote Share this post Link to post Share on other sites