Reztea

Changing your PC to a party member?

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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!

  • Like 1

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Script worked perfectly! I can finally continue this mod with Atris! Many thanks

Share this post


Link to post
Share on other sites

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)

  • Like 1

Share this post


Link to post
Share on other sites

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.

  • Like 1

Share this post


Link to post
Share on other sites

Or you can just use NPC_* constants:
NPC_PLAYER
NPC_ATTON
NPC_BAO_DUR
NPC_CANDEROUS
NPC_G0T0
NPC_HANDMAIDEN
NPC_HK_47
NPC_KREIA
NPC_MIRA
NPC_T3_M4
NPC_VISAS
NPC_HANHARR
NPC_DISCIPLE

 

Wow, I even got the order right without checking B)
 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.