Script:Commands

From Arx Libertatis Wiki
Revision as of 06:51, 15 April 2020 by Ds (talk | contribs)
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.

List

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

ComandDescription
++ <variable>Increment a number or int script variable.
-- <variable>Decrement a number or int script variable.
acceptEnd script event execution with a positive result.
activatephysicsEnable gravity.
addbagAdd a bag to the player inventory.
addgold <amount*>Add gold to the player's purse.
addxp <amount*>Add to the player's experience points.
ambiance [-vn] [v?volume*] <ambiance>
ambiance kill
Play or stop an ambiance.
anchorblock <block>Block or unblock pathfinding nodes.
attach <source> <sourcevertex> <target> <targetvertex>Link the position and rotation of an entity to another entity.
attachnpctoplayer.
attractor <entity> <power*> <radius*>
attractor <entity> off
Pull/push the player towards/away from an entity.
book [-aem] open
book [-aem] close
book [-aem] change
Open/close the player book and/or change the page.
cameraactivate <camera>
cameraactivate none
Switch to a camera.
camerafocal <focal*>Set the focal length.
camerasmoothing <value*>
camerasmoothing none
Set rotation smoothing when tracking a target.
cameratranslatetarget <dx*> <dy*> <dz*>Target position offset.
cine [-p] <cinematic>
cine play
cine kill
Play or stop a cinematic.
cinemascope [-s] <enable>Enable or disable cinematic borders.
closestealbagClose any non-player inventory in the HUD if the player is stealing.
collision <enable>Enable or disable collisions.
conversation off.
damager [-fmplcgewsaornu] <damage*>Set the collision damage.
dec <variable> <value*>Subtract a value from a number or int script variable.
destroy <entity>
destroy <spell>
Destroy an entity or spell.
detach <source> <target>Unlink the position and rotation of an entity from another entity.
detachnpcfromplayer.
div <variable> <value*>Divide a number or int script variable by a value.
dodamage [-fmplcgewsaornu] <target> <damage*>Damage other entities.
drawsymbol <rune> <duration*>Draw a rune symbol as if casting a spell.
elseSkip the next command block.
endgameEnd the game and roll the credits.
endintroEnd the game without showing credits.
equip [-r] playerMake the player equip or unequip the caller.
forceangle <yaw*>Set the orientation.
forceanim <animslot>Force play an animation.
gmode <mode>.
gosub <label>Jump to a label and add a return point.
goto <label>Jump to a label.
herosay [-d] <textkey*>Show 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*>
Conditionally execute or skip the next command block.
ifexistinternal <entity>Skip the next command block if an entity doesn't exist in the current level.
ifvisible <entity>Skip the next command block unless an entity is inside the cone of vision.
inc <variable> <value*>Add a value to a number or int script variable.
inventory add <script>Create a single new item and place it into the inventory.
inventory addfromscene <item>Add an existing item to the inventory.
inventory addmulti <script> <count*>Create a new item stack and place it into the inventory.
inventory closeClose any non-player inventory in the HUD.
inventory createEnable and clear the inventory.
inventory destroyDisable the inventory.
inventory openOpen the inventory in the HUD.
inventory playeradd <script>Create a single new item and place it into the player inventory.
inventory playeraddfromscene <item>Add an existing item to the player inventory.
inventory playeraddmulti <script> <count*>Create a new item stack and place it into the player inventory.
inventory skin <skin>Change the inventory background.
invertedobject <enable>.
invulnerability [-p] <enable>Allow or prevent damage from affecting the caller or player.
keyringadd <key*>Add a key to the player's keyring.
linkobjtome <source*> <vertex>Link the position and rotation of an entity to the caller.
loadanim [-p] <animslot> <file>Load an animation into a slot.
magic <enable>Enable or disable spellcasting.
mapmarker <x*> <y*> <maplevel*> <textkey>
mapmarker -r <textkey>
Add a marker to the map.
move <dx*> <dy*> <dz*>Adjust the world position.
mul <variable> <value*>Multiply a number or int script variable with a value.
nopDo nothing.
note <type> <textkey>Show the contents of a note or book.
objecthide [-m] <target> <hide>Hide the caller from view and optionally disable script events.
physical off
physical on
physical height <collisionheight*>
physical radius <collisionradius*>
Temporarily or disable NPC movement and set the collision cylinder size.
play [-ilpo] <sfx*>
play -s
Play a sound effect file.
playanim [-123lnpe] <animslot> [e?command...]
playanim [-123p] none
Play an animation.
playerinterface [-s] hide
playerinterface [-s] show
Hide or show the HUD.
playerlookat <target>Rotate the player camera to look at an entity.
playermanadrain <enable>Allow or prevent mana drain damage from affecting the player.
playspeech <speech>Play a speech sound file.
poison <amount*>Poison the player.
popup <message>.
precast [-df] [d?duration*] <spelllevel*> <spell>Add a spell to the player's list of prepared spells.
quake <intensity*> <duration*> <frequency*>Shake the camera to simulate an earthquake.
quest <textkey>Append an entry to the quest log.
random <chance*>Randomly execute or skip the next command block.
refuseEnd script event execution with a negative result.
replaceme <script>Create a new replacement entity.
returnJump to just after the previous gosub command.
ridiculousReset the player character stats.
rotate <dpitch*> <dyaw*> <droll*>Adjust the orientation.
rune -a <rune>
rune -r <rune>
rune all
Add or remove runes from the player spell book.
say.
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>
Send an event asynchronously to one or more entities.
set <variable> <value*>Set a script variable.
setangular <enable>Enable or disable flat shading.
setblacksmith <enable>Show the repair cost when hovering over the entity with an item selected for combining.
setbump <enable>Enable or disable "bump mapping".
setcontrolledzone <zone>Set the controlling entity of a zone.
setdetachable <enable>.
setelevator <enable>Push entities standing on top when animating.
setevent <event> <enable>Enable or disable an event.
setgore <enable>Disable dismemberment.
setgroup [-r] <group*>Add or remove a group.
sethunger <food*>Set the player's food energy level.
setinteractivity none
setinteractivity (on|yes)
Temporarily or disable NPC movement and set the collision cylinder size.
setinternalname <name>.
setlefthand <enable>.
setmainevent <event>Set an event to be sent periodically.
setmaterial <material>
setmaterial none
Set the collision sound material.
setname <textkey>Set the display name.
setonehanded.
setpath [-wf] <path>
setpath none
Start or stop following a path.
setplatform <enable>Use special platform collision detection.
setplayercontrols <enable>Enable or disable player input.
setplayertweak mesh <newmesh>
setplayertweak skin <oldskin> <newskin>
Set an alternate mesh or texture to use for the player while equipped.
setrighthand <enable>.
setsecret <intuition*>
setsecret off
Apply a blue color when the player's intuition skill is over a threshold.
setshadow <enable>Enable or disable shadows.
setshield <enable>.
setshop <enable>Set the inventory to act as a shop.
setspeakpitch <pitch*>Sets the playback speed for speech samples.
setstackable <enable>.
setstatus <event>Set an event to be sent periodically.
setstepmaterial <material>
setstepmaterial none
Set the step sound material.
setstrikespeech <speech*>Set the speech to play when the striking while equipped.
settrap <technical*>
settrap off
Apply a red color when the player's technical skill is over a threshold.
settwohanded.
setweapon [-h] <class>Create and equip a weapon.
setzmap <enable>Enable or disable detail textures.
shopcategory <group>Limit the group of items that the player can put into a shop inventory.
shopmultiply <multiplier*>Set the price multiplier for items repaired, bought from or sold to a shop inventory.
showglobalsPrint all global variables to the log.
showlocalsPrint all local variables of this entity to the log.
showvarsPrint global and local variables for this entity to the log.
spawn fireballCreate a fireball projectile.
spawn item <script> <target>Create a new item entity.
spawn npc <script> <target>Create 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
Speak a line with text and/or sound.
specialfx fieryIgnite the caller.
specialfx fieryoffDouse the caller.
specialfx heal <amount*>heal or damage the player.
specialfx mana <amount*>Restore or drain the player's mana.
specialfx newspell <ignored>Show a new spell effect on the book icon in the HUD.
specialfx player_appearsShow a spawn visual effect.
specialfx torchEquip or unequip the caller as a torch.
specialfx torchoffUnequip and douse the torch currently equipped by the player.
specialfx torchonDo nothing.
specialfx ylside_deathActivate the Ylside death sequence.
spellcast [-dxmsfzo] [d?duration*] <spelllevel*> <spell> <target>
spellcast -k <spell>
Cast spells or cancel active spells.
starttimer <stopwatch>Start a stopwatch.
stealnpcSet the inventory that the player can steal from.
stoptimer <stopwatch>Stop a stopwatch.
targetplayerposSet the player as the target.
teleport [-api] [a?angle*] [!i?target]
teleport [-a] [a?angle*] behind
teleport -l[an] [a?angle*] <area*> <target>
Move 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
Start or stop a timer.
unset <variable>Remove a script variable.
unsetcontrolledzone <zone>Remove the controlling entity from a zone.
usepath <direction>Change the direction to move along a path.
viewblock <enable>Block the view of NPCs.
weapon <drawn>Draw or sheathe the equipped wapon.
worldfade out <duration*> <r*> <g*> <b*>
worldfade in <duration*>
Fade to/from black or another color.
zoneparam ambiance <ambiance>Change the active zone ambiance.