Difference between revisions of "Character and Item Script Triggers, Calls, and Queries"

From Divinity Engine Wiki
Jump to: navigation, search
(Added missing parameters for SetMaterial.)
m (Updated CharacterPlayAnimation with a missing parameter)
Line 527: Line 527:
 
Move out of screen
 
Move out of screen
  
'''CharacterPlayAnimation(FIXEDSTRING:animation [, INT:exitOnFinish=1, INT:waitForCompletion=1])'''
+
'''CharacterPlayAnimation(FIXEDSTRING:animation [, INT:exitOnFinish=1, INT:waitForCompletion=1], INT:noBlend=0])'''
  
Plays a certain animation ExitOnFinish means if the exit will kill itself after it was played (revert back to still)  
+
Plays a certain animation
 +
ExitOnFinish means if the exit will kill itself after it was played (revert back to still)
 +
WaitForCompletion means if the action will wait for the animation to be played at least once.
 +
noBlend means no blending will be performaed when doing this animation.
  
 
'''CharacterStopAnimation(-)'''
 
'''CharacterStopAnimation(-)'''

Revision as of 22:11, 17 October 2019

This is a list of almost every character and item script event trigger, call, and query. An event is what triggers the script, and always begin with On. Queries provide information and are always inside an IF or CHECK. Calls are actions that are always after THEN.

CharScript/ItemScript Functions

Divinity: Original Sin 2 Classic

CALLS

Set(OUT OBJECT:variable, OBJECT:value)

Set the value of a variable

SetVar(CHARACTER|ITEM:object, FIXEDSTRING:variableName, OBJECT:value)

Set the value of a global variable

Cast(OUT OBJECT variable, OBJECT value)

Casts the value to the variable

Print(OUT STRING:output, STRING:text)

Prints the text to the output with possible parameters: [1], [2], ...

Add(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT|FLOAT3:value)

Adds both values and stores it in the first variable

Subtract(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT|FLOAT3:value)

Subtracts both values and stores it in the first variable

Multiply(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT:value)

Multiplies both values and stores it in the first variable

Divide(INOUT INT|FLOAT|FLOAT3:variable, INT|FLOAT:value)

Divides both values and stores it in the first variable

Abs(INOUT INT|FLOAT:variable)

Takes the absolute value of a variable

Clamp(INOUT INT|FLOAT:variable, INT|FLOAT:min, INT|FLOAT:max)

Clamps a variable between min and max

GetRandom(OUT OBJECT:variable, OBJECT:value, OBJECT:value, OBJECT:value)

Fills in the variable with random one of the values.

GetWeightedRandom(OUT OBJECT:variable, OBJECT:value, INT|FLOAT:weight, ...)

Gets a weighted random of the given values!

GetRandomBetween(OUT INT|FLOAT:variable, INT|FLOAT:min, INT|FLOAT:max)

Gets a random value between min and max (both included)

GetRandomPositionInTrigger(OUT FLOAT3:variable, TRIGGER:areaTrigger)

Get a random position in a trigger area

GetElement(OUT OBJECT:variable, INT:index, OBJECT:value, OBJECT:value, OBJECT:value)

Fills in the variable with the index one of the values (starting from 0)

SetPriority(FIXEDSTRING:reactionName, INT:priority)

Changes the priority of a reaction. Priority 0 and below are not executed!

DelayReaction(FIXEDSTRING:reactionName, FLOAT:timeInSeconds)

The reaction will not be chosen for the specified time

SetScriptFrame(CHARACTER:character, FIXEDSTRING:frame)

Sets the scriptframe on the character.

ClearScriptFrame(CHARACTER:character)

Clears the scriptframe on the character.

Goto(FIXEDSTRING:labelName)

Jumps to the label. Two label names are built-in: "Start" for the first instruction of the reaction, and "End" for the last one.

GotoIfEqual(OBJECT:variable, OBJECT:value, FIXEDSTRING:labelName)

Jumps to the label if the 2 objects are equal

GotoRand(FIXEDSTRING:labelName, FIXEDSTRING:labelName, FIXEDSTRING:labelName, FIXEDSTRING:labelName, FIXEDSTRING:labelName)

Jumps to a random label in the list

CreatePuddleAt(GAMEOBJECT|FLOAT3:target, SURFACE:type, INT:cellAmountMin, INT:cellAmountMax, INT:growAmountMin, INT:growAmountMax, )

Spawn a puddle at the target's position for a certain lifetime (in turns)

CreateSurfaceAt(GAMEOBJECT|FLOAT3:target, SURFACE:type, FLOAT:radius, INT:lifeTime[, GAMEOBJECT:owner])

Spawn a surface at the target's position for a certain lifetime (in turns)

CreateSurfaceInPolygon(GAMEOBJECT:owner, SURFACE:type, FLOAT:duration, FLOAT:growTimer, INT:growStep, GAMEOBJECT|FLOAT3:point1, GAMEOBJECT|FLOAT3:point2, GAMEOBJECT|FLOAT3:point3, ...)

Spawn a polygon surface at the target's position. Grows <growStep> every <growTimer>.

CreateSurfaceInAreaTrigger(GAMEOBJECT:owner, SURFACE:type, FLOAT:duration, FLOAT:growTimer, INT:growStep, TRIGGER:areaTrigger)

Spawn a surface within <areaTrigger>. Grows <growStep> every <growTimer>.

CreateConeSurfaceAt(GAMEOBJECT|FLOAT3:start, GAMEOBJECT|FLOAT3:target, SURFACE:type, FLOAT:radius, FLOAT:angle, FLOAT:duration)

Spawn a Cone surface at the target's position

PlayEffectAt(GAMEOBJECT|FLOAT3:target, STRING:effectName)

Plays an effect at the target's position

PlayLoopEffectAt(OUT INT64:effectHandle, GAMEOBJECT|FLOAT3:target, STRING:effectName)

Plays an effect at the target's position

ExplodeAt(GAMEOBJECT|FLOAT3:target, SKILL:projectileSkill, [INT:casterLevel=-1, CHARACTER|ITEM:cause])

Trigger an explosion of a projectile skill at the target's position. The cause will trigger NPC behavior as if the cause casted the projectile

DisplayText(CHARACTER|ITEM:target, FIXEDSTRING:text, FLOAT:timeInSeconds)

Displays text above the character/item for a certain amount of time. It will replace the current text, including dialogtext

DisplayCombatInfoText(CHARACTER|ITEM:target, FIXEDSTRING:text, FLOAT:timeInSeconds)

Displays text above the character/item for a certain amount of time. It will replace the current text, including dialogtext

StatusText(CHARACTER|ITEM:target, FIXEDSTRING:text)

Adds statustext above the character/item for a short amount of time. Will not replace texts or dialogtexts

DebugText(CHARACTER|ITEM:target, STRING:text)

Adds debugtext above the character/item for a short amount of time.

CombatLogText(CHARACTER|ITEM:target, FIXEDSTRING:text, INT:filterID, INT:broadcastID)

Adds combatlog text inside the combat log window. Color-/SizeFormatting should already be applied, if not color and size of the string will be NORMAL. filterID determines what filter shows/hides the text. broadcastID determines who will be able to see the message (0 hearingrange. 1 party. 2 all)

Log(STRING:text, ...)

Log's the the scriptlog. (for debugging purposes)

Output(STRING:text, ...)

Pass text with optional parameters to the output panel (e.g. Output("An int [1]", INT:10))

Assert(STRING:text, ...)

Pass text with optional parameters to display as an assert message (e.g. Assert("This number is wrong: [1]", INT:666))

Label(FIXEDSTRING:name)

Marks this line as a label where Goto actions can jump to

StartTimer(FIXEDSTRING:timerName, FLOAT:timeInSeconds, INT:repeatCount)

Start a timer which will throw the timer event. Set repeatcount < 0 for a permanent timer.

StopTimer(FIXEDSTRING:timerName)

Stop a timer which will throw the timer event

DialogStart(OUT INT:instanceId, STRING:dialog, CHARACTER|ITEM:target, CHARACTER|ITEM:target, CHARACTER|ITEM:target, CHARACTER|ITEM:target)

Start a dialog between the targets. You can specify fewer targets than the maximum number.

Warningred.png
Starting a dialog from behaviour script will always start it as an Automated Dialog. Interactive dialogs can only be started from Osiris.

DialogRequestStop(CHARACTER|ITEM:speaker, STRING:dialog)

Stops a certain dialog on a certain speaker

Check(-)

Reevaluate the conditions in the CHECK section of this reaction

Reset(-)

Resets the current reaction. It will start from the beginning again

Interrupt(FIXEDSTRING:reactionName)

Interrupt the reaction.

GlobalSetEvent(FIXEDSTRING:eventName)

Sets a global event. Scripts and Story can catch it.

GlobalClearEvent(FIXEDSTRING:eventName)

Clears a global event. Scripts and Story can catch it.

StopLoopEffect(INT64:fxHandle)

Stops a looping effect

