lfnetwork.com mark read register faq members calendar

Thread: GetPartyMemberByIndex Function
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 02-26-2012, 09:45 PM   #1
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,286
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
GetPartyMemberByIndex Function

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?


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 02-26-2012, 10:23 PM   #2
Fastmaniac
Rookie
 
Fastmaniac's Avatar
 
Join Date: Aug 2009
Location: Germany
Posts: 164
Code:
// 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?
Fastmaniac is offline   you may: quote & reply,
Old 02-27-2012, 12:01 AM   #3
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,286
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
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?


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 02-27-2012, 12:04 AM   #4
noname35
Rookie
 
noname35's Avatar
 
Join Date: Feb 2012
Location: Nar Shadaa
Posts: 123
Current Game: KotOR 1 and 2
Quote:
Originally Posted by Fallen Guardian View Post
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.


Holowan's neediest modder
noname35 is offline   you may: quote & reply,
Old 02-27-2012, 12:17 AM   #5
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,286
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
The problem with that is, this is a cutscene that I'm scripting out, and I cannot rely on the person playing my mod to switch to the party leader in order to make the cutscene play out properly.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 02-27-2012, 12:19 AM   #6
noname35
Rookie
 
noname35's Avatar
 
Join Date: Feb 2012
Location: Nar Shadaa
Posts: 123
Current Game: KotOR 1 and 2
Ah I gottcha. Mention something in the readme about it. Thats why they're there. Hope this helps good luck


Holowan's neediest modder
noname35 is offline   you may: quote & reply,
Old 02-27-2012, 12:37 AM   #7
stoffe
Network Caretaker
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,833
Helpful! 10 year veteran! Notable contributor 
Quote:
Originally Posted by Fallen Guardian View Post
The problem with that is, this is a cutscene that I'm scripting out, and I cannot rely on the person playing my mod to switch to the party leader in order to make the cutscene play out properly.
Code:
...
SetPartyLeader(NPC_PLAYER);
...

stoffe is offline   you may: quote & reply,
Old 02-27-2012, 12:58 AM   #8
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,286
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Quote:
Originally Posted by stoffe View Post
Code:
...
SetPartyLeader(NPC_PLAYER);
...
Alright, thanks stoffe. If I were to do something like this:

Code:
object oPC = GetFirstPC();
SetPartyLeader(oPC);
It would be the correct usage, right?


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 02-27-2012, 01:03 AM   #9
VarsityPuppet
Master of Puppets
 
VarsityPuppet's Avatar
 
Join Date: May 2009
Location: MN
Posts: 1,252
Current Game: Chrono Trigger
Contest winner - Modding Forum Veteran Veteran Modder Helpful! 
If all this is going on during a dialog, I think it automatically switches your Player Character to the Party Leader.

VarsityPuppet is offline   you may: quote & reply,
Old 02-27-2012, 02:34 AM   #10
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,286
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
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?


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 02-27-2012, 06:17 AM   #11
stoffe
Network Caretaker
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,833
Helpful! 10 year veteran! Notable contributor 
Quote:
Originally Posted by Fallen Guardian View Post
Alright, thanks stoffe. If I were to do something like this:

Code:
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...
Code:
SetPartyLeader(NPC_PLAYER);
...to force the player char to be the active party member via scripting.

stoffe is offline   you may: quote & reply,
Old 02-27-2012, 09:39 AM   #12
Fastmaniac
Rookie
 
Fastmaniac's Avatar
 
Join Date: Aug 2009
Location: Germany
Posts: 164
Quote:
Originally Posted by Fallen Guardian View Post
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.
Fastmaniac is offline   you may: quote & reply,
Old 02-27-2012, 05:55 PM   #13
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,286
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Thanks both of you!


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 02-28-2012, 09:19 PM   #14
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,286
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
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?


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 02-28-2012, 10:00 PM   #15
noname35
Rookie
 
noname35's Avatar
 
Join Date: Feb 2012
Location: Nar Shadaa
Posts: 123
Current Game: KotOR 1 and 2
Quote:
Originally Posted by Fallen Guardian View Post
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.


Holowan's neediest modder
noname35 is offline   you may: quote & reply,
Old 02-29-2012, 02:28 PM   #16
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,635
Quote:
Originally Posted by Fallen Guardian View Post
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:
Code:
// 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.


JCarter426 is offline   you may: quote & reply,
Old 02-29-2012, 09:26 PM   #17
Kl0kw3rk
Rookie
 
Join Date: Jul 2007
Posts: 33
As in Force powers:
Code:
void Sp_SingleTarget(object oAnchor, effect eLink1, float fDuration1, effect eLink2, float fDuration2); ...
eLink1 = EffectMovementSpeedIncrease(99);
What are you using to command the movement?
Kl0kw3rk is offline   you may: quote & reply,
Old 03-01-2012, 02:09 PM   #18
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,635
I was thinking the good old ApplyEffectToObject. But again, I haven't tested it. Can't, you might say.


JCarter426 is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > Holowan Laboratories > GetPartyMemberByIndex Function

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:29 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.