abort

showentity

accum

startcam

adjustbuildableheal..

stopcam

attacked

teamspectate

captured

teamspectatestop

dynamic values

timelimit_scenario

dynamic strings

wm_announce_te..

globalaccum

wm_announce_act..

hideentity

wm_objective_alli..

if

wm_objective_axis..

playanim

wm_objective_non..

playsoundteam

wm_set_objective..

remove

wm_setspawndefa..

setentitymodel

wm_setstopwatch...

 

abort

Description: The abort action is a new script command which exits the current script unconditionally without executing any more actions, usually you would use abort within an if section.

Syntax:
Abort

Example:

<routine>
{
    <action1>
    <action2>
    abort
}

top


accum <buffer_index> <command> <paramater>

Description: DeGeneration extends the accum command with some new abilities. This is used to store or modify values which can later be checked with the if action and has been extended to include the accum <n> dec <m> action. Accum limit was adjusted to 16 per entity

Syntax:  
accum <n> inc <m>        Increment accum <n> by the amount <m>
accum <n> dec <m>        Decrement accum <n> by the amount <m>
accum <n> set <m>        Set accum <n> to the value <m>
accum <n> bitset <m>      Set accum <n> bit <m> to on (valid <m> value 0 to 31 only)
accum <n> bitreset <m>   Set accum <n> bit <m> to off (valid <m> value 0 to 31 only)
accum <n> random <m>   Set accum <n> to a random number between 0 and <m>

 

Example:

<routine>

{
    <action 1>
    <action 2>
    accum 1 inc 1

    accum 2 dec 1

    accum 3 set 1

    accum 3 bitset 1

    accum 4 random 4
}

 

This example shows how to set accums to the health of a dg_buildable and then compare the health of two dg_buildables to determine a winner.

<routine>
{
    accum 5 = entityhealth dg_buildable1
    accum 6 = entityhealth dg_buildable2

    if accum 5 > accum 6
    {
    wm_setwinner 0
    }
}

top


 

adjustBuildableHealth <targetname> <value> <automatic>

 

Description: This new scripting command will adjust the health of a dg_buildable entity either automatically every second or once only


Syntax:
adjustBuildableHealth <targetname> <value> <automatic>
<targetname> - Without a targetname it will refer to entity it's called from

<value> - The amount of health to adjust, negative to damage, positive to repair, 0 to disable
<automatic> - When set this will automatically adjust by this amount every second

Example:

 

This will adjust dg_buildables with targetnames of generator_axis and generator_allies up 10 health automatically every second.

timelimit_scenerio 3
{
adjustbuildablehealth generator_axis 10 automatic
adjustbuildablehealth generator_allies 10 automatic
wm_announce "The Generators are building up!"
}

 

This will adjust dg_buildables with targetnames of generator_axis and generator_allies to 5000 health one time only.

<routine>
{
adjustbuildablehealth generator_axis 5000

adjustbuildablehealth generator_allies 5000
}

 

This will adjust dg_buildables with targetnames of generator_axis and generator_allies to -100 (negative 100 health) one time only.

<routine>
{
adjustbuildablehealth generator_axis -
100

adjustbuildablehealth generator_allies -100
}

This will disable dg_buildables with targetnames of generator_axis and generator_allies.

<routine>
{
adjustbuildablehealth generator_axis
0

adjustbuildablehealth generator_allies 0
}

top


 

attacked

 

Description: Attacked is a new scripting event using in conjunction with the dg_buildable. Any commands within this event will be triggered when the dg_buildable is attacked. There is a delay setting in the dg_buildable entity to prevent the event from being repeated too many times. The default delay is 30.

 

Syntax:
attacked
{
}

 

Example:

attacked
{
    playsoundteam 1 sound/degeneration/allies/a-gen_attack.wav
}

top


 

captured <teamnum>

Description: Captured is a new associated script event to be used when a dg_buildable entity is captured by one of the two teams.

 

Syntax:
Captured <teamnum>
<teamnum> - 0 = axis, 1 = allies

 

Example:

<routine>
{
    <action 1>

    <action 2>
   
captured 1
    wm_announce "Allies have captured the towtruck!"
}