IterateItems(FIXEDSTRING:eventname[, FIXEDSTRING:tag])

Launch iterate event for each item. If you pass a tag, it has to have that tag.

IterateItemsNear(GAMEOBJECT:source, FLOAT:radius, FIXEDSTRING:eventname[, FIXEDSTRING:tag])

Launch iterate event for each item in range. If you pass a tag, it has to have that tag.

IterateItemsOnObject(CHARACTER|ITEM:source, FIXEDSTRING:eventname[, FIXEDSTRING:tag])

Launch iterate event for each item standing on the source. If you pass a tag, it has to have that tag.

IterateParty(FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, CHARACTER:partyMember, FIXEDSTRING:tag])

Launch iterate event for each member of all parties. If you pass a party member only members of that party will be considered. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.

IterateCharacters(FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])

Launch iterate event for each character. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.

IterateCharactersNear(GAMEOBJECT:source, FLOAT:radius, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])

Launch iterate event for each character in range. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.

IterateCharactersOnObject(CHARACTER|ITEM:source, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag]) Launch iterate event for each character standing on the source. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.

IterateCharactersInCombat(CHARACTER|ITEM:source, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])

Launch iterate event for each character in combat with the source. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.

IterateHostilesFor(CHARACTER:source, FIXEDSTRING:eventname, [COMPARE:howTo, COMPAREFUNC:compareFunc, FIXEDSTRING:tag])

Launch iterate event for each character who is targetting the source. If you pass compare parameters, it will iterate over them in the requested order. If you pass a tag, it has to have that tag.

SpawnCharacter(OUT CHARACTER:result, CHARACTERTEMPLATE:rootTemplate, GAMEOBJECT|FLOAT3:position, INT:playSpawn, [INT:isSummon=0, CHARACTER:summonOwner=null, INT:overrideLevel=-1])

Spawns a character

SpawnItem(ITEMTEMPLATE:rootTemplate,GAMEOBJECT|FLOAT3:position, OUT ITEM:result)

Spawns an item

ShootLocalProjectile(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,FLOAT3:direction,[INT:casterLevel, CHARACTER|ITEM:caster])

Spawns a projectile at the source (with offset, can be null) shooting at the target

ShootLocalProjectileAt(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,GAMEOBJECT|FLOAT3:target,[INT:casterLevel, CHARACTER|ITEM:caster])

Spawns a projectile at the source (with offset, can be null) shooting at the target

ShootWorldProjectile(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,FLOAT3:direction,[INT:casterLevel])

Spawns a projectile at worldPos shooting at the target. Source can be null.

ShootWorldProjectileAt(SKILL:projectileSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,GAMEOBJECT|FLOAT3:target,[INT:casterLevel])

Spawns a projectile at worldPos shooting at the target. Source can be null.

ShootLocalCone(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,FLOAT3:direction,[INT:casterLevel, CHARACTER|ITEM:caster])

Shoots a cone from source (with offset, can be null) in a direction

ShootLocalConeAt(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:localOffset,GAMEOBJECT|FLOAT3:target,[INT:casterLevel, CHARACTER|ITEM:caster])

Shoots a cone from source (with offset, can be null) at the target

ShootWorldCone(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,FLOAT3:direction,[INT:casterLevel])

Shoots a cone from worldPos in a direction. Source can be null.

ShootWorldConeAt(SKILL:coneSkill,CHARACTER|ITEM:source,FLOAT3:worldPos,GAMEOBJECT|FLOAT3:target,[INT:casterLevel])

Shoots a cone from worldPos at the target. Source can be null.

SetVisible(CHARACTER|ITEM:object, INT:visible)

Sets a character or item visible or not.

RotateY(INOUT FLOAT3:vector, FLOAT:degrees)

Rotate the vector around the Y-axis for a certain angle (in degrees)

SetHealth(CHARACTER|ITEM:target, FLOAT:percent)

Set a characters or items health on the given percentage. (percentage between 0 and 1)

PlaySound(CHARACTER|ITEM:target, STRING:soundEvent)

Plays a sound event at the target

PlayMusicForEveryone(STRING:musicEvent)

Plays a music event on all the clients

PlayMusicOnCharacter(CHARACTER:target, STRING:musicEvent)

Plays a music event on a character for all peers (3D)

PlayMusicForPeer(CHARACTER:target, STRING:musicEvent)

Plays a music event on the peer of the character

PlayMusicForPeerWithInstrument(CHARACTER:target, CHARACTER:charInstrument, STRING:musicEvent)

Plays a music event on the peer of the character concated with _INSTRUMENT

SetX(INOUT FLOAT3:vector, FLOAT|INT:value)

Sets the X component of the FLOAT3

SetY(INOUT FLOAT3:vector, FLOAT|INT:value)

Sets the Y component of the FLOAT3

SetZ(INOUT FLOAT3:vector, FLOAT|INT:value)

Sets the Z component of the FLOAT3

SetAtmosphere(FIXEDSTRING:atmosphereTriggerUUID, FIXEDSTRING:atmosphere)

Changes the atmosphere of the trigger

ResetAtmosphere(FIXEDSTRING:atmosphereTriggerUUID)

Resets the atmosphere of the trigger

AddStatusInfluence(CHARACTER|ITEM:object, STATUS:statusId, FLOAT:strength, [FIXEDSTRING:extraData=""], [INT:isWeather=1], [INT:force=1])

Adds the status influence strength on the object.

RemoveStatusInfluence(CHARACTER|ITEM:object, STATUS:statusId, FLOAT:strength, [FIXEDSTRING:extraData=""], [INT:isWeather=1])

Removes the status influence strength on the object.

AddTemporaryStatusInfluence(CHARACTER|ITEM:source, CHARACTER|ITEM:object, STATUS:statusId, FLOAT:strength, [FIXEDSTRING:extraData=""], [INT:isWeather=1])

Adds a temporary status influence strength on the object.. It will be gone in a few seconds if it's not set again

CallFunction(FIXEDSTRING:functionName)

Calls a function with the ID

SetMaterial(CHARACTER|ITEM:object, FIXEDSTRING:materialUUID, INT:duration, INT:applyOnBody, INT:applyOnArmor, INT:applyOnWings, INT:applyOnHorns, INT:applyOnOverhead, INT:applyOnWeapon[,INT:applyNormalMap, INT:overlay, INT:fading])

Changes the material of the object for a set time (in turns), -1 is infinite. applyNormalMap: Copy the original materials normal map

TeleportTo(CHARACTER|ITEM:object, GAMEOBJECT|FLOAT3:target, [INT:Force=0])

Teleport object to or near the target

Transform(CHARACTER|ITEM:object, CHARACTERTEMPLATE|ITEMTEMPLATE:root [, FIXEDSTRING:fx, INT:replaceScripts=1, OUT FLOAT:currentHP])

Transforms <object> using <root>, returns <currentHP>, plays <fx>.

SaveGame(FIXEDSTRING:saveGameName)

Save the savegame with name <saveGameName>

LoadGame(FIXEDSTRING:saveGameName)

Load the savegame with name <saveGameName>

LoadLevel(FIXEDSTRING:levelName)

Load the level with name <levelName>

KillCombat(CHARACTER:character)

Kill all the enemies in the combat which contains <character>

SetTag(CHARACTER|ITEM:object, FIXEDSTRING:tag)

Sets the Tag on the Object

ClearTag(CHARACTER|ITEM:object, FIXEDSTRING:tag)

Clears the Tag on the Object

SetGlobalFlag(FIXEDSTRING:flagname)

Sets the Global Flag

ClearGlobalFlag(FIXEDSTRING:flagname)

Clears the Global Flag

SetFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)

Sets the Flag on the Object

ClearFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)

Clears the Flag on the Object

SetUserFlag(CHARACTER:object, FIXEDSTRING:flagname)

Sets the Flag on the user's characters

ClearUserFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)

Clears the Flag on the user's characters

SetPartyFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)

Sets the Flag on the party's characters

ClearPartyFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagname)

Clears the Flag on the party's characters

StartVoiceBark(STRING:barkName, CHARACTER:character)

Start a voicebark on character

ConfrontationDone(INT: CrimeID, CHARACTER:lead, CHARACTER:criminal, ...)

Resolve the crime with id CrimeID for the specified criminals

CrimesceneInvestigationDone(CHARACTER:investigator)

Crimescene is considered investigated by this NPC, start looking for culprits

ListAdd(LIST<OBJECT>:list, OBJECT:entry)

Add <entry> at the back of <list>

ListRemove(LIST<OBJECT>:list, INT:index)

Remove the entry at <index> of <list>

ListSet(LIST<OBJECT>:list, INT:index, OBJECT:entry)

Set the entry at <index> of <list> to <entry>

ListClear(LIST<OBJECT>:list)

Remove all entries of <list>

EndTurn(CHARACTER|ITEM:Target)

Ends the object's current turn

SetCanFight(CHARACTER|ITEM:entity, INT:enabled[, INT:wholeGroup=0])

Enables/Disables the fact if the entity can fight. Optional for the whole group

