PDA

View Full Version : DEtecting if the PC is not with any party member


Xavier2
12-29-2004, 07:11 PM
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, 07:23 PM
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, 07:35 PM
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, 07:45 PM
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, 03:40 AM
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, 04:13 PM
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, 04:28 PM
int StartingConditional() {
int nOthers;
nOthers = GetIsObjectValid( GetPartyMemberByIndex(1) );
nOthers = nOthers || GetIsObjectValid( GetPartyMemberByIndex(2) );
return !nOthers;
}

Xavier2
12-30-2004, 04:36 PM
Originally posted by tk102
int StartingConditional() {
int nOthers;
nOthers = GetIsObjectValid( GetPartyMemberByIndex(1) );
nOthers = nOthers || GetIsObjectValid( GetPartyMemberByIndex(2) );
return !nOthers;
}
Thanks tk102. Brilliant Avatar.