Scripting Quick Reference.doc

(88 KB) Pobierz
Scripting: An fairly quick reference

Scripting: An fairly quick reference

 

Creature and Object Identification

Creature and Object Identification is done through the ObjectType Class.

 

The IDS file used is Object.ids

 

ObjectType is arranged as follows

 

EnemyAlly                             General

General                            |

Race                                          |

Class                                          |

Specifics                          V

Instance                               Specific

SpecialCase

 

Eg. [EnemyAlly.General.Race.Class.Specifics.Instance.SpecialCase]

 

EnemyAlly is a range between the PC and the evil NPC’s Creatures can fall anywhere along this range.

 

The IDS file used is EA.ids

 

PC refers to any of the possible six party members.

GOODCUTOFF refers to anyone good.  Party members, allies, summoned monsters, etc.

GOODBUTBLUE refers to anyone good but with a blue circle.

ENEMY refers to anyone evil, generally red circles.

EVILBUTBLUE refers to anyone evil but with a blue circle.

EVILBUTGREEN refers to anyone evil but with a green circle.

NEUTRAL refers to anyone neutral, generally blue circles.

ANYONE refers to any object.

 

General specifies the generic characteristics of the creature.

 

The IDS file used is General.ids

 

HUMANOID

ANIMAL

DEAD

UNDEAD

GIANTHUMANOID

MONSTER

Etc.

 

Race is the race of the creature.

 

The IDS file used is Race.ids

 

HUMAN

ELF

HALF_ELF

DWARF

HALFLING

GNOME

ANKHEG

BASILISK

BEAR

Etc.

 

Class is the class information (Mage, Fighter …) Alternatively it can be used for more detailed information (e.g. Drow is more specific then elf)

 

The IDS file used is Class.ids

 

MAGE

FIGHTER

CLERIC

FIGHTER_THIEF

BASILISK

BASILISK_GREATER

BEAR_POLAR

Etc.

 

Specifics holds the identification for special NPC’s

 

Instance is unique for each creature within the game.  It should not generally be specifies in the AI scripting but will be set by the AI code once a target is selected

 

SpecialCase is used to specify whether or not to use any special case information. Currently this will only be used for LAttacked and LTargetted.  Protecting, Protector and Myself must be stored in a different way so that you can do things like Protecting.Lattacked.

 

 

Eg. To specify all Enemy Fighters: [ENEMY.0.0.FIGHTER]

 

 

 

 

Special Object Identification

 

The following functions return ObjectType variables corresponding to some special cases.  They are called using the following syntax:

 

Function(Source)

For Example: LAttacked(“Spud”) will return the ObjectType of the last thing to attack Spud.

 

If One of Leader, Weakest, Strongest, MDamaged, LDamaged is called, the Source will be used ONLY to determine which group to use.

For Example: Leader(“Spud”) will return the leader of Spud’s Group

 

These functions can be used as the Source for any other of these functions.  HOWEVER, this nesting can only go 5 deep.

For Example: Protector(LAttacked(LTargeted(Protecting(Myself)))) is valid and will return the protector of the person last attacked by the person last targeted by the person protecting myself.  Any more then this depth of nesting is NOT allowed, however.

Note: If you ever use this level of nesting, please seek professional help.

 

“NAME”

This is the scriptname in the creature file.

 

Myself

This is the creature that the script belongs to.

Leaving out the Object within the brackets defaults the Object to Myself

 

LastAttackerOf(Object)

The Creature that last did the Object damage.

 

LastHeardBy(Object)

Last heard by the Object.

 

LastSeenBy(Object)

Last seen by the Object.

 

LastTalkedToBy(Object)

Last talked to by the Object.

 

LastTalkedToBy()

LastTalkedToBy

Both of these default to LastTalkedToBy(Myself)

 

LastTrigger(Object)

Last triggerer of the Object

Player1 or Protagonist

This is the Main Character or Protagonist.

 

Player2Player6

Character 2, 3, 4, 5 or 6 in the order they have joined.

 

StrongestOf()

Party member with the highest threat rating.

 

StrongestOfMale()

Male party member with the highest threat rating.

 

WeakestOf()