SetCanJoinCombat(CHARACTER|ITEM:entity, INT:enabled[, INT:wholeGroup=0])

Enables/Disables the fact if the entity can join combats. Optional for the whole group

SetIsBoss(CHARACTER|ITEM:entity, INT:enabled)

Enables/Disables the fact if the entity is a boss.

GetAIHintTriggers(OUT LIST<TRIGGER>:triggers[, [LIST]FIXEDSTRING:tags, INT:needsAllTags = -1)

Returns all AIHintAreaTriggers in <triggers>. Uses contraints if set.

SetCombatTimeout(CHARACTER|ITEM:entity, FLOAT:timer)

Overwrites the entity's combat timeout check.

ResetCombatTimeout(CHARACTER|ITEM:entity)

Resets the entity's combat timeout check.

EnterCombat(CHARACTER|ITEM:source, CHARACTER|ITEM:target)

Enters combat with target

LeaveCombat(CHARACTER|ITEM:source)

Leaves the combat

SetFaction(CHARACTER|ITEM:target, FIXEDSTRING:faction)

Changes the faction of a character or item

SetInvulnerable(CHARACTER|ITEM:target, INT:bool)

Makes the character or item invulnerable or not. (Allow damage)

JumpToTurn(CHARACTER|ITEM:Target)

Jumps to targets turn (ends the current turn)

Sleep(FLOAT:timeInSeconds)

Sleeps for a certain amount of time

CharacterAttack(CHARACTER|ITEM|FLOAT3:target [,INT:alwaysHit])

Moves in weapon range and attacks the target

CharacterAttackWithoutMove(CHARACTER|ITEM|FLOAT3:target [,INT:alwaysHit])

Attacks the target without checking weaponranges and without moving

CharacterMoveTo(GAMEOBJECT|FLOAT3:target, [INT:running=0, INT:shouldArrive=0, INT:longPath=0, FLOAT:minDistance=1.5, FLOAT:maxDistance=minDistance+2.5])

Move to the target. Set shouldArrive to 1 if you want a guaranteed move. (teleports on fail)

CharacterAiMove(FLOAT3:target, CHARACTER:targetCharacter, ITEM:targetItem)

Moves to the target, calculated by the AI. Should only be used with results from the AI!

CharacterMoveInRange(GAMEOBJECT|FLOAT3:target, FLOAT:rangeMin, FLOAT:rangeMax, INT:running, [LIST<TRIGGER>:hintTriggers=null, INT:mustBeInTrigger=0])

Move within a certain range of target. Optionally pass hinttriggers in which the result is preferred/necessary.

CharacterMoveInWeaponRange(GAMEOBJECT|FLOAT3:target, INT:running, [LIST<TRIGGER>:hintTriggers=null, INT:mustBeInTrigger=0])

Move within weapon range of target. Optionally pass hinttriggers in which the result is preferred/necessary.

CharacterMoveInSkillRange(GAMEOBJECT|FLOAT3:target, SKILL:skill, INT:running, [LIST<TRIGGER>:hintTriggers=null, INT:mustBeInTrigger=0])

Move within skill range of target. Optionally pass hinttriggers in which the result is preferred/necessary.

CharacterMoveOutOfSight(FLOAT:angle)

Move out of screen

CharacterPlayAnimation(FIXEDSTRING:animation [, INT:exitOnFinish=1, INT:waitForCompletion=1], INT:noBlend=0])

Plays a certain animation ExitOnFinish means if the exit will kill itself after it was played (revert back to still) WaitForCompletion means if the action will wait for the animation to be played at least once. noBlend means no blending will be performaed when doing this animation.

CharacterStopAnimation(-)

Stops all animations.

CharacterPickUpItem(ITEM:item)

Moves close enough to the item if necessary and picks it up

CharacterUseItem(ITEM:item [, INTEGER:LongPath])

Moves close enough to the item if necessary and uses it

CharacterMoveItem(ITEM:item, INTEGER:ignoreWeight, INTEGER:ignoreAPCost [, INTEGER:ignoreDangerousSurfaces=1, INT:amount=-1, GAMEOBJECT|FLOAT3:destination])

Moves close enough to the item if necessary and moves it to the destination. Will try to find a destination if not supplied.

CharacterAddSkill(CHARACTER:character, SKILL:skill[, INT:ShowNotification=0])

Adds <skill> to <character>

CharacterRemoveSkill(CHARACTER:character, SKILL:skill)

Removes <skill> from <character>

CharacterUseSkill(SKILL:skill, GAMEOBJECT|FLOAT3:target [, GAMEOBJECT|FLOAT3:target2, ITEM:skillItem, INT:ignoreHasSkill=0])

Cast a skill

CharacterAppearAt(GAMEOBJECT|FLOAT3:target, INT:playspawn)

Appear at the target

CharacterAppearOutOfSightTo(GAMEOBJECT:target, FLOAT:angle, INT:playspawn)

Appears out of sight to the players from a certain angle while being able to reach target

CharacterAppearOnTrailOutOfSightTo(CHARACTER:target, FLOAT:angle, INT:playspawn)

Appears out of sight to the players, on its previous locations, from a certain angle while being able to reach target

CharacterDisappear(FLOAT:angle[, INTEGER:isRunning=0])

Move out of screen and go of stage, will run if <isRunning> is not 0

CharacterSetOffStage(-)

Set Off Stage

CharacterSetOnStage(-)

Set On Stage

CharacterLookAt(GAMEOBJECT|FLOAT3|SPLINE:target[, INT:snapToTarget=0, INT:angleTolerance=0])

Rotates the character to look at the target (Closest spline point in case of a spline).

CharacterLookFrom(GAMEOBJECT|SPLINE:target[, INT:snapToTarget=0])

Rotates to the character so it has the same rotation as the target (Closest spline point in case of a spline).

CharacterFollow(CHARACTER:target, FLOAT:durationInSeconds, INT:run)

Follow the target for a certain time

CharacterFollowOwnerOrLeader(FLOAT:durationInSeconds, INT:run)

Follow the leader or owner for a certain time

CharacterWander(FLOAT|TRIGGER:range, FLOAT:durationInSeconds [, INT:run, GAMEOBJECT:anchor])

Wander around for a certain time

CharacterSwitchWeaponType(WEAPON:type)

If necessary switch to the new weapon type

CharacterFleeFrom(RELATION:relation, FLOAT:range)

Run away from certain characters if necessary CharacterFleeFromSurface(SURFACE:surface)

Run away from a certain surface if necessary

CharacterFleeFromDangerousSurface(-)

Run away from a dangerous surfaces if necessary

CharacterAddSourcePoints(CHARACTER:character, INT:amount)

Adds x source points (x can be negative to substract)

CharacterDie(CHARACTER:character[, DEATH:type=DoT])

Kills the character

CharacterHeal(CHARACTER:character, FLOAT:percentage)

Heals the character

CharacterConsume(CHARACTER:character, POTION:potion)

Makes the character consume a potion. Doesn't cost any AP and will just execute the result of the potion.

CharacterDisableAllCrimes(CHARACTER:target)

Disables all generic behaviours for <target>.

CharacterEnableAllCrimes(CHARACTER:target)

Enables all generic behaviours for <target>. CharacterEnableCrime(CHARACTER:target, STRING:crime, ...)

Enables the specified generic behaviours for <target>.

CharacterDisableCrime(CHARACTER:target, STRING:crime, ...)

Disables the specified generic behaviours for <target>.

CharacterSetLongInvestigationDuration(CHARACTER:target)

Doubles the time it takes for the investigation to time out. Use this when the character needs to move a long path before investigating.

CharacterAiCalculate(-)

Calculate the AI of the character

CharacterAiStopCalculate(-)

Stop the calculation of the AI of the character

CharacterAiFinishMoveSkill(-)

Finish the current MoveSkill. CharacterAiAddInterestingItem(CHARACTER:character, ITEM:item)

Make it interesting for the AI to destroy that Item

CharacterAiRemoveInterestingItem(CHARACTER:character, ITEM:item)

Make it no longer interesting for the AI to destroy that Item

CharacterSetArchetype(CHARACTER:character, ARCHETYPE:archetype)

Sets the archetype of the character, used in AI calculations

CharacterSetStoryNPC(CHARACTER:character, INT:bool)

Makes the character storyNPC or not. CharacterAddActionPoints(CHARACTER:character, INT:amount)

Give character some action points

CharacterSetImmortal(CHARACTER:character, INT:bool)

Makes the character immortal or not. (Allow dying)

CharacterPlayEffect(CHARACTER:character, STRING:effect [,FIXEDSTRING:boneName])

Plays an effect on the character and it follows the character

CharacterPlayLoopEffect(OUT INT64:effectHandle, CHARACTER:character, STRING:effect [,FIXEDSTRING:boneName])

Plays a looping effect on the character and it follows the character

CharacterEvent(CHARACTER:character, STRING:eventName)

Throw a character event which you can catch in scripts and story

CharacterItemEvent(CHARACTER:character, ITEM:item, STRING:eventName)