top


 

globalaccum <buffer_index> <command> <paramater>

Description: The new globalaccum command allows for accums to be used over the entire script instead of just within one entity. It works exactly as the accum command does with that one exception. This is used to store or modify values which can later be checked with the if action. There are no limits set on globalaccum so you can use as many as you want.

Syntax:  
globalaccum <n> inc <m>        Increment globalaccum <n> by the amount <m>
globalaccum <n> dec <m>        Decrement globalaccum <n> by the amount <m>
globalaccum <n> set <m>        Set globalaccum <n> to the value <m>
globalaccum <n> bitset <m>      Set globalaccum <n> bit <m> to on (valid <m> value 0-31 only)
globalaccum <n> bitreset <m>   Set globalaccum <n> bit <m> to off (valid <m> value 0-31 only)
globalaccum<n> random <m>   Set globalaccum <n> to a random number between 0 and <m>

 

Example:

<routine>

{
    <action 1>
    <action 2>
   
globalaccum 1 inc 1

    globalaccum 2 dec 1

    globalaccum 3 set 1

    globalaccum 3 bitset 1

    globalaccum 4 random 4
}

top


 

hideentity <targetname>

Description: Hideentity is a new script command that allows you to hide an entity which is currently visible.

Syntax:
hideentity <targetname>
<targetname> - targetname value of entity

Example:

<routine>
{
    <action1>
    <action2>
    hideentity towtruck
}

Supported entities:
corona
dg_buildable_part
dg_door
dg_door_rotating
dg_invisible_user
dg_teamhurt
dg_dropbox
dlight
func_door
func_door_rotating
func_invisible_user
func_rotating
func_static
func_timer
script_mover
shooter_tesla
target_smoke
target_speaker
target_laser
target_teleporter
target_rumble
target_push
trigger_push
trigger_teleport
trigger_hurt
trigger_flagonly
 

top


if <globalaccum/accum number value> <comparison> <globalaccum/accum number value>

Description: The if script action is a new script action that allows you to conditionally run actions in the bracketed section based on the comparison between two accum/globalaccum and/or values. This functionality effectively supersedes the RTCW accum <num> abort_if_xxxx commands, but there is no reason you can't use the old way if desired. If also includes bit 0 to 31 referencing for both accum and globalaccum.

Syntax:
if <globalaccum/accum number value> <operator> <globalaccum/accum number value>
<globalaccum/accum number value> - number of globalaccum/accum and value
<operator> - the operator used to compare

Operators:
==    EQUAL
!=     NOT EQUAL
>      GREATER THAN
<      LESS THAN
>=    GREATER THAN OR EQUAL
<=    LESS THAN OR EQUAL

Examples:
In the following example, the actions within the brackets will never be run because the comparison is always false

if 1 != 1
{
    accum 1 set 2
    gotomarker path_corner1 500
}

In the following example, the actions within the brackets will always be run because the comparison is always true

if 1 == 1
{
    accum 1 set 2
    gotomarker path_corner1 500
}

In the following example, the actions within the brackets will only be run if accum 1 is equal to 1

if accum 1 == 1
{
    accum 1 set 2
    gotomarker path_corner1 500
}

In the following example, the actions within the brackets will only be run if accum 1 is greater or equal to accum 2

if accum 1 >= accum 2
{
    accum 1 set 2
    gotomarker path_corner1 500
}

The following example shows how it may look in a real script situation

mover1
{
   spawn
   {
      accum 1 set 1
      accum 2 set 10
   }

   trigger move
   {
      if accum 1 < accum 2
      {
         gotomarker path_corner1 500
         accum 1 inc
         abort
      }
   

      if accum 1 >= accum 2
      {
         gotomarker path_corner2 500
      }
   }
}

The following examples show how you can compare bit settings for an accum

if accum 1.0 == 0
Compares the first bit of accum 1 to 0

if globalaccum 3.6 == 1
Compares the sixth bit of globalaccum 3 to 1

if globalaccum 4.6 == accum 1.0
Compares the sixth bit of globalaccum 4 to the first bit in accum 1


