Action Code Script


Action Code Script is a scripting language used in video games such as and some modern Doom source ports, such as ZDoom. It is syntactically similar to C, but less flexible. As its name implies, most of the core logic for script functionality comes in the form of "scripts", which are traditionally identified with a numerical value. Later revisions of the ACS compiler added support for "named" scripts, and simple functions.
Similar to traditional code, ACS is compiled using ACC for use in Doom, Hexen, etc... Scripts can be executed in a variety of methods, such as being attached to in-game actors, execution through level triggers around each map, or invocation from other scripts or functions.
As the entire scripting language is built as a hack on top of the Doom id Tech's engine, there is no formal support for any object-oriented programming principles.

"Hello world" example

Using the classic "hello world" example:

// Similar to C's stdio.h, ACS has its own library of basic functions
  1. include "zcommon.acs"
script 1 ENTER

In this basic example, the text "Hello World!" is printed upon entering the level. The syntax is as follows: