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
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)
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:
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
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.
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?
int StartingConditional() {
int nOthers;
nOthers = GetIsObjectValid( GetPartyMemberByIndex(1) );
nOthers = nOthers || GetIsObjectValid( GetPartyMemberByIndex(2) );
return !nOthers;
}
Originally posted by tk102
int StartingConditional() {
int nOthers;
nOthers = GetIsObjectValid( GetPartyMemberByIndex(1) );
nOthers = nOthers || GetIsObjectValid( GetPartyMemberByIndex(2) );
return !nOthers;
}
Thanks tk102. Brilliant Avatar.