Special considerations:
* if sections cannot be nested inside each other
* A bracketed section must always follow the if action with at least one action contained
* if comparisons can only be made between values and/or accums
* Each parameter of the if statement must be separated by a space

top


playanim <startframe> <endframe> [looping]

Description: This script action was rewritten and currently will only work with dg_buildable_part, misc_gamemodel and script_model_med. Frames specified play at 20fps and can optionally play in reverse if startframe is greater than endframe.

Syntax:
playanim <startframe> <endframe> [looping]
<startframe> - specifies start frame
<endframe> - specifies end frame
[looping] - specifies whether frames loop

Example:

<routine>
{
    <action 1>
    <action 2>
    playanim 0 13
    alertentity allies_tank_fire01
}

top


playsoundteam <teamnumber> <sound>

Description:
The new playsoundteam script action allows you to play a sound to both or one of the two teams

Syntax:
playsoundteam <teamnumber> <sound>
<teamnumber> - 0 = axis, 1 = allies, -1 = All
<sound> - path to the sound

Example:

<routine>
{
    <action 1>
    <action 2>
    playsoundteam 1 sound/test/announce_allies1.wav
}
 

top


remove <targetname>

Description: The standard RTCW remove action has been extended to include an optional targetname for entity(s) to remove. If you do not include a targetname, the script action will remove the entity which this script belongs to.

Syntax:
remove <targetname>
<targetname> - targetname value of entity

Example:

<routine>
{
    <action 1>
    <action 2>
    remove towtruck
}

top


setentitymodel <targetname> <index>

Description: This new command sets the model to be displayed by the entity. By default the entity displays the model specified by the "model2" key of the entity. This function could be used to change the model to a low detail or otherwise alternate representation of the object, for example "model2" = radio_working.md3, "model3" = radio_damaged.md3

This only works with the dg_buildable_part entity.

Syntax:
setentitymodel <targetname> <index>
<targetname> - targetname value of entity
<index> - must equal either 2 or 3, sets model2 or model3 as the currently displayed model

Example:

<routine>
{
    <action 1>
    <action 2>
   
setentitymodel generator_allies_cuplink 2
}

top


showentity <targetname>

Description: The new showentity script action allows you to show an entity which is currently invisible

Syntax:
showentity <targetname>
<targetname> - targetname value of entity

Example:

<routine>
{
    <action1>
    <action2>
    showentity towtruck
}

Supported entities:
corona
dg_buildable_part
dg_door
dg_door_rotating
dg_invisible_user
dg_teamhurt
dg_dropbox
dlight
func_door
func_door_rotating
func_invisible_user
func_rotating
func_static
func_timer
script_mover
shooter_tesla
target_smoke
target_speaker
target_laser
target_teleporter
target_rumble
target_push
trigger_push
trigger_teleport
trigger_hurt
trigger_flagonly

top


startcam <filename>

Description: This new scripting command turns on a camera to be played for all players.

Syntax:
startcam <filename>
<filename> - this must be the filename of a .camera file stored in the cameras folder

Example:

<routine>
{
    <action1>
    <action2>
    wait 2000
    startcam dg_crossing_camera1b
    wait 2000
    startcam dg_crossing_camera1c
}

top


stopcam

Description: This new scripting command turns off the currently active camera

Syntax:
Stopcam

Example:

<routine>
{
    <action1>
    <action2>
    wait 2000
    startcam dg_crossing_camera1b
    wait 2000
    stopcam
}

top


teamspectate <teamnumber>

Description: This new scripting command is used to spectate the specified team. When this command is run it will change all players views to spectate a random player on the set team.

Syntax:
teamspectate <teamnumber>
<teamnumber> - 1 = Allies, 0 = Axis

Example:

<routine>
{
    <action1>
    <action2>
    teamspectate 0
    wait 10000
    wm_setwinner 1
    wm_endround
}

top


teamspectatestop

Description: This new scripting command stops the spectating set by the teamspectate command and returns control to players

Syntax:
teamspectatestop

Example:

<routine>
{
    <action1>
    <action2>
    teamspectate 0
    wait 10000
    teamspectatestop
}

