Appendix A: Scripting Commands

From Mod Wiki
Revision as of 17:17, 11 August 2008 by 192.168.0.151 (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Message System
wm_teamvoiceannounce <team> <soundname>

Plays sound to target team.

wm_addteamvoiceannounce <team> <soundname>
wm_removeteamvoiceannounce <team> <soundname>

Adds or removes sound to/from the queue of sounds that a player gets to hear when he joins a team.

wm_objective_status <objective_number> <team> <status(0:blank|1:tick|2:cross)>

Sets the tick or cross status overlay on the objective panel in the limbo menu for the specific objective.

wm_objective_status <objective_number> <team> <status>

Trains, splines and animations
abortmove

This will stop any movement currently happening on the entity, this will probably break on spline paths at the moment if you try to stop on a spline path then resume.

attachtotag <targetname> <tagname>

Connect this entity onto the tag of another entity.

attatchtotrain <targetname> <length>

Makes this entity follow another entity with a specified distance (only works in combination with followpath).

faceangles <pitch> <yaw> <roll> <duration/GOTOTIME> [ACCEL/DECCEL]

The entity will face the given angles, taking <duration> to get their. If the GOTOTIME is given instead of a timed duration, the duration calculated from the last gotomarker command will be used instead.

followpath <direction 0(forward)|1(backward)> <splinename> <speed> [wait]
followspline <direction 0(forward)|1(backward)> <splinename> <speed> [wait]

Direction specifies whether it will travel from start to end (0), or end to start (1). Splinename is the targetname of the spline you wish the train to follow. Speed is how fast the train will travel along the spline. Wait is an optional command that functions the same as on gotomarker, the script will stop execution till this movement has occurred.
Note: Followpath is required when attatchtotrain is used, otherwise use followspline.

gotomarker <targetname> <speed> [accel/deccel] [turntotarget] [wait] [relative <position>]

Note: speed may be modified to round the duration to the next 50ms for smooth transitions.

playanim <startframe> <endframe> [looping <FOREVER/duration>] [rate <FPS>]

Note: all source animations must be at 20fps.

setposition <targetname>

Moves entity to position of target entity.

setrotation <pitchspeed> <yawspeed> <rollspeed>

Sets the rotational velocity of an entity.

stoprotation

Stops the rotational velocity of an entity.

setspeed <x> <y> <z> [gravity|lowgravity]

Sets the directional velocity of an entity. Use gravity/lowgravity to use non-linear movement.

startanimation <startframe> <framecount> <fps> [norandom|nolerp|noloop]

Make an entity animate. (Used with misc_gamemodel.)

setposition <targetname> <default|invisible|underconstruction>

Sets the state of an entity.

Command Post stuff
setchargetimefactor <team> <class> <factor>

team: 0 = axis, 1 = allies

sethqstatus <team> <status>

Enables/disables the hq bonus for a team.

Tank related commands
setdamagable <targetname> <0|1>

Set damagable status of target entity.

Construction
construct <targetname>

Construct stage of target entity.

constructible_class <int:class>
constructible_chargebarreq <float:fraction>
constructible_constructxpbonus <int:xppoints>
constructible_destructxpbonus <int:xppoints>
constructible_health <int:health>
constructible_weaponclass <int:class>
constructible_duration <int:duration>

See construction classes for details.

repairmg42 <targetname>

Repair target MG42.

setmodelfrombrushmodel <targetname> [useoriginforpvs] [nonsolid]

Sets model to brushmodel of target func_brushmodel entity.

Sound Commands
enablespeaker <targetname>
disablespeaker <targetname>
togglespeaker <targetname>

See speaker scripting for details.

playsound <soundname OR scriptname> [LOOPING]

Currently only allows playing on the VOICE channel, unless you use a sound script. Use the optional LOOPING paramater to attach the sound to the entities looping channel.

stopsound

Stops any looping sounds for this entity.

Misc. Commands
changemodel <modelname>

Change the model of this entity.

remapshader <target shader> <new shader>
remapshaderflush

Remapshader schedules the replacement of a target shader by a new one. Remapshaderflush executes all scheduled replacement.

(global)accum <buffer_index> <command> <<paramater...>

(global)accum <n> inc <m>
(global)accum <n> abort_if_less_than <m>
(global)accum <n> abort_if_greater_than <m>
(global)accum <n> abort_if_not_equal <m>
(global)accum <n> abort_if_equal <m>
(global)accum <n> set <m>
(global)accum <n> random <m>
(global)accum <n> bitset <m>
(global)accum <n> bitreset <m>
(global)accum <n> abort_if_bitset <m>
(global)accum <n> abort_if_not_bitset <m>
(global)accum <n> trigger_if_equal <m> <s> <t>
(global)accum <n> wait_while_equal <m>

cvar <cvarName> <operation> <value>

Operation can be any of:
inc
abort_if_less_than
abort_if_greater_than
abort_if_not_equal
abort_if_not_equals
abort_if_equal
abort_if_equals
bitset
bitreset
abort_if_bitset
abort_if_not_bitset
set
random
trigger_if_equal
wait_while_equal

kill <targetname>

Kill target entity.

remove

Schedule this entity to be freed on the next serverframe.

setglobalfog <bool:restore> <int:duration> [float:r] [float:g] [float:b] [float:depthForOpaque]

Changes the global fog in a map.

setautospawn <target spawn> <team>

Set the autospawn of a team to target spawn. The target spawn string is the 'description' key on the team_WOLF_objective.

spawnrubble <spawnrubble>

Spawn rubble, use in combination with func_debris.

wait <duration>
wait random <min> <max>

Wait for a certain duration.