Throw a character/item event which you can catch in scripts and story

CharacterCharacterEvent(CHARACTER:character1, CHARACTER:character2, STRING:eventName)

Throw a character/character event which you can catch in scripts and story

CharacterSetRelationIndivToIndiv(CHARACTER:source, CHARACTER:target, INT:relation)

Changes the relationship between 2 characters. CharacterForceUpdate(INT:forceUpdate)

Makes sure the attached character is always being update or not. CharacterSetEnemy(CHARACTER:character, CHARACTER:enemy)

Sets the current enemy of character

CharacterApplyStatus(CHARACTER:character, STATUS:statusId [, INT:turns=null, INT:force=0])

Applies the status to the character When turns is -1 it's a permanent status When turns is -2 it's a keep alive status (which means it will die if it's not applied again within 1 second)

CharacterRemoveStatus(CHARACTER:character, STATUS:statusId [, STATUS:reasonStatusID=null, INT:notify=1])

Removes the status from the character

CharacterDestroy(CHARACTER:character)

Destroys the character

CharacterSetCanSpotSneakers(CHARACTER:character, INT:enabled)

Enables/Disables the fact if the character can spot sneaking characters.

CharacterSetAttackOfOpportunity(CHARACTER:character, INT:enabled)

Enables/Disables the fact if the character can do attack of opportunities.

CharacterResurrect(CHARACTER:character [, INT:Percentage = 100])

Resurrects the character at [2]% health.

CharacterAddToInventory(CHARACTER:character, FIXEDSTRING:itemStatsObject[, INT:amount, INT:showInTrade=1])

Add the item to the character

CharacterRemoveFromInventory(CHARACTER:character, FIXEDSTRING:itemStatsObject[, INT:amount])

Remove the item from the character. If Amount is -1, then all are removed

CharacterDrinkPotion(FIXEDSTRING:statID)

Makes the character drink a potion from the inventory.

CharacterSetAnimationOverride(CHARACTER:character, FIXEDSTRING:animation)

Sets an animation override, only walk/run/die animations can override it.

CharacterUseActionPoints(CHARACTER:character, INT:amount [, OUT INT:succeeded])

Uses x action points

CharacterAddTreasureTable(CHARACTER:character, FIXEDSTRING:treasureTable)

Adds <treasureTable> to the treasure list of <character>

CharacterRemoveTreasureTable(CHARACTER:character, FIXEDSTRING:treasureTable)

Removes <treasureTable> from the treasure list of <character>

CharacterClearTreasureTables(CHARACTER:character)

Removes all treasure tables from <character>

CharacterSetTemporaryHostileRelation(CHARACTER:character, CHARACTER:otherCharacter)

Creates a temporary hostile relation between the 2 characters!

CharacterSetFightMode(CHARACTER:character, INT:fight [, INT:force=0])

Set the character in sheath/unsheated mode.

CharacterSetStats(CHARACTER:character, FIXEDSTRING:statsEntry [, INT:keepVitality=0, INT:keepAP=0, INT:keepLevel=0, OUT FLOAT:currentHP])

Applies <statsEntry> from character.xlsm to <character>, returns <currentHP>.

CharacterSetWalkSpeedOverride(CHARACTER:character, INTEGER:override [, FLOAT:walkSpeed])

Sets walk speed override of <character>, removes it if <override> is 0

CharacterSetRunSpeedOverride(CHARACTER:character, INTEGER:override [, FLOAT:runSpeed])

Sets run speed override of <character>, removes it if <override> is 0

CharacterSetHasDialog(CHARACTER:character, INTEGER:bool)

Enables/Disables the dialog of the character

CharacterInitPatrol(SPLINE:spline, INT:splineIndex, INT:reversed, INT:running)

Start patroling from the given index along the given spline with the given character.

CharacterStartPatrol(SPLINE:spline, INT:splineIndex, INT:reversed, INT:running)

Start patroling from the given index along the given spline with the given character.

CharacterStopPatrol(-)

Let the character stop patrolling whatever spline he's on!

CharacterInterruptPatrol(-)

Call when the patrol should interrupt so the guard stops moving to the next spline. If this is called when the character is deactivated, a caret will take his place.

CharacterSetAnimationSetOverride(CHARACTER:source, FIXEDSTRING:override)

Sets an animation set override for a character. Empty fixedstring clears the override.

CharacterSetFloating(CHARACTER:target, INTEGER:isFloating)

Sets <target> floating if <isFloating> is not 0

CharacterResetCooldowns(CHARACTER:target)

Resets the skill cooldowns for <target>

ItemEvent(ITEM:item, STRING:eventName)

Throw an item event which you can catch in scripts and story

ItemPlayAnimation(FIXEDSTRING:animation)

Plays an animation on the item

ItemPlayAnimationTo(FIXEDSTRING:animation, FLOAT:targetPercentage, [FLOAT:speed])

Plays an animation on the item to the target time (percentage of the total duration)

ItemPlayEffect(ITEM:item, STRING:effect [,FIXEDSTRING:boneName])

Plays an effect on the item and it follows the item

ItemPlayLoopEffect(OUT INT:effectHandle, ITEM:item, STRING:effect [,FIXEDSTRING:boneName])

Plays a looping effect on the item and it follows the item

ItemSetOnStage(ITEM:item, INTEGER:bool)

Sets an item on or offstage

ItemSetCanInteract(ITEM:item, INTEGER:bool)

Sets an item (not) interactible

ItemClose(ITEM:item)

Close an item

ItemOpen(ITEM:item)

Open an item

ItemDrop(ITEM:item)

Drop an item

ItemLock(ITEM:item, FIXEDSTRING:key)

Lock an item

ItemUnlock(ITEM:item)

Unlock an item

ItemApplyStatus(ITEM:item, STATUS:statusId [, INT:turns=null, INT:force=0])

Applies the status to the item When turns is -1 it's a permanent status When turns is -2 it's a keep alive status (which means it will die if it's not applied again within 1 second)

ItemRemoveStatus(ITEM:item, STATUS:statusId)

Removes the status from the item

ItemDie(ITEM:item)

Kills the item

ItemMoveTo(GAMEOBJECT|FLOAT3:target, FLOAT:velocity, FLOAT:acceleration, INTEGER:matchTargetRotation)

Moves the item to the target

ItemToInventory(ITEM:item, CHARACTER|ITEM:target [,INT:amount=-1])

Moves the item to the target's inventory

ItemLookAt(GAMEOBJECT:target, FLOAT:degreesPerSecond)

Rotates the item to look at the target

ItemDestroy(ITEM:item)

Destroys the item

ItemSetAmount(ITEM:item, INT:amount)

Change the amount of the item

IterateItemsInInventory(CHARACTER|ITEM:source, FIXEDSTRING:eventname[, FIXEDSTRING:tag])

Launch iterate event for each iten in source's inventory. If you pass a tag, it has to have that tag.

ItemAddCharges(ITEM:TargetItem, INT:charges)

Add/subtract charges from an item

ItemResetChargesToInitial(ITEM:TargetItem)

Resets charges from item to initial state

MakePeace(CHARACTER:Source, CHARACTER:Target[, INT:IgnoreVote = 1])

Make peace between users of the characters

MakeWar(CHARACTER:Source, CHARACTER:Target[, INT:IgnoreVote = 1])

Make war between users of the characters

FindSurface(OUT FLOAT3:result, GAMEOBJECT|FLOAT3:source, FLOAT:minRange, FLOAT:maxRange, SURFACE:type [,CHARACTER:alignSource, INT:minEnemiesInSurface, INT:maxAlliesInSurface, INT:minimumCellCount])

Finds the closest surface of a specific type.

FindValidPosition(INOUT FLOAT3:position, FLOAT:radius[, CHARACTER|ITEM:object=null])

Finds the closest valid position (where the object can stand.)

FindPosition(INOUT FLOAT3:position, CHARACTER:source, INT:canStand, INT:checkSight, FLOAT:minRadius, FLOAT:maxRadius, FLOAT:rangeCheck, CHARACTER:alignSource, INT:minAllies, INT:maxAllies, INT:minEnemies, INT:maxEnemies [,FIXEDSTRING:AiHintTag=null, INT:forceHint=0, FLOAT3:SourcePosition])

Finds the closest position from the source (within radius) where the conditions are matched.

Cast(OUT OBJECT variable, OBJECT value)

Casts the value to the variable.

StringConcatenate(STRING:stringA, STRING:stringB, OUT STRING:resultingString)

Appends stringB to stringA. Resulting string is stored in the third parameter.

QUERIES

GetPosition(GAMEOBJECT:object,OUT FLOAT3:src)

Get the current position of an object

GetForwardDirection(GAMEOBJECT:object,OUT FLOAT3:direction)

Get the current forward direction of an object

GetRightDirection(GAMEOBJECT:object,OUT FLOAT3:direction)

Get the current right direction of an object

GetUpDirection(GAMEOBJECT:object,OUT FLOAT3:direction)

Get the current up direction of an object

GetDirection(GAMEOBJECT|FLOAT3:src,GAMEOBJECT|FLOAT3:target,OUT FLOAT3:direction[, OUT FLOAT:distance])

Get the direction from src to target (optional: returns the distance between the objects as well)

GetRotation(GAMEOBJECT:object, OUT FLOAT3:vector)

Get the rotation of an object

CharacterGetTargetSpline(INT: SplineIndex)

Returns the spline index the character is currently walking towards, or -1 if he is not active on a spline.

IsEqual(OBJECT:variable, OBJECT:variable)

Compares both objects and see if they are equal.

IsLessThen(INT|FLOAT:variable, INT|FLOAT:variable)

Compares both objects and see if the first one is smaller.

IsGreaterThen(INT|FLOAT:variable, INT|FLOAT:variable)

Compares both objects and see if the first one is bigger.

IsRandom(FLOAT:percentage)

Each time this condition is checked, it will succeed with a chance of the percentage (between 0 and 1)

IsRound(INT:roundNumber)

Checks if we are currently in combat in round x

IsInSurface(OBJECT|FLOAT3:target, SURFACE:type[, FLOAT:radius])

Check if the character, item, trigger or position is currently within the specific surface.

IsInDangerousSurface(OBJECT|FLOAT3:target[, CHARACTER:character, FLOAT:radius])

Check if <target> is currently in on a dangerous surface. Uses <character> for path influences if provided (is necessary with non-character targets)

IsInDialog(CHARACTER|ITEM:target[, INT:ignoreAutomatedDialogs=0])

Check if the character or item is currently in a dialog, optionally ignoring automated dialogs

IsInAutomatedDialog(CHARACTER|ITEM:target)

Check if the character or item is currently in an automated dialog

GetDistance(OUT FLOAT:distance, GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target)

Returns the distance between 2 positions

GetDistance2D(OUT FLOAT:distance, GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target)

Returns the 2D distance between 2 positions (ignores height)

GetInnerDistance(OUT FLOAT:distance, GAMEOBJECT:source, GAMEOBJECT:target)

Returns the distance between 2 gameobjects (character, item, trigger, ...) Their bounds are already subtracted.

GetPosition(GAMEOBJECT:object, OUT FLOAT3:position)

Returns the position of a gameobject (character, item, trigger, ...)

GetVar(OUT OBJECT:returnValue, CHARACTER|ITEM:target, FIXEDSTRING:varName)

Gets a global variable from the target

GetClosestPlayer(OUT CHARACTER:player, GAMEOBJECT|FLOAT3:source)

Gets the closest player near the source, default being being the object itself

GetPlayerCount(OUT INT:playerCount)

Gets the number of players in the party

GetPlayerByIndex(OUT CHARACTER:returnCharacter, INT:playerIndex)

Gets a player from the party by index

GetRandomCharacter(OUT CHARACTER:returnCharacter, [INT:canBeSelf=0, INT:canBePlayer=0])

Gets a random character in the current level

ContainsSurface(GAMEOBJECT|FLOAT3:source, FLOAT:radius, SURFACE:type,)

Checks if there is any surface of the type within a radius of the source

IsSurface(GAMEOBJECT|FLOAT3:source, FLOAT:radius, SURFACE:type)

Checks if the whole radius around the source is the specified surface type

IsObjectOnObject(CHARACTER|ITEM:source,CHARACTER|ITEM:target)

Checks if the source is standing on the target

GetX(FLOAT3:vector, OUT FLOAT:value)

Returns the X component of the vector

GetY(FLOAT3:vector, OUT FLOAT:value)

Returns the Y component of the vector

GetZ(FLOAT3:vector, OUT FLOAT:value)

Returns the Z component of the vector

CanSee(GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target[, INT:addProjectileTargetGroundOffset=0])

Check if the sight is blocked between 2 points.

IsVisible(CHARACTER|ITEM:object)

Check if the object is set invisible or not with SetVisible.

GetTextDuration(CHARACTER|ITEM:object, FIXEDSRTING:key, OUT FLOAT:duration)

Gets how long a text needs to be displayed

IsCasual(-)

Returns if the current game mode is Casual

IsHardcore(-)

Returns if the current game mode is Hardcore

IsTagged(GAMEOBJECT:object, FIXEDSTRING:tag)

Check if the object is tagged.

TranslatedStringKeyExists(FIXEDSTRING:key)

Check if the TranslatedString key exists.

IsInCombat(CHARACTER|ITEM:object)

Returns true if the object is in combat.

IsInCombatWith(CHARACTER|ITEM:object, CHARACTER|ITEM:object)

Returns true if the objects are in combat with each other.

IsFacing(GAMEOBJECT:source, GAMEOBJECT|FLOAT3:target, [INT:angle=90])

Returns true if the object is facing the position within the given angle.

GameIsSaving(-)

Returns true if the game is saving.

GameIsLoading(-)

Returns true if the game is loading.

GetUserCount(OUT INT:userCount)

Returns the user count.

GetCurrentCharacter(OUT CHARACTER:character, INT:user)

Returns the character currently being controlled by the specified user.

GetCurrentLevel(OUT FIXEDSTRING:currentLevel)

Returns the current levelname

GetAIBounds(CHARACTER|ITEM:source, OUT FLOAT:bounds)

Returns AI bounds of <source> in <bounds>

HasGlobalFlag(FIXEDSTRING:flagName)

Returns if the Global Flag is set

HasFlag(CHARACTER|ITEM:object, FIXEDSTRING:flagName)

Returns if the Flag is set on the Object

HasUserFlag(CHARACTER:object, FIXEDSTRING:flagName)

Returns if the Flag is set on the user's characters

HasPartyFlag(CHARACTER:object, FIXEDSTRING:flagName)

Returns if the Flag is set on the party's characters

DialogExists(STRING:dialogue)

Returns true if the dialogue exists.

IsActive(CHARACTER|ITEM:Object)

Returns if the character or item is currently active.

ListGetSize(LIST<OBJECT>:list, out INT:size)

Returns the number of elements in <list>

ListGet(LIST<OBJECT>:list, INT:index, out OBJECT:entry)

Returns <entry> at <index> of <list>

ListGetRandom(LIST<OBJECT>:list, out OBJECT:entry)

Returns a random <entry> of <list>

IsBoss(CHARACTER|ITEM:Object)

Returns true if the entity is tagged as a boss

IsProjectileSkill(SKILL:skill)

Returns true if the skill is a ranged skill (uses a projectile)

IsValidSkillTarget(CHARACTER:source, OBJECT|FLOAT3:target, SKILLID:skill[, INTEGER:ignoreRangeCheck=0])

Checks whether <target> is a valid target for <skill> at <source>

GetFaction(OUT FIXEDSTRING:faction, CHARACTER|ITEM:character)

Returns the faction of the provided character or item

IsInActiveTurn(CHARACTER|ITEM:target)

Returns true if it's the character's or item's turn in combat.

IsSkillActive(CHARACTER:character, SKILL:skillId)

Returns true if <character> has <skillId> active (in memory).

HasSkillAi(SKILLID:skillId)

Returns true if the skill is using the new Ai system

IsInArena(CHARACTER::character)

Returns true if the character is in an arena fight

CrimeGetType(INTEGER:crimeId, OUT STRING:crimeType)

Returns the type of the crime with this id.

CrimeGetCriminals(INTEGER:crimeId, OUT CHARACTER:criminal1, OUT CHARACTER:criminal2, OUT CHARACTER:criminal3, OUT CHARACTER:criminal4)

Returns the criminals of that crime. They might all be null.

IsSourceSkill(SKILL:skill)

Returns true if the skill is a source skill.

IsInGameMasterMode(-)

Returns true if the game in game master mode.

CharacterGet(OUT CHARACTER:character, GAMEOBJECT|FLOAT3:src, FLOAT:range, COMPARE:howTo, COMPAREFUNC:compareFunc[, RELATION: relation, SURFACE:surface, STATUS:status, TALENT:talent, CHARACTER:inSightOf, FIXEDSTRING:tag])

Get a character within a certain range conforming to the filled in restraints.

CharacterCount(OUT INT:count, GAMEOBJECT|FLOAT3:src, FLOAT:range, [RELATION: relation, SURFACE:surface, STATUS:status, TALENT:talent, CHARACTER:inSightOf])

Counts the characters within a certain range conforming to the filled in restraints.

CharacterGetOwner(OUT CHARACTER:owner, CHARACTER:source)

Get the character's owner

CharacterGetFollow(OUT CHARACTER:to follow, CHARACTER:source)

Get the character to follow

CharacterGetEnemy(OUT CHARACTER:current enemy, CHARACTER:source)

Get current enemy of character

CharacterCanCast(CHARACTER:source, SKILL:skillId, [ITEM:skillItem=null, INT:ignoreActionPoints=0])

Check if the character source can cast the skill: will check cooldown, actionpoints

CharacterCanSitOnItem(CHARACTER:source, ITEM:item)

Check if the character source can sit or lie on an item.

CharacterCanDrinkPotion(CHARACTER:source, FIXEDSTRING:potionID[, INT:ignoreActionPoints=0])

Check if the character source can drink the potion: will check inv and actionpoints

CharacterCanUseItem(CHARACTER:source, ITEM:item[, INT:ignoreActionPoints=0])

Check if the character source can use the item in the world

CharacterCanUseItemInInventory(CHARACTER:source, ITEM:item[, INT:ignoreActionPoints=0])

Check if the character source can use the item in his inventory

CharacterCanSee(CHARACTER:watchingChar, CHARACTER|ITEM:target [, INT:forceUpdate=0])

Check if character has target in his line of sight.

CharacterCanShoot(CHARACTER:source, GAMEOBJECT|FLOAT3:target)

Check if the character can shoot the target.

CharacterIsPlayer(CHARACTER:character)

Check if the character is a player

CharacterIsInParty(CHARACTER:character)

Check if the character is in the party

CharacterIsEnemy(CHARACTER:source, CHARACTER:target)

Check if target is enemy of source

CharacterIsAlly(CHARACTER:source, CHARACTER:target)

Check if target is ally of source

CharacterIsNeutral(CHARACTER:source, CHARACTER:target)

Check if target is neutral of source

CharacterIsDead(CHARACTER:character)

Check if character is dead

CharacterIsMoving(CHARACTER:character)

Check if character is moving (speed > 0)

CharacterIsSummon(CHARACTER:character)

Check if character is a summon

CharacterIsPartyFollower(CHARACTER:character)

Check if character is a party follower

CharacterIsStoryNPC(CHARACTER:character)

Check if character is a story NPC

CharacterInWeaponRange(CHARACTER:character, CHARACTER:target)

Check if target is in the current's weapon range

CharacterInTouchRange(CHARACTER:character, CHARACTER:targetChar)

Check if target is in the character's touch range

CharacterHasStatus(CHARACTER:character, STATUS:statusId[, FIXEDSTRING:extraData])

Check if character currently has the status. ExtraData can be filled in for some statuses: - Consume: statsid of the item - Shield: skillid of the shield

CharacterGetStatusSourceCharacter(CHARACTER:character, STATUS:statusId, OUT CHARACTER:source[, FIXEDSTRING:extraData])

Get the source character of a status

CharacterGetStatusSourceItem(CHARACTER:character, STATUS:statusId, OUT ITEM:source[, FIXEDSTRING:extraData])

Get the source item of a status

CharacterHasTalent(CHARACTER:character, TALENT:talent)

Check if character currently has the talent

CharacterHasSkill(CHARACTER:character, SKILL:skillId)

Check if character currently has the skill

CharacterHasWeaponType(CHARACTER:character, WEAPON:weaponTYPE [, INT:equipped])

Check if character currently has a weapon of this type in his inventory or equipped

CharacterGetStat(OUT FLOAT:statValue, CHARACTER:character, CHARACTERSTAT:statType)

Returns the current value of the stat (Vitality, ...)

CharacterGetSightRange(OUT FLOAT:range, CHARACTER:character)

Returns the character's sight range

CharacterGetWeaponRange(OUT FLOAT:minRange, OUT FLOAT:maxRange, CHARACTER:character)

Returns the character's current weapon range

CharacterGetTouchRange(OUT FLOAT:touchRange, CHARACTER:character)

Returns the character's current touch range

CharacterGetSkillRange(OUT FLOAT:minRange, OUT FLOAT:maxRange,CHARACTER:character, SKILL:skillId)

Returns the character's skill range

CharacterGetSkillImpactRange(OUT FLOAT:areaRange, CHARACTER:character, SKILL:skillId)

Returns the character's skill range

CharacterIsInTrigger(CHARACTER:character, TRIGGER:trigger)

Check if character is in given trigger

CharacterGetAbility(OUT INT:value, CHARACTER:character, ABILITY:ability)

Returns the character's value of the specified ability

CharacterGetHostileCount(OUT INT:value, CHARACTER:character)

Returns how many characters are targeting this character right now... You can iterate over them with IterateEnemiesOf.

CharacterCanFight(CHARACTER:character)

Returns true if the character can fight.

CharacterGetTemplate(CHARACTER:character, OUT CHARACTERTEMPLATE:root)

Returns the roottemplate of the character.

CharacterCanSpotSneakers(CHARACTER:character)

Returns true if the character can spot sneaking characters

CharacterIsFloating(CHARACTER:character)

Check if character is a floating character

CharacterInCreation(CHARACTER:character)

Returns true if the character is in character creation

CharacterAvoidsTraps(CHARACTER:character)

Returns true if the character avoids traps

CharacterCheckRelation(CHARACTER:character, RELATION:relation)

Returns true if relation check succeeds

CharacterIsBetterOrEqualClass(CHARACTER:character, INT:currentScore, OUT INT:newScore, INT warriorScore, INT rogueScore, INT mageScore, INT clericScore, INT rangerScore)

Returns true if score is higher or equal than the current score

CharacterHasBeenHitBy(CHARACTER:character, DAMAGE_TYPE:damageType)

Returns true if the character was hit by this type.

CharacterHasCastedSpellLastTurn(CHARACTER:character)

Returns true if the character has casted a spell in his last turn.

CharacterHasHadStatus(CHARACTER:character, STATUS:status)

Returns true if the character has had a specific status this combat.

CharacterHasAnimationOverride(CHARACTER:character)

Returns true if the character has an animation override.

CharacterCanUnlock(CHARACTER:character, ITEM:item)

Returns true if the character can unlock the item (if the item is already unlocked it returns true!)

CharacterGetReservedUserID(OUT INT:user, CHARACTER:character)

Returns the character's reserved User id.

CharacterGetRace(CHARACTER:character, OUT FIXEDSTRING:race)

Returns the <character>'s race in <race>.

CharacterIsRace(CHARACTER:character, FIXEDSTRING:race)

Returns true if <character>'s race is <race>.

CharacterCanMoveItem(CHARACTER:character, ITEM:item, FLOAT:minRadius, FLOAT:maxRadius [, OUT FLOAT3:destination])

Returns true + <destination> if <character> can move <item> somewhere between <minRadius> and <maxRadius>.

CharacterGetDeathType(CHARACTER:character, OUT FIXEDSTRING:deathType)

Returns death type of <character> in <deathType>.

CharacterGetStillAnimation(CHARACTER:object, OUT FIXEDSTRING:stillAnimation)

Returns the still animation to play

CrimeTransferLeadership(INT: CrimeID[, FIXEDSTRING:Tag1,...])

Try and transfer the leadership of this crime to someone else.

CrimeGetLeadInvestigator(OUT CHARACTER:lead, INT: CrimeID)

Returns the lead investigator for the crime.

CharacterCanHitTargetWithRangedWeapon(CHARACTER:source, OBJECT|FLOAT3:target[, SKILL:skill = null])

Returns true if <source> can hit <target> with currently equipped ranged weapon. Will use <skill> instead of equipped weapon if provided.

CharacterHasRangedWeapon(CHARACTER:character[, INT:checkInventory = 0])

Returns true if <character> has has ranged weapon. Checks for non-wielded weapons if <checkInventory> is 1

CheckInteractionReach(CHARACTER:character, CHARACTER|ITEM: target)

Returns true if <character> could interact with <target>. This is not checking ranges, but checking if there's too much of a height difference or too many obstacles in between.

CharacterGetSourcePoints(CHARACTER:character, OUT INT: amount)

Returns the amount of sourcepoints of <character>.

CharacterAiIsCalculating(-)

Returns if the character is still calculating the AI.

CharacterAiFetchMoveSkillCommand(OUT SKILL:skill, OUT ITEM:skillItem, OUT FLOAT3:target)

Returns if the character has a Move Skill command to execute according to the AI.

CharacterAiFetchSkillCommand(OUT SKILL:skill, OUT ITEM:skillItem, OUT FLOAT3 endPosition, OUT FLOAT3:target, OUT CHARACTER:target, OUT ITEM:target, OUT FLOAT3:target2, OUT CHARACTER:target2, OUT ITEM:target)

Returns if the character has a Skill command to execute according to the AI.

CharacterAiFetchConsumeCommand(OUT ITEM:item)

Returns if the character has a Consume command to execute according to the AI.

CharacterAiFetchAttackCommand(OUT FLOAT3:endPosition, OUT FLOAT3:target, OUT CHARACTER:target, OUT ITEM:target)

Returns if the character has a Attack command to execute according to the AI.

CharacterAiFetchFallbackCommand(OUT FLOAT3:targetPosition, OUT FLOAT3:lookAtPosition)

Returns if the character has a Fallback command to execute according to the AI.

CharacterGetArchetype(CHARACTER:character, OUT ARCHETYPE:archetype)

Returns the archetype of the character.

CharacterIsPolymorphedInto(CHARACTER:character, FIXEDSTRING:race)

Returns true if <character> is polymorphed into <race>. Race can be a race (like HUMAN), but also a template (in case of a polymorph skill like Chicken Touch).

CharacterIsPolymorphInteractionDisabled(CHARACTER:character)

Returns true if <character> has his interaction disabled because of a polymorph.

ItemGet(OUT ITEM:item, GAMEOBJECT|FLOAT3:src, FLOAT:range, COMPARE:howTo [, COMPAREFUNC:compareFunc, FIXEDSTRING:rootTemplate, FIXEDSTRING:tag])

Get an item within a certain range conforming to the filled in restraints.

ItemGetFromInventory(OUT ITEM:item, CHARACTER|ITEM:object [, FIXEDSTRING:statsId, FIXEDSTRING:tag, INT:isEquiped])

Returns the first item in the inventory conforming to the filled in restraints.

ItemIsInCharacterInventory(ITEM:item, CHARACTER:object)

Returns if the item is in the inventory of the character

ItemIsInTrigger(ITEM:item, TRIGGER:trigger)

Check if item is in given trigger

ItemGetStat(OUT FLOAT:statValue, ITEM:item, ITEMSTAT:statType)

Returns the current value of the stat (Weight, ...)

ItemIsMoving(ITEM:item)

Returns if the item is moving or not.

ItemIsFalling(ITEM:item)

Returns if the item is falling or not. (after teleport)

ItemIsOpening(ITEM:item)

Returns if the item is opening or not.

ItemIsClosing(ITEM:item)

Returns if the item is closing or not.

ItemIsLocked(ITEM:item)

Returns if the item is locked or not.

ItemIsMovable(ITEM:item)

Returns if the item is movable or not.

ItemCanBeLockPicked(ITEM:item)

Returns if the item is can be opened by lockpicking.

ItemIsOpen(ITEM:item)

Returns if the item is open or not.

IsStoryItem(ITEM:item)

Returns if the item is a story item.

ItemHasStatus(ITEM:item, STATUS:statusId)

Returns if the item has the status.

ItemIsDestroyed(ITEM:item)

Returns if the item is destroyed.

ItemGetTemplate(ITEM:item, OUT ITEMTEMPLATE:root)

Returns the roottemplate of the item.

ItemGetSkillId(ITEM:item, OUT SKILL:root)

Returns the skillid of the item if it has one.

ItemGetItemType(ITEM:item, OUT FIXEDSTRING:itemType)

Returns the itemtype of the item: common, unique, rare, ...

ItemGetStatusSourceCharacter(ITEM:item, STATUS:statusId, OUT CHARACTER:source)

Get the source character of a status

ItemGetStatusSourceItem(ITEM:item, STATUS:statusId, OUT ITEM:source)

Get the source item of a status

ItemCanBeMoved(ITEM:item)

Returns if the item can be moved.

GetStatusTurns(CHARACTER|ITEM:object, STATUS:statusId, OUT INT:turnsLeft)

Returns true if the object has the given status, and returns the amount of turns still left

EVENTS

OnCharacterEvent(CHARACTER:character, STRING:eventName)
Thrown from scripts or story

OnCharacterItemEvent(CHARACTER:character, ITEM:item, STRING:eventName)
Thrown from scripts or story

OnCharacterCharacterEvent(CHARACTER:character, CHARACTER:character, STRING:eventName)
Thrown from scripts or story

OnItemEvent(ITEM:item, STRING:eventName)
Thrown from scripts or story

OnItemDestroyed(ITEM:item)
Thrown when an item is destroyed

OnItemDestroying(ITEM:item)
Thrown when an item is being destroyed

OnItemOpened(ITEM:item)
Thrown when an item is opened

OnItemClosed(ITEM:item)
Thrown when an item is closed

OnItemDropped(ITEM:item, STRING:itemTemplate)
Thrown when an item is dropped

OnGlobalFlagSet(FIXEDSTRING:eventName)
Thrown when a global event is set

OnGlobalFlagCleared(FIXEDSTRING:eventName)
Thrown when a global event is cleared

OnCharacterFlagSet(FIXEDSTRING:eventName, CHARACTER:character)
Thrown when a dialog event is set on a character

OnCharacterFlagCleared(FIXEDSTRING:eventName, CHARACTER:character)
Thrown when a dialog event is cleared on a character

OnItemFlagSet(FIXEDSTRING:eventName, ITEM:item)
Thrown when a dialog event is set on an item

OItemFlagCleared(FIXEDSTRING:eventName, ITEM:item)
Thrown when a dialog event is cleared on an item

OnTimer(FIXEDSTRING:timerName)
Thrown when a timer has ended

OnInit(-)
Thrown when the script is set

OnLoaded(INT:major, INT:minor, INT:revision, INT:build)
Thrown when the script is loaded from the savegame

OnShutdown(-)
Thrown when the character's script is removed

OnVariableCleared(FIXEDSTRING:varName)
Thrown when this object's script variable is cleared from Osiris with ClearVarObject

OnCombatStarted(INT:combatID)
Thrown when combat starts

OnCombatSwitched(CHARACTER:source, ITEM:source)
Thrown when the character switch from one combat to another

OnLeftCombat(CHARACTER:source, ITEM:source)
Thrown when the character or item left the combat

OnTurn(CHARACTER:source, ITEM:source)
Thrown when the character's turn starts

OnTurnEnded(CHARACTER:source, ITEM:source)
Thrown when the character's turn ended

OnCharacterVitalityChanged(CHARACTER:character, FLOAT:percentage)
Thrown when the characters's vitality changed

OnItemVitalityChanged(ITEM:item, FLOAT:percentage)
Thrown when the item's vitality changed

OnAttackOfOpportunity(CHARACTER:target)
Thrown when the characters gets an attack of opportunity on an enemy

OnClearAttackOfOpportunity(-)
Thrown when the characters attack of opportunity is cleared

OnDamage(DAMAGE:type, FLOAT:percentage, CHARACTER:source, ITEM:source)
Thrown when the object receives damage

OnMiss(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target)
Thrown when the character dodges something

OnCriticalHit(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target)
Thrown when the character is critical hit

OnPreBlock(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target)
Thrown before the character blocks something (at the start of the attack animation)

OnBlock(CHARACTER:source, ITEM:source, CHARACTER:target, ITEM:target)
Thrown when the character blocks something

OnDie(CHARACTER:character, DAMAGE:type, CHARACTER:source, ITEM:source)
Thrown when the character dies

OnCharacterStatusAttempt(CHARACTER:character, STATUS:status)
Thrown when the character attempts to gain a status

OnCharacterStatusApplied(CHARACTER:character, STATUS:status)
Thrown when the character gains a status

OnCharacterStatusRemoved(CHARACTER:character, STATUS:status)
Thrown when the character loses a status

OnItemStatusAttempt(ITEM:item, STATUS:status)
Thrown when the item attempts to gain a status

OnItemStatus(ITEM:item, STATUS:status)
Thrown when the item gains a status

OnItemStatusRemoved(ITEM:item, STATUS:status)
Thrown when the item loses a status

OnStatusCreateVisuals(STATUS:status)
Thrown when the item should create the visuals for this status

OnStatusDestroyVisuals(STATUS:status)
Thrown when the item should destroy the visuals for this status

OnSight(CHARACTER:character)
Thrown when the character sees another character

OnLostSight(CHARACTER:character)
Thrown when the character doesn't see another character anymore

OnUseItem(CHARACTER:source, ITEM:item)
Thrown when a character uses an item

OnPickupItem(CHARACTER:source, ITEM:item)
Thrown when a character picks up an item

OnCharacterPreMovedItem(CHARACTER:source, ITEM:item)
Event thrown just before a character moves an item. No difference whether it is in the world or in their inventory

OnCharacterMovedItem(CHARACTER:source, ITEM:item)
Thrown when a character moved an item

OnItemEquipped(CHARACTER:source, ITEM:item)
Thrown when a character equips an item

OnItemUnequipped(CHARACTER:source, ITEM:item)
Thrown when a character unequips an item

OnIterateCharacter(CHARACTER:character, FIXEDSTRING:eventId)
Thrown by iterators

OnIterateItem(ITEM:source, FIXEDSTRING:eventId)
Thrown by iterators

OnIterateCount(FIXEDSTRING:eventId, INTEGER:Count)
Thrown by iterators after all iterations to inform you of the count.

OnStoryOverride(-)
Throw when story overrides what the character was doing: teleport, movement, on/offstage

OnTriggerEnter(CHARACTER:character, ITEM:item, FIXEDSTRING:eventId)
Thrown by a character or item entering an EventTrigger

OnTriggerLeave(CHARACTER:character, ITEM:item, FIXEDSTRING:eventId)
Thrown by a character or item leaving an EventTrigger

OnEnemyChanged(CHARACTER:character, CHARACTER:newEnemy)
Thrown when the character's currentenemy changes

OnTalentUnlocked(CHARACTER:character, TALENT:newTalent)
Thrown when the character unlocks a new talent

OnTalentLocked(CHARACTER:character, TALENT:removedTalent)
Thrown when the there's a talent removed from a character

OnCharacterClassChanged(CHARACTER:character, FIXEDSTRING:class)
Thrown when the character changes class in the character creation screen

OnCharacterCreationStarted(CHARACTER:character, TRIGGER:creationPoint)
Thrown when the character creation has started, and gives where the character should walk to

OnCharacterCreationStopped(CHARACTER:character)
Thrown when the character creation has stopped

OnFunction(FIXEDSTRING:functionName)
Throws an event on itself with the functionName. This is to fake function calls

OnSkillCast(CHARACTER:character, SKILL_ID:skillID)
Thrown when the character casts a skill

OnSkillCombatComment(CHARACTER:character, SKILL_ID:skillID)
Thrown when the character needs to make a comment

OnCharacterUsedSkillOnMe(CHARACTER:character, SKILL_ID:skillID)
Thrown when you are hit by a skill from a character

OnItemUnlocked(ITEM: item, CHARACTER:character, ITEM:key)
Thrown when an item gets unlocked by a character.

OnAutomatedDialogEnded(STRING:dialogName, INT:instanceID)
Thrown when a automated dialog is ended for this speaker

OnAutomatedDialogStarted(STRING:dialogName, INT:instanceID)
Thrown when a automated dialog is started for this speaker

OnDialogStarted(STRING:dialogName, INT:instanceID)
Thrown when a dialog is started for this speaker

OnDialogEnded(STRING:dialogName, INT:instanceID)
Thrown when a dialog is ended for this speaker

OnCrimeSensibleAction(FIXEDSTRING:regionID, INT:crimeID, FIXEDSTRING:reactionName, STRING:primaryDialog, CHARACTER:criminal1, CHARACTER:criminal2, CHARACTER:criminal3, CHARACTER:criminal4, INT:IsPrimary)
Thrown when a character needs to perform a sensible action against criminals

OnCrimeInterrogationRequest(FIXEDSTRING:regionID, INT:crimeID, CHARACTER:criminal1, CHARACTER:criminal2, CHARACTER:criminal3, CHARACTER:criminal4, STRING:interrogationDialog)
Thrown when a character needs to perform an interrogation against criminals

OnCrimeInvestigate(FLOAT3:CrimePosition, INT:crimeID)
One NPC investigates a crimescene

OnCrimeAlarmed(FLOAT3:CrimePosition, INT:crimeID)
All NPCs in a crimearea start looking around.

OnCrimeReturnToNormal(-)
Investigation or Alarm timed out.

OnCrimeAborted(-)
The game interrupted the sensible action of this NPC.

OnSplineControlPointReached(INT:Index, INT:EndReached, STRING:EventString)
Thrown when a character reached a spline node.

'OnFinishCalculationAi(-)
Thrown when the calculation of the AI is finished.

OnGrenadeLand(INT:hitObstacle, CHARACTER:caster)
Thrown when the grenades lands

FetchCharacterApplyStatusData(CHARACTER:character, STATUS:status) RETURN(LIST<STATUS>:removeStatuses, STATUS:applyStatus, INT:turns)
Fetch from script which statuses to remove and apply.

FetchItemApplyStatusData(ITEM:item, STATUS:status) RETURN(LIST<STATUS>:removeStatuses, STATUS:applyStatus, INT:turns)
Fetch from script which statuses to remove and apply.

FetchItemSkillOnDamage(INT:damage, DAMAGE_TYPE:damageType) RETURN(INT:hasSkill, SKILL_ID:skillID, INT:casterLevel)
Fetch from script what skill to execute on damage.

FetchSkillScore(SKILL_ID:skillId, CHARACTER:sourceCharacter, CHARACTER:targetCharacter1, ITEM:targetItem1, FLOAT3:targetPosition1, CHARACTER:targetCharacter2, ITEM:targetItem2, FLOAT3:targetPosition2) RETURN(FLOAT:score)
Fetch from script the score of a skill with set source and target

OnActivate(-)
Thrown when a character/item activates

OnDeactivate(-)
Thrown when a character/item deactivates

OnCharacterUsedSourcePoint(CHARACTER:character)
Thrown when a character uses a source point

OnSkillAdded(CHARACTER:character, SKILL_ID:skillId, INT:learned)
Thrown when a character learns a skill

OnSkillActivated(CHARACTER:character, SKILL_ID:skillId)
Thrown when a character activates (=adds to memory) a skill

OnSkillDeactivated(CHARACTER:character, SKILL_ID:skillId)
Thrown when a character deactivates (=removes from memory) a skill

OnItemFlagShared(FIXEDSTRING:eventName, ITEM:item, INT:newValue)
Thrown when a dialog event is shared with an item

OnCharacterFlagShared(FIXEDSTRING:eventName, CHARACTER:character, INT:newValue)
Thrown when a dialog event is shared with a character

OnItemOffStageChanged(CHARACTER:character, INT:offstage)
Thrown when a character is set on/off stage

OnCharacterOffStageChanged(ITEM:item, INT:offstage)
Thrown when a item is set on/off stage

OnCharacterTeleported(CHARACTER:target, CHARACTER:cause, FLOAT3:oldPosition, FLOAT3:newPosition, SKILL_ID:skillId)
Thrown when a character gets teleported with a teleport skill

OnCombatTick(-)
Thrown when this object ticks in combat. Only thrown for objects that don't get a turn.

OnCombatRoundStarted(INT:combatID, INT:roundID)
Thrown when a round in a combat starts

OnReadyInCombat(CHARACTER:character, ITEM:item, INT:combatID)
Thrown when a character or item is ready in combat

OnRegionLeft(CHARACTER:character, ITEM:item, FIXEDSTRING:region)
Thrown when a character or item leaves a region

OnRegionEntered(CHARACTER:character, ITEM:item, FIXEDSTRING:region)
Thrown when a character or item enters a region

OnRuneInserted(CHARACTER:character, ITEM:item, ITEMTEMPLATE:runeItemTemplate, INT:slot)
Thrown when a <character> inserts a rune with roottemplate <runeItemTemplate> from an <item> at a specified <slot>

OnRuneRemoved(CHARACTER:character, ITEM:item, ITEM:rune, INT:slot)
Thrown when a <character> removes a <rune> from an <item> at a specified <slot>

OnCharacterStartAttackObject(CHARACTER:defenderCharacter, ITEM:defenderItem, CHARACTER:attackerOwner, CHARACTER:attacker)
Thrown when a character attacks a character or item with default attack

OnCharacterStartAttackPosition(FLOAT3:position, CHARACTER:attackerOwner, CHARACTER:attacker)
Thrown when a character attacks a position with default attack

INTERRUPTS

OnMovementFailed(FLOAT3:targetPos)
Thrown when the reaction is interrupted by a move action failing

OnException(-)
Thrown when the reaction is interrupted by an exception

OnBetterReactionFound(FIXEDSTRING:reactionName)
Thrown when the reaction is interrupted by another reaction

OnNoReactionFound(-)
Thrown when the reaction is interrupted because no reaction is valid

OnScriptDisabled(-)
Thrown when the reaction is interrupted because the scriptcontroller is disabled

OnManualInterrupt(FIXEDSTRING:reactionName)
Thrown when the reaction is interrupted using the interrupt action

OnRegionSwap(FIXEDSTRING:oldLevel, FIXEDSTRING:newLevel)
Thrown when the reaction is interrupted by a region swap

Divinity: Original Sin 2 Definitive Edition

The following was added/changed for the Definitive Edition.

CALLS

ItemDrop(ITEM:item)
Drops an item from it's owner's inventory. Only characters are treated as owners.

RemoveSurfaceLayerAt(GAMEOBJECT|FLOAT3:target, INT:layer, FLOAT:radius)
Removes surface (ground or cloud) at object/position. (Layer 0 for surface, otherwise - cloud) (Radius for cleanup)

SurfaceCreateLink(GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target)
Makes surfaces at 2 locations/positions interact as if they were adjacent.

SurfaceRemoveLink(GAMEOBJECT|FLOAT3:source, GAMEOBJECT|FLOAT3:target)
Stops surfaces at 2 distinctive locations/positions from interacting.

QUERIES

AttributeGetDifficultyLevelMappedValue(FIXEDSTRING:difficulty, INT:level, OUT INT:levelMappedValue)
Returns a level-mapped value of a primary attribute. (Difficulty = "Easy", "Normal" or "Hard")

CharacterGetCreationClass(CHARACTER:character, OUT FIXEDSTRING: class)
During character creation returns character class. Fails outside of character creation.

CharacterGetEquippedItem(CHARACTER:character, FIXEDSTRING:slot, OUT ITEM:seatingItem)
Returns item equipped into slot. (Slot = "Helmet", "Breast", "Leggings", "Weapon", "Shield", "Ring", "Ring2", "Belt", "Boots", "Gloves", "Amulet" or "Wings")

(CHANGED) CharacterInCreation(CHARACTER:character, OUT INT:CharacterIndex)
Checks if character is in character creation currently. (CharacterIndex: assigned index of the player character during character creation)