User Tools

Site Tools


cerea2:build:creatures

Creatures

Tags

All creatures should have tags and resrefs starting with:

cr_(buildertag)

Special tags

Shop keepers must have tags equal to the (shopname)_keep see shops

Scripts

All the creatures should use the following scripts:

(Hint there is an export and import scripts option in the properties window so you need to set them once and then export and can import for other creatures)

See ambient animations page for how to add ambient animations and walking of waypoints on the creature.

See avatar page for more information how the avatar system works and what variables it sets to avatar creatures.

scripts

Script Slot Script Variable
On Physically Attacked cn_g_onattacked IgnoreOnAttacked
On Damaged cn_g_ondamaged IgnoreOnDamaged
On Death cn_g_onkilled IgnoreOnKilled
On Conversation cn_g_onconversation IgnoreOnConversation
On Inventory Disturbed cn_g_ondisturbed IgnoreOnDisturbed
On End combat round cn_g_oncombatroundend IgnoreOnCombatroudnended
On Heart Beat cn_g_onheartbeat IgnoreOnHeartbeat
On Blocked cn_g_onblocked IgnoreOnBlocked
On Perception cn_g_onperception IgnoreOnPerception
On Rested cn_g_onrested IgnoreOnRested
On Spawn In cn_g_onspawn -
On Spell Cast at cn_g_onspellcastat IgnoreOnSpellCastAt
On User Defined Event cn_g_onuserdefined IgnoreOnUserDefined

Those Ignore* variables will disable the normal behavior of the script. The stopcombat is still checked by some scripts, but all other operations are skipped. There is no variable for the on spawn, as these are meant to be used to temporarely disable the operations i.e. set by script and cleared by script. Note, that if you disable for example OnKilled then the kill log is not updated and quests using KillQuest etc are not working, so you should not do that…

Useful things are IgnoreOnConversation (creature will not respond to talking request), IgnoreOnDisturbed (creature will not detect pickpockiting etc ever), IgnoreOnPerception (creature will not detect others and will not attack or anyways react to PCs).

Variables

They should have the following variables set:

Variable Type Meaning Notes
XP Float The level for XP purposes Can be also noneven numbers
Treas Int The Columns for treasuretable See below

They can have the following optional things set:

Variable Type Meaning
NoWalk Int Set to 1 to disable walking of waypoints
DmInfo string Special notes/info for DMs about the creature.
SpecDesc string The item can have special things noticed only on close examination and skill. This is the thing shown on success.
SpecialExamine int The PC skill number used for special examine.
SpecialDC int The DC used for special examine.
Plot int If set will be set to plot on spawn.
NoCleanup int If set then this creature will not be cleaned by area cleanup scripts.
Minimum level to use a column 0 1 2-3 4-8 9-15 16-24 25-35 36-48 49+
Maximum Treasure column 0 1 2 3 4 5 6 7 8

Note that you can allways use lower treasure columns than the maximum indicated.

Normally should use the lesser for the following types of creatures:

Type Modifier
Undead 1/4 the level(round down)
Animals 1/8 the level(round down)
Demons 1/2 the level(round down)

Special variables

The following variables on the creature set special behavior.

Note that any NPCs that should be in civilised areas should normally be flagged immortal, that makes them killable, but raisable.

Combat behavior

Only one behavior can be set at time (+autobuff if wanted)

Variable Type Meaning
Ranged Int If set to 1 will use ranged attacks.
FleeAttack Int If set to 1 will flee when attacked.
Defensive Int If set to 1 will use defensive feats and parry.
Ambusher Int If set to 1 will go stealthy/invisible and attack, then run away and try to go stealthy again before attacking anew.
Herbivore Int If set to 1 Creature will flee those that close within 7m if they are not friends.
Omnivore Int If set to 1 Creature will only attack those that close within 5m and are not friends.
AutoBuffOnCombat String Runs a buffing effect on combat start, for contents of the string see “buff scripts” below.
FollowCombat Int Used with FollowMode. If set to 1, will continue to follow even in combat, if 0, will stop following in combat and restart after it

Damaged behavior

Variable Type Meaning
NoHeal Int If set to 1 will not rest to heal any damage.
SayOn1HP String The thing the creature says on reaching 1 hp (use when creature set to immortal).
Die Int If set to 1, will die even if set to immortal (used with other options like the sayon11hp or healon 1hp). Resets the immortal flag after reaching 1 hp.
HealOn1HP Int The ammount of hp the creature heals on 1 hp once when used with “die”.
SurrenderOn1HP Int If set to 1, will surrender to enemies on 1 hp.
RunOn1HP String This script is run when reaching 1 hp.

Death behavior

Variable Type Meaning
DeathScript String Special script that will be called at end of death events to do personalised death things and still use the standard killed script.
KillQuest String Killing the creature affects the quest state of quest with the given tag.
KillQuestState Int Needed with above, if the quest state of KillQuest is equal to this value will increment the quest state by 1.
KillQuestStateNew Int New value for the quest state. This is used instead of incrementing the value by 1.

HeartBeat behavior

Variable Type Meaning
Hide Int If the NPC has the Hide skill they will go into stealth mode while doing WalkWayPoints().
Search Int As above but will cause the creature to go to search mode instead.
Flee Int If set to 1 will continuosuly try to flee from enemies.
Mobile Int If set to 1, will walk around and do mobile animations.
Animate Int If set to 1, will do immobile animations.
DayNight Int If set will walk “WN_” + NPC Tag + “_##” waypoints and post at “NIGHT_” + NPC Tag during night.
FollowMode Int If set to 1, will follow the object given in FollowObject see followmode for details
FollowObject object when FollowMode is set to 1, will follow this object see followmode for details

Perception Behavior

Variable Type Meaning
AutoBuffOnPerceive String Runs a buffing effect on perception, for contents of the string see “buff scripts” below.
SeeInvisible Int If set to 1 will continiusly have see invisible effect.
TrueSeeing Int If set to 1 will continiusly have trueseeing effect.
DarkVision Int If set to 1 will continiusly have Darkvision effect.
OnPerception String Hook that fires on perception.

Spawn behavior

Variable Type Meaning
SpawnScript String Special script that will be called at end of spawn events to do personalised spawn things and still use the standard spawn script.
Incorporeal Int If set the creature is incoporeal and has a base miss change and incoporeal look.
AutoBuffOnSpawn String Runs a buffing effect on spawn, for contents of the string see “buff scripts” below.
Drop Int If set will use the flyin or or special appear animation.
Plot Int If set to 1 will set the plot flag automatically on the creature.
Effects String A comma separated list of effects to permanently apply to the creature. The effects can be nwn1 style vfx numbers or nwn2 effects filenames
WalkStop Int If set to 1, will setup walking waypoints but not actually walk them
Immortal Int If set to 1, will cause the creature to be immortal. (mostly used with the “on 1 hp” things in on damaged
NoWalk Int Completely disable walking for the creature.
SpawnDamage Int Cause this many points of damage to creature just after spawn

Conversation behavior

Variable Type Meaning
OneLiner String The thing to say instead of the convesation file.
Conversation String Override the conversation with this.
cerea2/build/creatures.txt · Last modified: 2015/05/03 12:32 by 127.0.0.1