Party member with lowest threat rating.

 

NearestEnemyOf(Object)

Returns the nearest creature with Enemy / Ally flag opposite to the Object.

 

SecondNearestEnemyOf(Object)

You can check the first ten nearest enemies.

 

Nearest(Type)

Returns the instance of the nearest Object of the given Type.

Eg. Nearest([0.0.DWARF])

 

SecondNearest()

You can check the first ten nearest.

 

WorstAC()

Party member with the worst AC.

 

BestAC()

Party member with the best AC.

 

NearestEnemyOfType(Type)

Nearest enemy of myself that is of the Type.

Eg. NearestEnemyOfType([0.0.0.MAGE])

 

SecondNearestEnemyOfType(Type)

You can check the first ten nearest.

 

 

 

 

 

 

Trigger Descriptions

 

Event Triggers

 

Triggers return True or False

 

Doors, Containers and Traps

 

Clicked(Object)

I am a game trigger and have just been clicked on by Object.  Usually info triggers use this.

 

Entered(Object)

I am a trigger and an Object just entered me.  Usually proximity traps use this.

 

Closed(Object)

I am a Door and I have just been closed by an Object.

 

Opened(Object)

I am a Door, container and I have just been opened by an Object.

 

Detected(Object)

I am a Door, container, trigger and my trap has been detected by an Object.

 

Disarmed(Object)

I am a Door, container, trigger and my trap has been disarmed by an Object.

 

DisarmFailed(Object)

I am a Door, container, trigger and my trap has failed to be disarmed by an Object.

 

PickLockFailed(Object)

Object just failed to pick my lock.

 

Unlocked(Object)

Object just unlocked me.

 

 

 

 

 

 

 

Creatures

 

AttackedBy(Object, Style Y)

I was just attacked by an Object using Style.

Style:               DEFAULT

MELEE

RANGED

 

BecameVisible()

I am a creature and I just became visible to the party.

 

BreakingPoint()

I am in the party and have reached my breaking Point.

 

Die()

I have just died.  This does not always seem to work.

 

Died(Object)

An Object just died in my hearing range.

 

Heard(Object, Integer: X)

I heard an Object shout X.

 

HitBy(Object, Style)

I have just been hit by an Object using Style.

 

OnCreation()

I have just been created (not necessarily for the first time)

This can be used for creature and area scripts.

 

OutOfAmmo()

My weapon is out of ammo.

 

ActionListEmpty()

I have no current actions to complete.

 

 

 

 

 

 

 

 

 

 

 

Creature Status

 

Alignment(Object, Alignment)

The Object is of the Alignment specified.

 

The IDS file used the Align.ids

 

LAWFUL_GOOD

NEUTRAL

CHAOTIC_EVIL

MASK_GOOD

Etc.

 

Allegiance(Object, Allegiance)

The Object is of the Allegiance specified.

 

The IDS file used is EA.ids

 

Class(Object, Class)

The Object is of the Class specified.

 

The IDS file used is Class.ids

 

Kit(Object, Kit)

The Object is of the Kit specified.

 

The IDS file used is Kit.ids

 

Race(Object, Race)

The Object is of the Race specified.

 

The IDS file used is Race.ids

 

Gender(Object, Gender)

The Object is of the Gender specified.

 

The IDS file used is Gender.ids

 

MALE

FEMALE

SUMMONED

ILLUSIONARY 

EXTRA

SUMMONED_DEMON

Etc.

 

General(Object, General)

The Object is of the General state specified.

 

The IDS file used is General.ids

 

Specifics(Object, Specific)

The Object is of the Specific state specified.

 

The IDS file used is Specific.ids

 

HP(Object, X)

HPGT(Object, X)

HPLT(Object, X)

Compares the Object’s hitpoints to X.

 

HPPercent(Object, X)

HPPercentLT(Object, X)

HPPercentGT(Object, X)

Compares the Object’s hitpoints to X percent.

 

Morale(Object, X)

MoraleGT(Object, X)

MoraleLT(Object, X)

Compares the Object’s morale to X.

 

Reputation(Object, X)

ReputationGT(Object, X)...

Zgłoś jeśli naruszono regulamin