top


timelimit_scenerio <number = g_timelimitscenerio>

Description: This new scripting command tells the script to perform the scenerio based on the server's g_timelimitscenerio setting. By default g_timelimitscenerio is set to 0.

0 = SetWinner - Default, script should check relative generator levels, setwinner and endgame
1 = SuddenDeath - Game will continue and no specific script action is required
2 = stopbox - Script should stop dropbox(s) from falling
3 = autobuild - Script should set generators to autobuild mode

Syntax:
timelimit_scenerio <number = g_timelimitscenerio>
<number = g_timelimitscenerio> - 0 = SetWinner, 1 = SuddenDeath, 2 = StopBox, 3 = AutoBuild

Example:

timelimit_scenerio 0
{
    // Set the winner based on the levels of the generators
    accum 5 = entityhealth generator_axis
    accum 6 = entityhealth generator_allies

    if accum 5 > accum 6
    {
    // Axis win
    wm_announce "The Axis Win!"
    wait 5000
    wm_setwinner 0
    }

    if accum 6 > accum 5
    {
    // Allies win
    wm_announce "The Allies Win!"
    wait 5000
    wm_setwinner 1
    }

    if accum 6 == accum 5
    {
    //Tie
    wm_announce "It's a tie!"
    wait 5000
    }

    wm_endround
}


timelimit_scenerio 1
{
    // SuddenDeath
    // no action needed, no timelimit
    wm_announce "Sudden Death!"
}

timelimit_scenerio 2
{
    // Stop the dropbox from falling
    wm_announce "Part drops have run out!"
    remove mainpartbox
}

timelimit_scenerio 3
{
    // both generators should autobuild till the end of the match

    // adjust them up 10 health every second
    adjustbuildablehealth generator_axis 10 automatic
    adjustbuildablehealth generator_allies 10 automatic
    wm_announce "The Generators are building up!"
}

top


wm_announce_team <teamnum> <"textmessage">

Description: This new scripting command will send a text message to the specified team's clients

Syntax:
wm_announce_team <teamnum> <"textmessage">
<teamnum> - 0 = Axis, 1 = Allies
<"textmessage"> - text message surrounded by quotemarks

Example:

    <routine>
    {
        <action 1>
        <action 2>
       
wm_announce_team 1 "Your team has captured the towtruck"
        wm_announce_team 0 "Your team has has lost control of the towtruck"
    }

top


wm_announce_activator <"textmessage">

Description: This new scripting command sends a text message to the last activator (client) of this entity

Syntax:
wm_announce_activator <"textmessage">
<"textmessage"> - text message surrounded by quotemarks

Example:

    <routine>
    {
        <action 1>
        <action 2>
        wm_announce_activator "No Power! Repair the generator!"
    }

top


wm_objective_allied_icon <objnumber> <shadername>

Description: This new scripting command sets a hud objective icon to display in the objective list for when Allies have control of an objective. This will default to standard flags if not set.

Syntax:
wm_objective_allied_icon <objnumber> <shadername>
<objnumber> - number set to the objective to display
<shadername> - path to shader to display

Example:

wm_objective_allied_icon 1 "textures/dg_sprites/usa_genflag"

Available existing shaders:
"textures/dg_sprites/usa_genflag"
"textures/dg_sprites/usa_repflag"
"textures/dg_sprites/usa_dynaflag"

top


wm_objective_axis_icon <objnumber> <shadername>

Description: This new scripting command sets a hud objective icon to display in the objective list for when Axis has control of an objective. This will default to standard flags if not set.

Syntax:
wm_objective_axis_icon <objnumber> <shadername>
<objnumber> - number set to the objective to display
<shadername> - path to shader to display

Example:

wm_objective_axis_icon 1 "textures/dg_sprites/ger_genflag"

Available existing shaders:
"textures/dg_sprites/ger_genflag"
"textures/dg_sprites/ger_repflag"
"textures/dg_sprites/ger_dynaflag"
 

top


wm_objective_none_icon <objnumber> <shadername>

