I realised that there was never a formal announcement here to read up: The Catara NWN server is offline for quite some time now, due to time constraints. I might revive it someday, but it is pretty unlikely. If anyone wants to use our custom classes or tools, ping me on twitter (@jollyorc) and we can see what we can do for you! In the meantime, I do recommend The World of Avlis: https://avlis.org/
NPC Behaviour Variables
  • X2_SPELL_RANDOM

    Setting this variable on a spellcaster creature will make its spelluse abit more random, but their spell selection may not always be appropriateto the situation anymore.
    X2_L_SPAWN_USE_STEALTH

    Set to 1 to make the creature activate stealth mode after spawn
    X2_L_SPAWN_USE_SEARCH

    Set to 1 to make the creature activate detectmode after spawn
    X2_L_SPAWN_USE_AMBIENT

    Set to 1 to make the creature play mobile ambient animations after spawn
    X2_L_SPAWN_USE_AMBIENT_IMMOBILE

    Set to 1 to make the creature play immobile ambient animations after spawn
    X1_L_IMMUNE_TO_DISPEL

    Set to 1 to make the creature immune to dispel magic (used for statues)
    X2_L_IS_INCORPOREAL

    Set this variable to 1 on a creature to make it walk through other creatures
    X2_L_NUMBER_OF_ATTACKS

    Set this variable to 1

    6 to override the number of attacks a creature has based on its BAB
    X2_L_BEH_MAGIC

    The value of this variable (int) is added to the chance that a creature will use magic in combat. Set to 100 for always, 0 for never
    X2_L_BEH_OFFENSE

    The higher value of this variable, the higher the chance that the creature will use offensive abilities in combat. Set to 0 to make them flee.
    X2_L_BEH_COMPASSION

    The higher value of this variable, the higher the chance that the creature will aid friendly creatures in combat. Not that helping usually degrades the overall difficulty of an encounter, but makes it more interesting.
    X2_S_PM_SPECIAL_ITEM

    This allows you to script items that enhance a palemaster's summoned creatures. You needto put the name of a script into this variable that will be run on any creature called by the pale master's summon undead ability. You can use this script to add effects to the creature. You can use the OnEquip/OnUnEquip event hooks set this variable.
  • // Special combat behavior flags



    const string sCombatCondVarname = "X0_COMBAT_CONDITION";



    const int X0_COMBAT_FLAG_RANGED            = 0x00000001;

    const int X0_COMBAT_FLAG_DEFENSIVE         = 0x00000002;

    const int X0_COMBAT_FLAG_COWARDLY          = 0x00000004;

    const int X0_COMBAT_FLAG_AMBUSHER          = 0x00000008;



    /**********************************************************************

     * FUNCTION PROTOTYPES

     **********************************************************************/



    // Determine whether the specified X0_COMBAT_FLAG_* is set on the target

    int GetCombatCondition(int nCond, object oTarget=OBJECT_SELF);



    // Set one of the X0_COMBAT_FLAG_* values on the target

    void SetCombatCondition(int nCond, int bValid=TRUE, object oTarget=OBJECT_SELF);



    // This function checks for the special tactics flags and

    // chooses tactics appropriately for each.

    // Currently available:

    // X0_COMBAT_FLAG_{RANGED,DEFENSIVE,COWARDLY,AMBUSHER}

    //

    // Note that only one special tactics flag should be applied

    // to a single creature for the most part!

    //

    // Returns TRUE on success, FALSE on failure.

    int SpecialTactics(object oTarget);



    // Special tactics for ranged fighters.

    // The caller will attempt to stay in ranged distance and

    // will make use of active ranged combat feats (Rapid Shot

    // and Called Shot).

    // If the target is too close and is not currently attacking

    // the caller, the caller will instead try to find a ranged

    // enemy to attack. If that fails, the caller will try to run

    // away from the target to a ranged distance.

    // This will fall through and return FALSE after three

    // consecutive attempts to get away from an opponent within

    // melee distance, at which point the caller will use normal

    // tactics until they are again at a ranged distance from

    // their target.

    // Returns TRUE on success, FALSE on failure.

    int SpecialTacticsRanged(object oTarget);



    // Special tactics for ambushers.

    // Ambushers will first attempt to get out of sight

    // of their target if currently visible to that target.

    // If not visible to the target, they will use any invisibility/

    // hide powers they have.

    // Once hidden, they will then attempt to attack the target using

    // standard AI.

    // Returns TRUE on success, FALSE on failure.

    int SpecialTacticsAmbusher(object oTarget);



    // Special tactics for cowardly creatures

    // Cowards act as follows:

    // - if you and your friends outnumber the enemy by 6:1 or

    //   by more than 10, fall through to normal combat.

    // - if you are currently being attacked by a melee attacker,

    //   fight defensively (see SpecialTacticsDefensive).

    // - if there is a "NW_SAFE" waypoint in your area that is

    //   out of sight of the target, run to it.

    // - otherwise, run away randomly from the target.

    // Returns TRUE on success, FALSE on failure.

    int SpecialTacticsCowardly(object oTarget);



    // Special tactics for defensive fighters

    // This will attempt to use the active defensive feats such as

    // Knockdown and Expertise, and also use Parry mode, when these

    // are appropriate. Falls through to standard combat on failure.

    // Returns TRUE on success, FALSE on failure.

    int SpecialTacticsDefensive(object oTarget);
  • I dont quite understand how to set these up on an NPC...especially the combat behaviour flags.
  • For those in the first post: Just add a (integer) variable to the NPCS in the advanced tab.
     
    The Combat behaviour flags work similar, except that they can be supposedly combined with other stuff, hence the crazy hex-notation of the values.
    Basically, you set up an int variable named X0_COMBAT_CONDITION and then set it to

    1 for the behaviour of X0_COMBAT_FLAG_RANGED
    2 for the behaviour of X0_COMBAT_FLAG_DEFENSIVE
    4 for the behaviour of X0_COMBAT_FLAG_COWARDLY
    8 for the behaviour of X0_COMBAT_FLAG_AMBUSHER
  • Easy! thx :)
  • How about other type of flags?

    I'm trying to make some slave NPCs run away and dissapear once the PC finishes a short one line conversation with them...
    I found that there is a useful flag for this kind of situation: NW_FLAG_ESCAPE_LEAVE, which is activated with ActivateFleeToExit.
    From NWN Lexicon:
    "ActivateFleeToExit will cause an NPC to flee to a waypoint called EXIT_ +
  • Good point. There's a list, have a look here: http://nwn1.nwn2lexicon.com/compiled/constant.NW_FLAG.html
  • How would i set the flag on the NPC? through an OnSpawn script with SetSpawnInCondition?
  • Ok, I realized I can easily create such a script by using NW_C2_DEFAULT9 and just uncommenting a line in there.

    I tried it and it works perfectly!

    If anyone else ever wants to have an NPC run off and disappear, here is how:

    The new script which has this flag activated is "flagleave_onspawn" and goes into the OnSpawn of the NPC
    The script that activates the action is "npc_leave" (can be placed in Action Taken of a conversation line for instance)
    All you need then is a waypoint named EXIT_ +

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!