Jump to content

Home

GetPartyMemberByIndex Function


Fallen Guardian

Recommended Posts

So I've been using the GetPartyMemberByIndex function for a bit now, and I was wondering something. If you have two party members with you, say Carth and Bastila, and you set Carth to be the party leader, is Carth still reffered to by this: GetPartyMemberByIndex(1);

 

Or is he now GetPartyMemberByIndex(0);

 

And if so, how would I get around this?

Link to comment
Share on other sites

// 577: Returns the party member at a given index in the party.
// The order of members in the party can vary based on
// who the current leader is (member 0 is always the current
// party leader).

 

The way I see it is, that Carth (if you select him as leader) is referred to as index number 0.

 

The important thing is, what do you want to do with the index number?

Say Bastila and Carth are in your group. That doesn't necessarily mean they're in the same order everytime you pick them and it also depends on who is the current leader. Carth could have index 1 or 2. So why do you want to get around the leader index 0 if the other indices are assigned (I assume) randomly?

Link to comment
Share on other sites

I need PartyMembers 1 and 2 to be moved to specific locations, and then walk to other ones. It really doesn't matter which number is Bastila and which number is Carth, so long as the PC isn't 1 or 2. So how would I set it so the PC was 0?

 

Just switch him to the party leader.

Link to comment
Share on other sites

Hmm, well while I was testing the scene I saw that the Party Member I always was before the conversation started wouldn't warp to the specific location the script told the # 2 party member to warp to. In his stead was the PC, and the location I sent the "GetFirstPC object" to warp to remained unoccupied, due to a variation in the warps' delay commands. So maybe that's just for KotOR 2?

Link to comment
Share on other sites

Alright, thanks stoffe. If I were to do something like this:

 

object oPC = GetFirstPC();
SetPartyLeader(oPC);

 

It would be the correct usage, right?

 

No, the SetPartyLeader() function uses party table slot number as parameter. NPC_PLAYER is a contant with the value -1, which means the player made character. So you do...

SetPartyLeader(NPC_PLAYER);

...to force the player char to be the active party member via scripting.

Link to comment
Share on other sites

Hmm, well while I was testing the scene I saw that the Party Member I always was before the conversation started wouldn't warp to the specific location the script told the # 2 party member to warp to. In his stead was the PC, and the location I sent the "GetFirstPC object" to warp to remained unoccupied, due to a variation in the warps' delay commands. So maybe that's just for KotOR 2?

 

It should work for KotOR too. And I believe in cutscenes or conversations the current leader stays the same but the player is put in his place. When I started a conversation with an NPC (for example Bastila) Bastila and the PC switch places and after the conversation is over I'm still controlling Bastila in her 'new' place.

 

So you'd have to switch the Player to be current leader before doing that.

Link to comment
Share on other sites

Alright, this isn't really the same type of question as I had before in this threads, though it falls under the GetPartyMemberByIndexFunction. I've used it to make the Party Members move to locations and it's worked fairly well. However, whenever they move, they do so at a face paced waddle. Is there a way to make them move normally?

Link to comment
Share on other sites

Alright, this isn't really the same type of question as I had before in this threads, though it falls under the GetPartyMemberByIndexFunction. I've used it to make the Party Members move to locations and it's worked fairly well. However, whenever they move, they do so at a face paced waddle. Is there a way to make them move normally?

 

Try using a Gff editor or the Kotor tool. They have functions that let you increase movement speed.

Link to comment
Share on other sites

Alright, this isn't really the same type of question as I had before in this threads, though it falls under the GetPartyMemberByIndexFunction. I've used it to make the Party Members move to locations and it's worked fairly well. However, whenever they move, they do so at a face paced waddle. Is there a way to make them move normally?

Unfortunately, this is "normal" in K1. However, there is a script function to decrease movement speed:

// 451: Create a Movement Speed Decrease effect.
// - nPercentChange: This is expected to be a positive integer between 1 and 99 inclusive.
//   If a negative integer is supplied then a movement speed increase will result,
//   and if a number >= 100 is supplied then the effect is deleted.
effect EffectMovementSpeedDecrease(int nPercentChange);

I haven't tested it, though.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...