If you are using the default OnSpawn Event - either nw_c2_default9 or x2_def_spawn (which executes nw_c2_default9) - you can use variables to modify creature behavior through the BioWare AI. The particular one you want is X2_L_SPAWN_USE_AMBIENT.
From The Builders Project's Guide to Building Vol. I - The Toolset ManualVariables: By clicking on the “Variable†button (under the Advanced Tab in the Creature Properties window) you can set local variables on the creature. These variables can be used in any script involving this specific creature. Some specific variables have already been coded by Bioware and can be used to modify the behaviour of your creatures. Here is a list of these already coded variables:
X2_SPELL_RANDOMSetting this variable to 1 on a spellcaster creature will make its spell use a bit more random, but their spell selection may not always be appropriate to the situation anymore.
X2_L_SPAWN_USE_STEALTHSet to 1 to make the creature activate stealth mode after spawn.
X2_L_SPAWN_USE_SEARCHSet to 1 to make the creature activate detect mode after spawn.
X2_L_SPAWN_USE_AMBIENT
Set to 1 to make the creature play mobile ambient animations after spawn. The creature will then move in the area where it is located, salute other creatures, scratch its head, etc.
X2_L_SPAWN_USE_AMBIENT_IMMOBILESet to 1 to make the creature play immobile ambient animations after spawn.
X1_L_IMMUNE_TO_DISPELSet 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_ATTACKSSet this variable to 1 - 6 to override the number of attacks a creature has based on its base attack bonus.
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_OFFENSEThe 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_COMPASSIONThe higher value of this variable, the higher the chance that the creature will aid friendly creatures in combat. Note that helping usually degrades the overall difficulty of an encounter, but makes it more interesting.
X2_S_PM_SPECIAL_ITEMThis allows you to script items that enhance a palemaster's summoned creatures. You need to 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 to set this variable.
Modifié par Pstemarie, 14 juillet 2011 - 10:44 .