ChangeToStandardFaction(object, int)

From NWN Lexicon

Changes a creature's faction to one of the four standard factions.

void ChangeToStandardFaction(
    object oCreatureToChange,
    int nStandardFaction
);

Contents

[edit] Parameters

oCreatureToChange
A creature whose faction you will alter.
nStandardFaction
A STANDARD_FACTION_* constant representing the faction to join.

[edit] Description

Make oCreatureToChange join one of the standard factions ("Hostile", "Commoner", "Merchant", or "Defender").

[edit] Remarks

To assign a creature to a non-standard faction, use ChangeFaction() instead.

[edit] Version

1.22

[edit] Example

// In the "Actions Taken" script of an NPC's final conversation node.
// This will make the NPC attack the PC.
void main()
{
  ChangeToStandardFaction(OBJECT_SELF, STANDARD_FACTION_HOSTILE);
  DetermineCombatRound();
}

[edit] See Also

functions:  ChangeFaction
constants:  STANDARD_FACTION_* Constants


 author: Iskander Merriman, editor: Charles Feduke

Personal tools
Categories