Script:Commands

From Arx Libertatis Wiki
Jump to navigation Jump to search

Commands are invoked by entity scripts to perform some action.

Syntax

commandname [-flags] [parameters...]

All underscores in the command name are ignored: _a_cool__c_o_m_m_a_n_d and acoolcommand call the same command.

If you want to find uses of a command in the game's script files, Arx Libertatis includes a helper script: find-script-command

Flags

Script commands can accept an optional set of flags. Each flag is a single character and the order of the flags doesn't matter. Flags always come before all other parameters.

Parameters

The number of parameters a command is fixed fixed for each set of flags except for special invocations with a fixed value for the first parameter (e.g. none for some commands).

Other commands as parameters

Some commands can take other commands as parameters. In this case all remaining commands on the same line are considered part of the command argument and will be skipped during normal execution. Braces ({ … }) can be used to create a multi-line command parameter.

List

The following is a (incomplete) list of supported commands.

<parameter> denotes a required parameter while [f?parameter] is an optional parameter enabled with flag -f.

ComandContextDescription
++ <variable>Any EntityIncrement a number or int script variable.
-- <variable>Any EntityDecrement a number or int script variable.
acceptIgnoredEnd script event execution with a positive result.
activatephysicsAny EntityEnable gravity.
addbagIgnoredAdd a bag to the player inventory.
addgold <amount*>IgnoredAdd gold to the player's purse.
addxp <amount*>IgnoredAdd to the player's experience points.
ambiance [-vn] [v?volume*] <ambiance>
ambiance kill
IgnoredPlay or stop an ambiance.
anchorblock <block>Any EntityBlock or unblock pathfinding nodes.
attach <source> <sourcevertex> <target> <targetvertex>For selfLink the position and rotation of an entity to another entity.
attachnpctoplayerIgnored.
attractor <entity> <power*> <radius*>
attractor <entity> off
For selfPull/push the player towards/away from an entity.
book [-aem] open
book [-aem] close
book [-aem] change
IgnoredOpen/close the player book and/or change the page.
cameraactivate <camera>
cameraactivate none
For selfSwitch to a camera.
camerafocal <focal*>CamerasSet the focal length.
camerasmoothing <value*>
camerasmoothing none
CamerasSet rotation smoothing when tracking a target.
cameratranslatetarget <dx*> <dy*> <dz*>CamerasTarget position offset.
cine [-p] <cinematic>
cine play
cine kill
IgnoredPlay or stop a cinematic.
cinemascope [-s] <enable>IgnoredEnable or disable cinematic borders.
closestealbagIgnoredClose any non-player inventory in the HUD if the player is stealing.
collision <enable>Any EntityEnable or disable collisions.
conversation offIgnored.
damager [-fmplcgewsaornu] <damage*>Any EntitySet the collision damage.
dec <variable> <value*>Any EntitySubtract a value from a number or int script variable.
destroy <entity>
destroy <spell>
For selfDestroy an entity or spell.
detach <source> <target>For selfUnlink the position and rotation of an entity from another entity.
detachnpcfromplayerIgnored.
div <variable> <value*>Any EntityDivide a number or int script variable by a value.
dodamage [-fmplcgewsaornu] <target> <damage*>For selfDamage other entities.
drawsymbol <rune> <duration*>Any EntityDraw a rune symbol as if casting a spell.
elseIgnoredSkip the next command block.
endgameIgnoredEnd the game and roll the credits.
endintroIgnoredEnd the game without showing credits.
equip [-r] playerAny EntityMake the player equip or unequip the caller.
forceangle <yaw*>Any EntitySet the orientation.
forceanim <animslot>Any EntityForce play an animation.
gmode <mode>Ignored.
gosub <label>IgnoredJump to a label and add a return point.
goto <label>IgnoredJump to a label.
herosay [-d] <textkey*>IgnoredShow a message at the top of the screen.
if <needle*> iselement <haystack*>
if <needle*> isin <haystack*>
if <stringa*> isclass <stringb*>
if <entity*> [!]isgroup <group*>
if <entity*> istype <type*>
if <stringa*> (==|!=) <stringb*>
if <numbera*> (==|!=|<=|<|>=|>) <numberb*>
For selfConditionally execute or skip the next command block.
ifexistinternal <entity>IgnoredSkip the next command block if an entity doesn't exist in the current level.
ifvisible <entity>Any EntitySkip the next command block unless an entity is inside the cone of vision.
inc <variable> <value*>Any EntityAdd a value to a number or int script variable.
inventory add <script>Any EntityCreate a single new item and place it into the inventory.
inventory addfromscene <item>Any EntityAdd an existing item to the inventory.
inventory addmulti <script> <count*>Any EntityCreate a new item stack and place it into the inventory.
inventory closeAny EntityClose any non-player inventory in the HUD.
inventory createAny EntityEnable and clear the inventory.
inventory destroyAny EntityDisable the inventory.
inventory openAny EntityOpen the inventory in the HUD.
inventory playeradd <script>IgnoredCreate a single new item and place it into the player inventory.
inventory playeraddfromscene <item>For selfAdd an existing item to the player inventory.
inventory playeraddmulti <script> <count*>IgnoredCreate a new item stack and place it into the player inventory.
inventory skin <skin>Any EntityChange the inventory background.
invertedobject <enable>Any Entity.
invulnerability [-p] <enable>IgnoredAllow or prevent damage from affecting the caller or player.
keyringadd <key*>IgnoredAdd a key to the player's keyring.
linkobjtome <source*> <vertex>Any EntityLink the position and rotation of an entity to the caller.
loadanim [-p] <animslot> <file>Any EntityLoad an animation into a slot.
magic <enable>IgnoredEnable or disable spellcasting.
mapmarker <x*> <y*> <maplevel*> <textkey>
mapmarker -r <textkey>
IgnoredAdd a marker to the map.
move <dx*> <dy*> <dz*>Any EntityAdjust the world position.
mul <variable> <value*>Any EntityMultiply a number or int script variable with a value.
nopIgnoredDo nothing.
note <type> <textkey>IgnoredShow the contents of a note or book.
objecthide [-m] <target> <hide>For selfHide the caller from view and optionally disable script events.
physical off
physical on
physical height <collisionheight*>
physical radius <collisionradius*>
NPCsTemporarily or disable NPC movement and set the collision cylinder size.
play [-ilpo] <sfx*>
play -s
Any EntityPlay a sound effect file.
playanim [-123lnpe] <animslot> [e?command...]
playanim [-123p] none
Any EntityPlay an animation.
playerinterface [-s] hide
playerinterface [-s] show
IgnoredHide or show the HUD.
playerlookat <target>For selfRotate the player camera to look at an entity.
playermanadrain <enable>IgnoredAllow or prevent mana drain damage from affecting the player.
playspeech <speech>Any EntityPlay a speech sound file.
poison <amount*>IgnoredPoison the player.
popup <message>Ignored.
precast [-df] [d?duration*] <spelllevel*> <spell>IgnoredAdd a spell to the player's list of prepared spells.
quake <intensity*> <duration*> <frequency*>IgnoredShake the camera to simulate an earthquake.
quest <textkey>IgnoredAppend an entry to the quest log.
random <chance*>IgnoredRandomly execute or skip the next command block.
refuseIgnoredEnd script event execution with a negative result.
replaceme <script>Any EntityCreate a new replacement entity.
returnIgnoredJump to just after the previous gosub command.
ridiculousIgnoredReset the player character stats.
rotate <dpitch*> <dyaw*> <droll*>Any EntityAdjust the orientation.
rune -a <rune>
rune -r <rune>
rune all
IgnoredAdd or remove runes from the player spell book.
sayIgnored.
sendevent <event> <entity*> <parameters>
sendevent -z[gfin] [g?group*] <event> <zone*> <parameters>
sendevent -r[gfin] [g?group*] <event> <radius*> <parameters>
sendevent -g <group*> <event> <parameters>
Any EntitySend an event asynchronously to one or more entities.
set <variable> <value*>Any EntitySet a script variable.
setangular <enable>Any EntityEnable or disable flat shading.
setblacksmith <enable>Any EntityShow the repair cost when hovering over the entity with an item selected for combining.
setbump <enable>Any EntityEnable or disable "bump mapping".
setcontrolledzone <zone>Any EntitySet the controlling entity of a zone.
setdetachable <enable>Ignored.
setelevator <enable>Any EntityPush entities standing on top when animating.
setevent <event> <enable>Any EntityEnable or disable an event.
setgore <enable>NPCsDisable dismemberment.
setgroup [-r] <group*>Any EntityAdd or remove a group.
sethunger <food*>IgnoredSet the player's food energy level.
setinteractivity none
setinteractivity (on|yes)
Any EntityTemporarily or disable NPC movement and set the collision cylinder size.
setinternalname <name>Ignored.
setlefthand <enable>Ignored.
setmainevent <event>Any EntitySet an event to be sent periodically.
setmaterial <material>
setmaterial none
Any EntitySet the collision sound material.
setname <textkey>Any EntitySet the display name.
setonehandedIgnored.
setpath [-wf] <path>
setpath none
Any EntityStart or stop following a path.
setplatform <enable>Any EntityUse special platform collision detection.
setplayercontrols <enable>IgnoredEnable or disable player input.
setplayertweak mesh <newmesh>
setplayertweak skin <oldskin> <newskin>
Any EntitySet an alternate mesh or texture to use for the player while equipped.
setrighthand <enable>Ignored.
setsecret <intuition*>
setsecret off
PropsApply a blue color when the player's intuition skill is over a threshold.
setshadow <enable>Any EntityEnable or disable shadows.
setshield <enable>Ignored.
setshop <enable>Any EntitySet the inventory to act as a shop.
setspeakpitch <pitch*>NPCsSets the playback speed for speech samples.
setstackable <enable>Ignored.
setstatus <event>Any EntitySet an event to be sent periodically.
setstepmaterial <material>
setstepmaterial none
Any EntitySet the step sound material.
setstrikespeech <speech*>Any EntitySet the speech to play when the striking while equipped.
settrap <technical*>
settrap off
PropsApply a red color when the player's technical skill is over a threshold.
settwohandedIgnored.
setweapon [-h] <class>NPCsCreate and equip a weapon.
setzmap <enable>Any EntityEnable or disable detail textures.
shopcategory <group>Any EntityLimit the group of items that the player can put into a shop inventory.
shopmultiply <multiplier*>Any EntitySet the price multiplier for items repaired, bought from or sold to a shop inventory.
showglobalsIgnoredPrint all global variables to the log.
showlocalsAny EntityPrint all local variables of this entity to the log.
showvarsAny EntityPrint global and local variables for this entity to the log.
spawn fireballAny EntityCreate a fireball projectile.
spawn item <script> <target>For selfCreate a new item entity.
spawn npc <script> <target>For selfCreate a new NPC entity.
speak [-tuphao] <speech*> <command...>
speak -c[tuphao] keep <speech*> <command...>
speak -c[tuphao] zoom <p0*> <y0*> <p1*> <y1*> <d0*> <d1*> <speech*> <command...>
speak -c[tuphao] <mode> <target> <d0*> <d1*> <speech*> <command...>
speak []
speak killall
Any EntitySpeak a line with text and/or sound.
specialfx fieryAny EntityIgnite the caller.
specialfx fieryoffAny EntityDouse the caller.
specialfx heal <amount*>Ignoredheal or damage the player.
specialfx mana <amount*>IgnoredRestore or drain the player's mana.
specialfx newspell <ignored>IgnoredShow a new spell effect on the book icon in the HUD.
specialfx player_appearsAny EntityShow a spawn visual effect.
specialfx torchItemsEquip or unequip the caller as a torch.
specialfx torchoffIgnoredUnequip and douse the torch currently equipped by the player.
specialfx torchonIgnoredDo nothing.
specialfx ylside_deathAny EntityActivate the Ylside death sequence.
spellcast [-dxmsfzo] [d?duration*] <spelllevel*> <spell> <target>
spellcast -k <spell>
Any EntityCast spells or cancel active spells.
starttimer <stopwatch>Any EntityStart a stopwatch.
stealnpcAny EntitySet the inventory that the player can steal from.
stoptimer <stopwatch>Any EntityStop a stopwatch.
targetplayerposAny EntitySet the player as the target.
teleport [-api] [a?angle*] [!i?target]
teleport [-a] [a?angle*] behind
teleport -l[an] [a?angle*] <area*> <target>
Any EntityMove the caller or player to a new position or area.
timer [-mi] <count*> <interval*> <command...>
timer<name> [-mi] <count*> <interval*> <command...>
timer<name> off
timer kill_local
Any EntityStart or stop a timer.
unset <variable>Any EntityRemove a script variable.
unsetcontrolledzone <zone>IgnoredRemove the controlling entity from a zone.
usepath <direction>Any EntityChange the direction to move along a path.
viewblock <enable>Any EntityBlock the view of NPCs.
weapon <drawn>NPCsDraw or sheathe the equipped wapon.
worldfade out <duration*> <r*> <g*> <b*>
worldfade in <duration*>
IgnoredFade to/from black or another color.
zoneparam ambiance <ambiance>IgnoredChange the active zone ambiance.