Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

DEtecting if the PC is not with any party member

Page: 1 of 1
 Xavier2
12-29-2004, 5:11 PM
#1
What should be the script to detect if the PC is alone without any party members?

I tried to use the search but wasn't succesfull. I also looked in the Genoharadan guy in Manaan, but there aren't any source scripts for that...:(

Thanks in advance,

Xavier2:D
 T7nowhere
12-29-2004, 5:23 PM
#2
I know almost nothing about scripting But, I would say its a conditional that checks for Party members.

Hmm. If you look in the script sources there are conditionals that are used to see if a npc is or is not a party member. I wonder if you could just combine all the not party member scripts and attach that to the dialog line that you only want to show if the PC is alone(I assume thats what you want to do)
 Xavier2
12-29-2004, 5:35 PM
#3
Originally posted by T7nowhere
I know almost nothing about scripting But, I would say its a conditional that checks for Party members.

Hmm. If you look in the script sources there are conditionals that are used to see if a npc is or is not a party member. I wonder if you could just combine all the not party member scripts and attach that to the dialog line that you only want to show if the PC is alone(I assume thats what you want to do)
There is the default k_con_partymembernpm.nss source script. They all use a command line like this:
int StartingConditional()
{
return !IsNPCPartyMember(NPC_CANDEROUS);
}

The thing is that i don't have the slightest idea if this "return !" will work if i just repeat it many times for multiple party members :confused:
 T7nowhere
12-29-2004, 5:45 PM
#4
Ya Sorry Neither do I , But there is one way you can find out ;)


EDIT: I look in Hulas's dialog and located the line "Welcome back, <FullName>. I see you have come alone, this is good. I assume you are here to discuss the business of the Genoharadan."

the script attached is k_pman_hulasx and it uses a function called "GetPartyMemberByIndex" Which is listed as


// 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).
// GetPartyMemberByIndex
object GetPartyMemberByIndex(int nIndex);

From what I gather is it is looking for member 1 & 2
 Darkkender
12-30-2004, 1:40 AM
#5
the getpartymember by index function goes through and tests if

0=returns true
then does
1=return true
then does
2=return true

and then posts the results. if only 0=returns true then that means the pc is the only one there.
 Xavier2
12-30-2004, 2:13 PM
#6
Originally posted by Darkkender
the getpartymember by index function goes through and tests if

0=returns true
then does
1=return true
then does
2=return true

and then posts the results. if only 0=returns true then that means the pc is the only one there.
Thanks. But...How should be the sintax of the script using getpartymember?
 tk102
12-30-2004, 2:28 PM
#7
int StartingConditional() {
int nOthers;
nOthers = GetIsObjectValid( GetPartyMemberByIndex(1) );
nOthers = nOthers || GetIsObjectValid( GetPartyMemberByIndex(2) );
return !nOthers;
}
 Xavier2
12-30-2004, 2:36 PM
#8
Originally posted by tk102
int StartingConditional() {
int nOthers;
nOthers = GetIsObjectValid( GetPartyMemberByIndex(1) );
nOthers = nOthers || GetIsObjectValid( GetPartyMemberByIndex(2) );
return !nOthers;
}
Thanks tk102. Brilliant Avatar.
Page: 1 of 1