GetNumberPartyMembers(object)

Returns the number of players in the PC's party +1

int GetNumberPartyMembers(
    object oPC
);

Parameters

oPC

Player Character


Description

Returns the number of Player Characters in the PC's party, including the PC, +1 due to an out-by-one coding error.

Does NOT include associates.

Uses GetFirst/NextFactionMember while valid, returns count.



Remarks

Include library for party-wide functions.

NOTE: this library is included in "x0_i0_common" already.
Do NOT dual-include both files or you will get errors!


Known Bugs

Code initializes with 1 before starting count, presumably to include the oPC, then counts the oPC again during its use of GetFirst/NextFactionMember. Reducing the count by 1 should return the correct number.- 1/28/04, NWN Toolset version vts026, game version 1.61.8042 English


Requirements

#include "X0_I0_PARTYWIDE"

Version

1.61

Example

void main()
// returns correct number of PCs in oPC's party
{    int nPlayerCount = GetNumberPartyMembers(oPC) - 1;
}

See Also

categories: Party Functions


 author: Peter Busby, additional contributor(s): Grimlar
 Send comments on this topic.