GetPartyList
From Dragon Age Toolset Wiki
Revision as of 12:54, 7 September 2011 by Sunjammer (Talk | contribs) (Applying template, cleaning up example)
Returns the party list for a creature.
- Parameters:
- oCreature
- The object to test for returning the party
- Returns:
- Returns an array of all members in the creature's party
- Source:
- script.ldf
Remarks
If oCreature is not specified then the array returned is for the player's party and the player's character is included in the array.
Examples
The following function checks the whole party for a specified item to have in inventory:
int Party_GetItemPossedBy(object oCreature, string sItemTag) { object oItem; int nPartyMember; // get the party list and its size object[] oPartyMembers = GetPartyList(oCreature); int nPartyMembers = GetArraySize(oPartyMembers); // loop over the party and check each member for a matching item for(nPartyMember; nPartyMember < nPartyMembers; nPartyMember++) { // check if the item exists and if so return true oItem = GetItemPossessedBy(oPartyMembers[nPartyMember], sItemTag); if(IsObjectValid(oItem)) { return TRUE; } } // otherwise return false return FALSE; }