Description: This new scripting command sets a hud objective icon to display in the objective list for when no one has control of an objective. This will default to standard flags if not set.

Syntax:
wm_objective_none_icon <objnumber> <shadername>
<objnumber> - number set to the objective to display
<shadername> - path to shader to display

Example:

wm_objective_none_icon 1 "textures/dg_sprites/x_genflag"

top


wm_set_objective_status <objectivenumber> <status/targetname>

Description: The standard RTCW wm_set_objective_status command has been extended to enable a dg_buildable to show status and health in the hud objective list. Specify the targetname of the dg_buildable in place of the status parameter and DeGeneration will automatically show the team flag, health and buildable icon in the objective list.

Syntax:
wm_set_objective_status <objectivenumber> <status/targetname>
<objectivenumber> - objective number to set, valid objective number between 1 and 6
<status/targetname>-  status (0 = AXIS, 1 = ALLIES, -1 = NONE) or Targetname of a dg_buildable entity

Example:

wm_set_objective_status 1 generator_allies
wm_set_objective_status 2 generator_axis
wm_set_objective_status 3 -1
wm_set_objective_status 4 -1

top


wm_setspawndefault <team> <targetname>

Description: This new scripting command allows you to set the default spawnpoint in a map based on the targetname of a team_wolf_objective entity. When a player chooses auto pick in the game they will automatically spawn at this spot instead of allowing the game to decide based on objective distance.

Sets the default(automatic selection) spawn for the specified team to the team_wolf_objective with specified <targetname>
* targetname MUST be a team_wolf_objective entity only or an error will occur

top


wm_setstopwatchtimemax

Description: This new scripting command allows you to set the timelimit for the next round in stopwatch to the max instead of allowing the current round to set it. This is good for situations where you do not want an event to penalize the winning team.

In an assault map with one buildable entity where Allies must build it and Axis must stop them or destroy it. If the Axis destroy the buildable entity in 3 minutes then normally the stopwatch round following it would be set to 3 minutes. This would make it very hard for the team who won the previous round to win the next because of the lack of time to build. Because of this you would want to add this command to death portion of the buildable to make sure if a team destroys it they aren't penalized. Instead they are rewarded with the full time limit.

Example:

trigger objective1_destroyed
{

wm_announce "Allies generator has been destroyed!"
wait 5000
wm_SetStopwatchTimeMax
wm_setwinner 0
wm_endround

}

top


dynamic string
--------------
This is a string dynamically created from any number of accum, globalaccum values and text
It can be used for targetname and trigger calling in all script actions

format:
Each sub item must be separated by a space

"<string>/<accum (buf)>/<globalaccum (buf)> <string>/<accum (buf)>/<globalaccum (buf)> ..."


examples:

The following example uses the dynamic string to create a targetname for use on the showentity action
The resulting string is button5

accum 1 set 5
showentity "button accum 1"

The following example uses the dynamic string to create a targetname for use on the gotomarker action
The resulting string is mover_position_5_10
accum 1 set 5
accum 2 set 10
gotomarker "mover_position_ accum 1 _ accum 2" 1000

The following example uses the dynamic string to create a triggername for use on the trigger action
The resulting string is moveto_50_andstop
accum 1 set 50
trigger mover1 "moveto_ accum 1 _andstop"

top


dynamic values
--------------
Dynamic values can be used in place of just about any action value parameter
These values can come from accums
accum (buff)
globalaccum (buff)

or new value functions
entityhealth (targetname)
buttonpushed (targetname)
entityvisible (targetname)


example

action definition:
wm_announce_team (value) (text string)

examples
wm_announce_team accum 1 "The team we are sending this message to is based on the current value of accum 1"
wm_announce_team buttonpushed button1 "The team we are sending this message to is based on if button1 is currently pushed"


action definition:
wait <duration>

examples
The following wait command will wait for 5000 milliseconds
accum 1 = 5000
wait accum 1


action definition
gotomarker <targetname> <speed> [accel/deccel] [turntotarget] [wait]


examples
accum 1 = 5
gotomarker cornerup accum 1 wait

top


 

Copyright © Tram design - All Rights Reserved Legal Notices