TypeCON Language Reference

Introduction

Welcome to the TypeScript to Build Engine CON Compiler! This tool leverages the power of TypeScript to simplify the process of creating or modifying Duke Nukem 3D mods and developing games with the Build Engine. By writing TypeScript code, you can produce CON files that adhere to the Build Engine's scripting language requirements.

The Idea Behind TypeCON

The Build Engine's CON scripting language, while powerful, has a steep learning curve and lacks many conveniences of modern programming languages. Its syntax can be unforgiving, and developers often face limitations such as a lack of proper local variables, complex data structures, and a formal class system. This can make developing and maintaining complex game logic a challenging and error-prone process.

TypeCON was created to address these challenges. By leveraging TypeScript, a powerful, statically-typed superset of JavaScript, TypeCON brings modern programming features to the Build Engine. This allows developers to write cleaner, more maintainable code using familiar concepts like classes, objects, modules, and a robust type system. The goal of TypeCON is to empower modders and game creators to build more ambitious projects for the Build Engine with greater ease and efficiency.

Installation and Usage

Installation

To get started with TypeCON, you can install it globally using npm:

npm install -g typecon

This will make the tcc command available in your terminal.

Alternatively, if you prefer a local installation, you can add TypeCON as a dependency to your project using yarn or npm:

# Using Yarn yarn add typecon # Using NPM npm install typecon

With a local installation, you can run the compiler using yarn tcc or npm tcc.

Project Setup

Once TypeCON is installed, you need to set up your project. Navigate to your project's root directory and run the following command:

tcc setup

This command will create the necessary folders, include files, templates, and a basic TypeScript configuration to get you started.

Compiling Files

TypeCON provides several command-line options to control the compilation process. Here is a list of all the available commands:

For a full list of commands, you can also use the --help or -? flag:

tcc --help

Language Concepts

TypeCON uses TypeScript to generate CON files. The core of the language is based on classes that represent game objects like Actors, Players, and Events. These classes have properties and methods that translate to native CON commands.

The include folder contains the TypeCON sets that provide you with the necessary classes, methods, functions, constants, and variable declarations to start coding. Currently, the available TypeCON set is TCSet100.

To work with TypeCON, you must at least import the types.ts file in your project. This is the minimum requirement to get access to the basic types and functionalities.

Limitations

To ensure compatibility with the Build Engine's scripting capabilities, the following limitations apply:

Examples

The following examples demonstrate how to use TypeCON to create game logic. You can find these files in the templates directory of the project.

Compiling the Examples

To compile the examples, you can use the tcc command-line tool. For instance, to compile the AssaultTrooper.ts example, you would run the following command:

tcc --input templates/AssaultTrooper.ts --output assault_trooper.con

This will create the assault_trooper.con file in the compiled folder, which is the default output directory.

Similarly, to compile the test.ts example, you would run:

tcc --input templates/test.ts --output test.con
AssaultTrooper.ts

This file is a complete implementation of an enemy from Duke Nukem 3D, the Assault Trooper. It showcases how to create a complex actor with multiple states and behaviors using an object-oriented approach with TypeScript.

import '../include/TCSet100/types'
import DN3D from '../include/TCSet100/DN3D/game';

class AssaultTrooper extends CActor {
    /* ─────────────────────────────────────────
    *  ACTIONS
    * ───────────────────────────────────────── */
    protected readonly actions: TAction< | 'aStand' | 'aGrow' | 'aStayStand'
        | 'aWalking' | 'aWalkingBack' | 'aRunning'
        | 'aShoot' | 'aJetpack' | 'aJetpackIll'
        | 'aFlintch' | 'aDying' | 'aDead'
        | 'aPlayDead' | 'aSufferDead' | 'aSuffering'
        | 'aDuck' | 'aDuckShoot' | 'aAboutHide'
        | 'aHide' | 'aReappear' | 'aFrozen'
    > = {
            aStand: { start: 0, length: 1, viewType: 5, incValue: 1, delay: 1 },
            aGrow: { start: 0, length: 1, viewType: 5, incValue: 1, delay: 1 },
            aStayStand: { start: -2, length: 1, viewType: 5, incValue: 1, delay: 1 },
            aWalking: { start: 0, length: 4, viewType: 5, incValue: 1, delay: 12 },
            aWalkingBack: { start: 15, length: 4, viewType: 5, incValue: -1, delay: 12 },
            aRunning: { start: 0, length: 4, viewType: 5, incValue: 1, delay: 8 },
            aShoot: { start: 35, length: 1, viewType: 5, incValue: 1, delay: 30 },
            aJetpack: { start: 40, length: 1, viewType: 5, incValue: 1, delay: 1 },
            aJetpackIll: { start: 40, length: 2, viewType: 5, incValue: 1, delay: 50 },
            aFlintch: { start: 50, length: 1, viewType: 1, incValue: 1, delay: 6 },
            aDying: { start: 50, length: 5, viewType: 1, incValue: 1, delay: 16 },
            aDead: { start: 54, length: 1, viewType: 1, incValue: 0, delay: 0 },
            aPlayDead: { start: 54, length: 1, viewType: 1, incValue: 0, delay: 0 },
            aSufferDead: { start: 58, length: 2, viewType: 1, incValue: -4, delay: 24 },
            aSuffering: { start: 59, length: 2, viewType: 1, incValue: 1, delay: 21 },
            aDuck: { start: 64, length: 1, viewType: 5, incValue: 1, delay: 3 },
            aDuckShoot: { start: 64, length: 2, viewType: 5, incValue: 1, delay: 25 },
            aAboutHide: { start: 74, length: 1, viewType: 1, incValue: 1, delay: 25 },
            aHide: { start: 79, length: 1, viewType: 1, incValue: 1, delay: 25 },
            aReappear: { start: 74, length: 1, viewType: 1, incValue: 1, delay: 25 },
            aFrozen: { start: 0, length: 1, viewType: 5, incValue: 0, delay: 0 },
        };


    /* ─────────────────────────────────────────
    *  MOVES
    * ───────────────────────────────────────── */
    protected readonly moves: TMove< | 'walkVels' | 'walkVelsBack'
        | 'jetpackVels' | 'jetpackIllVels'
        | 'runVels' | 'stopped'
        | 'dontGetUp' | 'shrunkVels'
    > = {
            walkVels: { horizontal_vel: 72, vertical_vel: 0 },
            walkVelsBack: { horizontal_vel: -72, vertical_vel: 0 },
            jetpackVels: { horizontal_vel: 64, vertical_vel: -84 },
            jetpackIllVels: { horizontal_vel: 192, vertical_vel: -38 },
            runVels: { horizontal_vel: 108, vertical_vel: 0 },
            stopped: { horizontal_vel: 0, vertical_vel: 0 },
            dontGetUp: { horizontal_vel: 0, vertical_vel: 0 },
            shrunkVels: { horizontal_vel: 32, vertical_vel: 0 },
        };


    /* ─────────────────────────────────────────
    *  AI CONFIGS
    * ───────────────────────────────────────── */
    protected readonly ais: TAi< | 'aiSeekEnemy' | 'aiSeekPlayer' | 'aiFleeing'
        | 'aiFleeingBack' | 'aiDodge' | 'aiShooting'
        | 'aiDucking' | 'aiJetpack' | 'aiShrunk'
        | 'aiHide' | 'aiGrow'
    > = {
            aiSeekEnemy: {
                action: this.actions.aWalking,
                move: this.moves.walkVels,
                flags: EMoveFlags.seekplayer,
            },
            aiSeekPlayer: {
                action: this.actions.aWalking,
                move: this.moves.walkVels,
                flags: EMoveFlags.seekplayer,
            },
            aiFleeing: {
                action: this.actions.aWalking,
                move: this.moves.walkVels,
                flags: EMoveFlags.fleeenemy,
            },
            aiFleeingBack: {
                action: this.actions.aWalkingBack,
                move: this.moves.walkVelsBack,
                flags: EMoveFlags.faceplayer,
            },
            aiDodge: {
                action: this.actions.aWalking,
                move: this.moves.runVels,
                flags: EMoveFlags.dodgebullet,
            },
            aiShooting: {
                action: this.actions.aShoot,
                move: this.moves.stopped,
                flags: EMoveFlags.faceplayer,
            },
            aiDucking: {
                action: this.actions.aDuck,
                move: this.moves.stopped,
                flags: EMoveFlags.faceplayer,
            },
            aiJetpack: {
                action: this.actions.aJetpack,
                move: this.moves.jetpackVels,
                flags: EMoveFlags.seekplayer,
            },
            aiShrunk: {
                action: this.actions.aWalking,
                move: this.moves.shrunkVels,
                flags: EMoveFlags.fleeenemy,
            },
            aiHide: {
                action: this.actions.aAboutHide,
                move: this.moves.stopped,
                flags: EMoveFlags.faceplayer,
            },
            aiGrow: {
                action: this.actions.aGrow,
                move: this.moves.dontGetUp,
                flags: EMoveFlags.faceplayerslow,
            },
        };


    /**
     * Assault Trooper constructor
     * Extends CActor class and allows for proper definition of the actor
     */
    constructor() {
        /**
         * The first parameter is the actor's tile number
         * The second parameter tells if its and enemy or not
         * The third parameter is the actor's strength
         * The fourth arguments makes the label declarations be kept in memory (Actions, AIs and Moves)
         * The fifth parameter tells the compiler that the actor has hard-coded stuff (replaces 'useractor' to 'actor')
         */
        super(DN3D.ENames.LIZTROOP, true, 30, false, true);
    }
    // ... more code
}
                    
test.ts

This file serves as a test case for various features of the TypeCON compiler, demonstrating its capabilities in handling modern programming concepts and translating them into the Build Engine's scripting language.

import '../include/TCSet100/types';
import { DN3D } from '../include/TCSet100/DN3D/game.ts';

/**
 * Type definitions for testing
 */
type wow = {
    name: number,
    ball: number
}

type test = {
    name: number,
    god: number,
    low: wow[]
}

/**
 * This will generated the DISPLAYREST event in CON
 */
class displayRest extends CEvent {
    constructor() {
        /**
         * Here is where you define which event to generate.
         * It does not matter what's the class name
         */
        super('DisplayRest');
    }

    public Append(): void {
        /**
         * RotateSprite is only available in DISPLAY events
         */
        this.RotateSprite(160, 100, 65536, 0, 0, 0, 0, 0, 0, 0, 1024, 768);

        /**
         * pos2 is a TypeCON native object
         * It holds the xy position values, scale and angle.
         * Good for screen drawing.
         */
        const p: pos2 = {
            xy: {
                x: 160,
                y: 100
            },
            scale: 65536,
            ang: 0
        }

        /**
         * Here we are declaring variables that are initialized with some antive structures values
         * Also, you can do const sector = sectors[0];
         * Giving you the possibility to hold native structure pointers in local variables.
         */
        const t = sectors[0].ceiling.z
        const a = sectors[sectors[0].extra].walls[0].pos.x
        //console.log(t);
        //console.log(a);

        /**
         * Object literal declaration using a type alias
         */
        const obj: test = {
            name: 2,
            god: 15,
            /**
             * The array here is kept inside the stack
             */
            low: Array(4)
        }

        obj.low[0].ball = 50;
        obj.low[1].ball = 66;
        obj.low[2].ball = 68;
        obj.low[3].ball = 80;
        const y = obj.low[1].ball;

        /** 
         * These commands print values to the console using addlog
         */
        PrintValue(obj.low[1].ball);
        PrintValue(obj.low.length);

        /**
         * This will allocate a new array on the heap
         */
        const u: number[] = [];
        /**
         * Now it must realocate the array to fit another value
         * (since it's on the heap and the size is less than one PAGE, nothing happens)
         */
        u.push(3);
        PrintValue(u.length);
        PrintValue(u[0]);

        /**
         * This commands prints the entire stack and heap usage to the console and breaks the game
         * unless you're using a debug version of Eduke32
         */
        //PrintStackAndBreak();
    }
}
                    

Class Reference

CFile

Class for file operations (code is optimized)

Properties

Property Type Description
seek number The current file seek position
path string The current path of the file opened
buffer number[] The buffer that holds the file contents
length number The length of the file content
loaded boolean If the file has been read or not
type number Determines if it's a binary or text file

Methods

Method Description Parameters Returns
constructor(path: string) Open a file path: The path of the file A class object holding the file's content and method to operate it.
Read(type: number, encoding: 8 | 16 | 32 = 8) Reads the file as a 4 byte binary or a encoded text type: Binary or text @see {@link FileReadType}
encoding: (optional) 8 by default. Only used if in text mode
void
Write(type: FileReadType, encoding: 8 | 16 | 32 = 8) Write the contents of buffer to the path type: binary or text
encoding: text enconding
void
GetValue() Gets the value of the current file by its seek position - The value from the file's seek position
SetValue(value: number) Sets the a value using the current file's seek position value: The value to be set void
CopyMemToFile(buffer: [], num_dwords: number) Copies a portion of a buffer's content to the file buffer: The source buffer
num_dwords: The size in DWORD (32-bits) to be copied
void
CopyFileToMem(buffer: [], num_dwords: number) Copies a portion of the file's content to a buffer buffer: The destination buffer
num_dwords: The size in DWORD (32-bits) to be copied
void
ReadString() Reads a string from the file - The string
ReadLine() Reads a line from the file - The line string
GetBuffer() Returns the buffer witht eh file content - an array or string
SetBuffer(buffer: []) Sets the current buffer to the one provided buffer: the buffer that's gonna replace void

CActor

@class for actor declaration. Use this as extension to declare your custom actors.

Properties

PropertyTypeDescription
defaultStrengthnumber
defaultPicnumnumber
picnumnumberThe current tile number of this actor
isEnemybooleanNot accessible outside the constructor
extranumberThe 'health' of this actor
htExtranumberHow much damage it took
damagenumberHow much damage it took
htPicnumnumberWhich projectile damaged
weaponHitnumberWhich projectile damaged
playerDistnumberThe current distance from the nearest player
curActionnumberThe current action pointer
curActionFramenumberThe current action frame
curMovenumberThe current move pointer
velnumberThe current velocity
angnumberThe current actor's angle
posvec3The current position
curAInumberThe current AI pointer
palnumberThe current palette used by the actor
curSectorCSectorThe current sector object
curSectorIDnumberThe current sector ID
flagsnumberThe special flags active for the sprite
tagstagThe Lotag and Hitag of the sprite

Methods

MethodDescriptionParametersReturns
constructor(picnum: constant, isEnemy: boolean, extra: constant, no_labelobj?: boolean, actor_hardcode?: boolean)You must call this to begin the actor's declarationpicnum: the current actor's tile number
isEnemy: if it's an enemy or not
extra: the health
no_labelobj: true by default. Use false if you don't want the complete label declaration in memory as objects
actor_hardcode: set to true if it's a hard coded actor
PlayAction(action: IAction | null)Play an actionaction: the IAction object declared for this classvoid
Move(move: IMove | null, flags: number)Move the actormove: the IMove object declared for this class
flags: the movement flags
void
StartAI(ai: IAi | null)Start the AI configuration for this actorai: the IAi object declared for this classvoid
CStat(stats?: number)Set or get the current stat for the actorstats: The stats to be set or leave blank it to only return the current valuenumber
CStatOR(stats: number)OR the stat value to the actor's statstats: The stats to be setvoid
SizeAt(w: number, h: number)Immediately set the size for this particular actorw: the width (0 - 255)
h: the height(0 - 255)
void
SizeTo(w: number, h: number, inc_x?: number, inc_y?: number)Sets the size for this particular actor by incrementing the width and height by @param inc_x and @param inc_y each tickw: the maximum width
h: the maximum height
inc_x: how much to increment the width each tick
inc_y: how much to increment the height each tick
void
Count(value?: number)Set or gets the native counter for this actorvalue: Set the counter to this value. Leave blank to just retrieve the current counter valuenumber
ActionCount(value?: number)Set or gets the native action counter for this actorvalue: Set the ation counter to this value. Leave blank to just retrieve the current action counter valuenumber
CeilingDist()Gets the current distance from the ceiling-number
FloorDist()Gets the current distance from the floor-number
GapDist()Gets the current gap distance from floor to ceiling-number
Fall()Enables 'physics' for this actor-void
GetLastPal()Returns the last pal value used before the current one-void
KillIt()Deletes the actor from the game world-void
Stop()Use this to stop the current actor's process-void
ResetAction()Reset's the action counter-void
Spawn(picnum: number | CActor, initFn?: ((id: number) => void), queued?: boolean)Spawn a actorpicnum: The tile number of the actor
initFn: (optional) a function to run after the actor has been spawned to initialize it
queued: (optional) Set this to true if you want it to become part of the queue system
number
Shoot(picnum: number | CActor, initFn?: ((id: number) => void), use_zvel?: boolean, zvel?: number, additive_zvel?: boolean)Shoots a projectilepicnum: The projectile's tile number
initFn: (optional) a function to run after the projectile has been shot to initialize it
use_zvel: (optional) Shoot with vertical veliocity
zvel: (optional) the vertical velocity - must set @param use_zvel to true
additive_zvel: (optional) Set this to true to add your vertical velocity to the actor's already set
number
HitRadius(radius: number, furthestDmg: number, farDmg: number, closeDmg: number, closestDmg: number)Damages all actors and sectors in a radius (divided into 4 ranges)radius: The maximum radius
furthestDmg: The furthest range damage
farDmg: The far range damage
closeDmg: the close range damage
closestDmg: the closest range damage
void
Flash()Flashes for a brief second some visible sectors-void
RespawnHitag()Activates 9 or less respawn sprites with a lotag matching the current actor's hitag.-void
Operate(flags: EOperateFlags, lotag?: number, player_id?: number, sector?: number, sprite?: number)Causes the current actor to ope/activate a nearby door, activator, master switch, sector or sector effector.flags: which entity to activate
lotag: (optional - depends on what flag is set) the lotag to activate activators or master switches
player_id: (optional) the player ID from whom should do the call
sector: (optional) the sector ID to be used
sprite: the sprite ID to be used
void
Sound(sound_id: number, global?: boolean, once?: boolean)Plays a soundsound_id: the sound ID
global: play globally or not
once: (optional) - only play it again if the other instance has finished already
void
StopSound(sound_id: number)Stops playing a soundsound_id: the sound IDvoid
IsAwayFromWall()Returns if the actor is away from wall-boolean
IsInWater()Returns if the actor is in the water-boolean
IsOnWater()Returns if the actor is on the water-boolean
IsOutside()Checks if the current actor is in a sector with a parallaxed ceiling (sky).-boolean
IsInSpace()Checks if the actor is in space-boolean
IsInOuterSpace()Checks if the actor is in outer space-boolean
IsRandom(value: number)A function condition stating the probability of it 'doin somethin!' in this case.
A @param value greater or equal to 255 corresponds to a 100% probability that the first block is taken.
With a @param value of -1, the "else" block is taken every time.(A of 0 means taking the "if" block once out of 256 on average).
This command must only be used in synchronised code or you will cause desyncs.
For display code use displayrand instead.
value: the value of chance (0 - 255)boolean
IsDead()Checks if the current actor is dead (health is zero or below)-boolean
Squished()Checks if the actor has been suished by a sector-boolean
IsItMoving()Checks if the actor is moving-boolean
BulletNear()Returns 'true' if a projectile is near the actor.
In the case of hitscan projectiles (such as SHOTSPARK1),
it returns true if the point of impact is near the player.
-boolean
HitByWeapon()Checks if the current actor was struck by a weapon.
Built-in damage processing occurs when using @method HitByWeapon, so it must be called frequently
in actor code in order for the actor to be affected by projectiles.
-boolean
CanSee()If condition returning true if there is a line of sight between the current actor and the player.
The difference with @method CanSeeTarget is that @method CanSee actually verifies if the player
can see any actual part of the current actor tile (and basically would be hard to the player say
how an enemy looked alike while standing except if he use F7 view mode),
while @method CanSeeTarget verify if the current actor has "eye contact" with the player
(and in result the player is capable of viewing a arm or a litoral part of an enemy without
it targeting the player).
-boolean
CanSeeTarget()If condition returning true if the current actor can see the player.-boolean
CanShootTarget()If condition returning true if the current actor can shoot the player.-boolean
PlayerHitSpace()Checks to see if the player has pressed the open button (space by default).-boolean
WhichWeaponHit()Goes with @method HitByWeapon. Returns which projectile hit the actor.-number
AngleToTarget()@todo no implemented yet
Calculates the angle necessary for the current sprite to face whatever target is
or was at the coordinates htlastvx and htlastvy.
-number
Debris(tile: constant, amount: constant)Spawns the hard-coded debris. Scraps inherit the owner palette.tile: the tile number of the debris can be SCRAP1 through SCRAP6 (see {@link Names}).
amount: the amount of debris to spawn
void
Guts(tile: constant, amount: constant)Spawns the hard-coded gore.tile: the tile number of the gut, can be JIBS1 through JIBS6, HEADJIB, LEGJIB... (See {@link Names})
amount: the amount of guts to spawn
void
Mail(amount: constant)Causes the current actor to spawn @param amount envelopes.amount: the amount of envelopes to spawnvoid
Money(amount: constant)Attracts the ladies. Well, no, not really, at least not in the game.
Spawns @param amount of dollar bills.
amount: the amount of money to spawnvoid
Paper(amount: constant)Spawns @param amount of pieces of paper to use the same type of movement of the money command.amount: the amount of paper to spawnvoid
Glass(amount: constant)Causes the current actor to spawn @param amount of broken glass pieces.
NOTE: If @method Pal is used right before this command, it will change the glass palette as well.
amount: the amount of glass to spawnvoid
Pal(color: number)Changes the current actor's palette reference number to @param color.color: the palette to changevoid
AddKills(amount: constant)Add @param amount to the kill counteramount: how many kills to addvoid
PlayerKick()Makes the player kick-void
LockPlayer(time: number)Locks the player movement by @param time amount of timetime: the amount of time to lock the playervoid
ResetPlayer(flags: number)Reload the map (if in Single Player) and the player loses his inventory.
Also if in Single Player mode, execution of subsequent code is halted in a fashion similar to return.
flags: set to 1 to don't ask the player if they want to load the most recent save (if applicable)void

CEvent

@class for declaring events. Use this as extension.

Methods

MethodDescriptionParametersReturns
constructor(event: TEvents)Starts the event declarationevent: the event that will be defined. See {@link TEvents}
RotateSprite(x: number, y: number, scale: number, ang: number, picnum: number, shade: number, pal: number, orientation: number, x0: number, y0: number, x1: number, y1: number)Displays a sprite onto the screenx: the X position
y: the Y position
scale: the sprite scale (65536 is the sprite's normal size)
ang: angle
picnum: the tile number of the sprite
shade: shade value
pal: palette value
orientation: orientation flags
x0: the window x0 value
y0: the window y0 value
x1: the window x1 value. See {@link xDim}
y1: the window y1 value. See {@link yDim}
void
DrawSprite(pos: pos2, picnum: number, style: TStyle)Displays a sprite onto the screen. An easier method to use.pos: the object containg the position of the sprite. See {@link pos2}
picnum: the tile number of the sprite.
style: the styling of the sprite. See {@link TStyle}
void
ScreenSound(sound: number)Plays a sound during display eventssound: the sound ID to be playedvoid
ScreenText(picnum: number, x: number, y: number, scale: number, block_ang: number, character_ang: number, quote: quote, shade: number, pal: number, orientation: number, alpha: number, xspace: number, yline: number, xbetween: number, ybetween: number, flags: number, x0: number, y0: number, x1: number, y1: number)picnum:
x:
y:
scale:
block_ang:
character_ang:
quote:
shade:
pal:
orientation:
alpha:
xspace:
yline:
xbetween:
ybetween:
flags:
x0:
y0:
x1:
y1:
void
QuoteDimension(picnum: number, x: number, y: number, scale: number, block_ang: number, character_ang: number, quote: quote, shade: number, pal: number, orientation: number, alpha: number, xspace: number, yline: number, xbetween: number, ybetween: number, flags: number, x0: number, y0: number, x1: number, y1: number)picnum:
x:
y:
scale:
block_ang:
character_ang:
quote:
shade:
pal:
orientation:
alpha:
xspace:
yline:
xbetween:
ybetween:
flags:
x0:
y0:
x1:
y1:
vec2
Append()Use append if you want to append this event to the others of the same type-void | number
Prepend()Use this if you want to prepend this event to the other of the same type.-void | number

CWall

Properties

PropertyTypeDescription
posvec2
point2number
blendnumber
nextWallnumber
nextSectornumber
cstatnumber
picnumnumber
overpicnumnumber
shadenumber
palnumber
texRepeatvec2
texPanvec2
tagstag
extranumber
angnumber
wallPoint2CWall
next{ wall: CWall, sector: CSector }

CSector

Properties

PropertyTypeDescription
wallPtrnumber
wallNumnumber
ceilingCSectorBase
floorCSectorBase
visibilitynumber
fogPalnumber
tagstag
extranumber
firstWallCWall
wallsCWall[]

Interface Reference

IFont

Interface for declaring fonts used in the game

Properties

PropertyTypeDescription
tilenumberThe starting tile of the font
xSpacenumberThe width of the whitespace character
yLinenumberthe height of an empty line
xBetweennumberThe x distance between characters
yBetweennumberThe y distance between lines
offsetvec2The xy offset
maxSizeCharvec2The maximum width/height of the alphabet characters' (used for line ending calculations)
flagsETextFlagsThe font's flags

ISys

Interface representing the TypeCON system framework

Properties

PropertyTypeDescription
raCON_NATIVE_GAMEVAR<'ra', number>Accumulator register. Used for all kinds of operations. All results are stored in it.
rbCON_NATIVE_GAMEVAR<'rb', number>Base register. Used for return values and sometimes as a helper in some operations.
rcCON_NATIVE_GAMEVAR<'rc', number>Counter register. Used for loops.
rdCON_NATIVE_GAMEVAR<'rd', number>Data registers. Used in if/binary expressions to hold the right side of the operation.
rfCON_NATIVE_GAMEVAR<'rf', number>Flags register.
riCON_NATIVE_GAMEVAR<'ri', number>Index register. Holds the current index of the stack/heap memory during operations.
rsiCON_NATIVE_GAMEVAR<'rsi', number>Source Index register. In operations envolving 2 memory pointers, it usually holds the "source".
rbpCON_NATIVE_GAMEVAR<'rbp', number>Base pointer register. Holds the base of the current stack.
rspCON_NATIVE_GAMEVAR<'rsp', number>Stack pointer register. Holds the current stack value.
rsspCON_NATIVE_GAMEVAR<'rssp', number>String Stack pointer register. Holds the current string stack value.
rbspCON_NATIVE_GAMEVAR<'rbsp', number>String Base pointer register. Hold the base of the current string stack.

Methods

MethodDescriptionParametersReturns
GetReference(register: number)Returns a reference from the register's valueregister: The register to get the reference[] | string
BufferToIndex(buffer: any[], array: boolean)Returns the reference from the buffer to ri registerbuffer: The buffer reference
array: If true, it adds 1 to the ri (first slot is the length)
void
BufferToSourceIndex(buffer: any[], array: boolean)Returns the reference from the buffer to rsi registerbuffer: The buffer reference
array: If true, it adds 1 to the ri (first slot is the length)
void

IWeapon00

Interface for the Mighty Foot weapon (weapon 00).

Properties

PropertyTypeDescription
flagsCON_NATIVE_GAMEVAR<'WEAPON0_FLAGS', number>The flags for the weapon (does not control the projectile)
clipCON_NATIVE_GAMEVAR<'WEAPON0_CLIP', number>It's the amount of ammo that can be fired before there is a reloading animation and pause.
reloadCON_NATIVE_GAMEVAR<'WEAPON0_RELOAD', number>Defines the number of frames displayed in the weapon's reload sequence
fireDelayCON_NATIVE_GAMEVAR<'WEAPON0_FIREDELAY', number>Defines what frame the weapon will fire its projectile on.
holdDelayCON_NATIVE_GAMEVAR<'WEAP0_HOLDDELAY', number>The number of animation frames between shooting and reloading.
totalTimeCON_NATIVE_GAMEVAR<'WEAPON0_TOTALTIME', number>Defines the total number of frames a weapon uses in its firing sequence.
flashColorCON_NATIVE_GAMEVAR<'WEAPON0_FLASHCOLOR', number>The flash color of the weapon.
shootsCON_NATIVE_GAMEVAR<'WEAPON0_SHOOTS', number>This is the tilenum of the projectile.
shotsPerBurstCON_NATIVE_GAMEVAR<'WEAPON0_SHOTSPERBURST', number>Defines the amount of projectiles that will fire when the weapon reaches its firing frame.
spawnCON_NATIVE_GAMEVAR<'WEAPON0_SPAWN', number>This defines what the weapon spawns when the spawnTime is reached.
spawnTimeCON_NATIVE_GAMEVAR<'WEAPON0_SPAWNTIME', number>Defines what frame the item specified by spawn will spawn on.
reloadSound1CON_NATIVE_GAMEVAR<'WEAPON0_RELOADSOUND1', number>If RELOAD_TIMING is enabled, this is the first sound to be played in the weapon's reload sequence.
reloadSound2CON_NATIVE_GAMEVAR<'WEAPON0_RELOADSOUND2', number>If RELOAD_TIMING is enabled, this is the second sound to be played in the weapon's reload sequence.
selectSoundCON_NATIVE_GAMEVAR<'WEAPON0_SELECTSOUND', number>The sound played when a weapon is selected.
fireSoundCON_NATIVE_GAMEVAR<'WEAPON0_FIRESOUND', number>Plays the corresponding sound when the weapon counter reaches the number specified by fireDelay.
initialSoundCON_NATIVE_GAMEVAR<'WEAPON0_INITIALSOUND', number>Defines the sound that will play when the player starts to fire the weapon.
sound2SoundCON_NATIVE_GAMEVAR<'WEAPON0_SOUND2SOUND', number>This is the weapon's second sound.
sound2TimeCON_NATIVE_GAMEVAR<'WEAPON0_SOUND2TIME', number>If the weapon has a second shooting sound defined, this is the frame number for the second sound to start.

IWeapon01

Interface for the Pistol weapon (weapon 01).

Properties

PropertyTypeDescription
flagsCON_NATIVE_GAMEVAR<'WEAPON1_FLAGS', number>The flags for the weapon (does not control the projectile)
clipCON_NATIVE_GAMEVAR<'WEAPON1_CLIP', number>It's the amount of ammo that can be fired before there is a reloading animation and pause.
reloadCON_NATIVE_GAMEVAR<'WEAPON1_RELOAD', number>Defines the number of frames displayed in the weapon's reload sequence
fireDelayCON_NATIVE_GAMEVAR<'WEAPON1_FIREDELAY', number>Defines what frame the weapon will fire its projectile on.
holdDelayCON_NATIVE_GAMEVAR<'WEAP1_HOLDDELAY', number>The number of animation frames between shooting and reloading.
totalTimeCON_NATIVE_GAMEVAR<'WEAPON1_TOTALTIME', number>Defines the total number of frames a weapon uses in its firing sequence.
flashColorCON_NATIVE_GAMEVAR<'WEAPON1_FLASHCOLOR', number>The flash color of the weapon.
shootsCON_NATIVE_GAMEVAR<'WEAPON1_SHOOTS', number>This is the tilenum of the projectile.
shotsPerBurstCON_NATIVE_GAMEVAR<'WEAP1_SHOTSPERBURST', number>Defines the amount of projectiles that will fire when the weapon reaches its firing frame.
spawnCON_NATIVE_GAMEVAR<'WEAPON1_SPAWN', number>This defines what the weapon spawns when the spawnTime is reached.
spawnTimeCON_NATIVE_GAMEVAR<'WEAP1_SPAWNTIME', number>Defines what frame the item specified by spawn will spawn on.
reloadSound1CON_NATIVE_GAMEVAR<'WEAPON1_RELOADSOUND1', number>If RELOAD_TIMING is enabled, this is the first sound to be played in the weapon's reload sequence.
reloadSound2CON_NATIVE_GAMEVAR<'WEAP1_RELOADSOUND2', number>If RELOAD_TIMING is enabled, this is the second sound to be played in the weapon's reload sequence.
selectSoundCON_NATIVE_GAMEVAR<'WEAP1_SELECTSOUND', number>The sound played when a weapon is selected.
fireSoundCON_NATIVE_GAMEVAR<'WEAP1_FIRESOUND', number>Plays the corresponding sound when the weapon counter reaches the number specified by fireDelay.
initialSoundCON_NATIVE_GAMEVAR<'WEAP1_INITIALSOUND', number>Defines the sound that will play when the player starts to fire the weapon.
sound2SoundCON_NATIVE_GAMEVAR<'WEAP1_SOUND2SOUND', number>This is the weapon's second sound.
sound2TimeCON_NATIVE_GAMEVAR<'WEAP1_SOUND2TIME', number>If the weapon has a second shooting sound defined, this is the frame number for the second sound to start.

IWeapon02

Interface for the Shotgun weapon (weapon 02).

Properties

PropertyTypeDescription
flagsCON_NATIVE_GAMEVAR<'WEAPON2_FLAGS', number>Flags for the weapon (does not control the projectile)
clipCON_NATIVE_GAMEVAR<'WEAPON2_CLIP', number>
reloadCON_NATIVE_GAMEVAR<'WEAP2_RELOAD', number>
fireDelayCON_NATIVE_GAMEVAR<'WEAP2_FIREDELAY', number>
holdDelayCON_NATIVE_GAMEVAR<'WEAP2_HOLDDELAY', number>
totalTimeCON_NATIVE_GAMEVAR<'WEAP2_TOTALTIME', number>
flashColorCON_NATIVE_GAMEVAR<'WEAP2_FLASHCOLOR', number>
shootsCON_NATIVE_GAMEVAR<'WEAP2_SHOOTS', number>
shotsPerBurstCON_NATIVE_GAMEVAR<'WEAP2_SHOTSPERBURST', number>
spawnCON_NATIVE_GAMEVAR<'WEAP2_SPAWN', number>
spawnTimeCON_NATIVE_GAMEVAR<'WEAP2_SPAWNTIME', number>
reloadSound1CON_NATIVE_GAMEVAR<'WEAP2_RELOADSOUND1', number>
reloadSound2CON_NATIVE_GAMEVAR<'WEAP2_RELOADSOUND2', number>
selectSoundCON_NATIVE_GAMEVAR<'WEAP2_SELECTSOUND', number>
fireSoundCON_NATIVE_GAMEVAR<'WEAP2_FIRESOUND', number>
initialSoundCON_NATIVE_GAMEVAR<'WEAP2_INITIALSOUND', number>
sound2SoundCON_NATIVE_GAMEVAR<'WEAP2_SOUND2SOUND', number>
sound2TimeCON_NATIVE_GAMEVAR<'WEAP2_SOUND2TIME', number>

IWeapon03

Interface for the Chaingun weapon (weapon 03).

Properties

PropertyTypeDescription
flagsCON_NATIVE_GAMEVAR<'WEAPON3_FLAGS', number>Flags for the weapon (does not control the projectile)
clipCON_NATIVE_GAMEVAR<'WEAP3_CLIP', number>
reloadCON_NATIVE_GAMEVAR<'WEAP3_RELOAD', number>
fireDelayCON_NATIVE_GAMEVAR<'WEAP3_FIREDELAY', number>
holdDelayCON_NATIVE_GAMEVAR<'WEAP3_HOLDDELAY', number>
totalTimeCON_NATIVE_GAMEVAR<'WEAP3_TOTALTIME', number>
flashColorCON_NATIVE_GAMEVAR<'WEAP3_FLASHCOLOR', number>
shootsCON_NATIVE_GAMEVAR<'WEAP3_SHOOTS', number>
shotsPerBurstCON_NATIVE_GAMEVAR<'WEAP3_SHOTSPERBURST', number>
spawnCON_NATIVE_GAMEVAR<'WEAP3_SPAWN', number>
spawnTimeCON_NATIVE_GAMEVAR<'WEAP3_SPAWNTIME', number>
reloadSound1CON_NATIVE_GAMEVAR<'WEAP3_RELOADSOUND1', number>
reloadSound2CON_NATIVE_GAMEVAR<'WEAP3_RELOADSOUND2', number>
selectSoundCON_NATIVE_GAMEVAR<'WEAP3_SELECTSOUND', number>
fireSoundCON_NATIVE_GAMEVAR<'WEAP3_FIRESOUND', number>
initialSoundCON_NATIVE_GAMEVAR<'WEAP3_INITIALSOUND', number>
sound2SoundCON_NATIVE_GAMEVAR<'WEAP3_SOUND2SOUND', number>
sound2TimeCON_NATIVE_GAMEVAR<'WEAP3_SOUND2TIME', number>

IWeapon04

Interface for the RPG weapon (weapon 04).

Properties

PropertyTypeDescription
flagsCON_NATIVE_GAMEVAR<'WEAP4_FLAGS', number>Flags for the weapon (does not control the projectile)
clipCON_NATIVE_GAMEVAR<'WEAP4_CLIP', number>
reloadCON_NATIVE_GAMEVAR<'WEAP4_RELOAD', number>
fireDelayCON_NATIVE_GAMEVAR<'WEAP4_FIREDELAY', number>
holdDelayCON_NATIVE_GAMEVAR<'WEAP4_HOLDDELAY', number>
totalTimeCON_NATIVE_GAMEVAR<'WEAP4_TOTALTIME', number>
flashColorCON_NATIVE_GAMEVAR<'WEAP4_FLASHCOLOR', number>
shootsCON_NATIVE_GAMEVAR<'WEAP4_SHOOTS', number>
shotsPerBurstCON_NATIVE_GAMEVAR<'WEAP4_SHOTSPERBURST', number>
spawnCON_NATIVE_GAMEVAR<'WEAP4_SPAWN', number>
spawnTimeCON_NATIVE_GAMEVAR<'WEAP4_SPAWNTIME', number>
reloadSound1CON_NATIVE_GAMEVAR<'WEAP4_RELOADSOUND1', number>
reloadSound2CON_NATIVE_GAMEVAR<'WEAP4_RELOADSOUND2', number>
selectSoundCON_NATIVE_GAMEVAR<'WEAP4_SELECTSOUND', number>
fireSoundCON_NATIVE_GAMEVAR<'WEAP4_FIRESOUND', number>
initialSoundCON_NATIVE_GAMEVAR<'WEAP4_INITIALSOUND', number>
sound2SoundCON_NATIVE_GAMEVAR<'WEAP4_SOUND2SOUND', number>
sound2TimeCON_NATIVE_GAMEVAR<'WEAP4_SOUND2TIME', number>

IWeapon05

Interface for the Pipebomb weapon (weapon 05).

Properties

PropertyTypeDescription
flagsCON_NATIVE_GAMEVAR<'WEAP5_FLAGS', number>Flags for the weapon (does not control the projectile)
clipCON_NATIVE_GAMEVAR<'WEAP5_CLIP', number>
reloadCON_NATIVE_GAMEVAR<'WEAP5_RELOAD', number>
fireDelayCON_NATIVE_GAMEVAR<'WEAP5_FIREDELAY', number>
holdDelayCON_NATIVE_GAMEVAR<'WEAP5_HOLDDELAY', number>
totalTimeCON_NATIVE_GAMEVAR<'WEAP5_TOTALTIME', number>
flashColorCON_NATIVE_GAMEVAR<'WEAP5_FLASHCOLOR', number>
shootsCON_NATIVE_GAMEVAR<'WEAP5_SHOOTS', number>
shotsPerBurstCON_NATIVE_GAMEVAR<'WEAP5_SHOTSPERBURST', number>
spawnCON_NATIVE_GAMEVAR<'WEAP5_SPAWN', number>
spawnTimeCON_NATIVE_GAMEVAR<'WEAP5_SPAWNTIME', number>
reloadSound1CON_NATIVE_GAMEVAR<'WEAP5_RELOADSOUND1', number>
reloadSound2CON_NATIVE_GAMEVAR<'WEAP5_RELOADSOUND2', number>
selectSoundCON_NATIVE_GAMEVAR<'WEAP5_SELECTSOUND', number>
fireSoundCON_NATIVE_GAMEVAR<'WEAP5_FIRESOUND', number>
initialSoundCON_NATIVE_GAMEVAR<'WEAP5_INITIALSOUND', number>
sound2SoundCON_NATIVE_GAMEVAR<'WEAP5_SOUND2SOUND', number>
sound2TimeCON_NATIVE_GAMEVAR<'WEAP5_SOUND2TIME', number>

IWeapon06

Interface for the Shrinker weapon (weapon 06).

Properties

PropertyTypeDescription
flagsCON_NATIVE_GAMEVAR<'WEAP6_FLAGS', number>Flags for the weapon (does not control the projectile)
clipCON_NATIVE_GAMEVAR<'WEAP6_CLIP', number>
reloadCON_NATIVE_GAMEVAR<'WEAP6_RELOAD', number>
fireDelayCON_NATIVE_GAMEVAR<'WEAP6_FIREDELAY', number>
holdDelayCON_NATIVE_GAMEVAR<'WEAP6_HOLDDELAY', number>
totalTimeCON_NATIVE_GAMEVAR<'WEAP6_TOTALTIME', number>
flashColorCON_NATIVE_GAMEVAR<'WEAP6_FLASHCOLOR', number>
shootsCON_NATIVE_GAMEVAR<'WEAP6_SHOOTS', number>
shotsPerBurstCON_NATIVE_GAMEVAR<'WEAP6_SHOTSPERBURST', number>
spawnCON_NATIVE_GAMEVAR<'WEAP6_SPAWN', number>
spawnTimeCON_NATIVE_GAMEVAR<'WEAP6_SPAWNTIME', number>
reloadSound1CON_NATIVE_GAMEVAR<'WEAP6_RELOADSOUND1', number>
reloadSound2CON_NATIVE_GAMEVAR<'WEAP6_RELOADSOUND2', number>
selectSoundCON_NATIVE_GAMEVAR<'WEAP6_SELECTSOUND', number>
fireSoundCON_NATIVE_GAMEVAR<'WEAP6_FIRESOUND', number>
initialSoundCON_NATIVE_GAMEVAR<'WEAP6_INITIALSOUND', number>
sound2SoundCON_NATIVE_GAMEVAR<'WEAP6_SOUND2SOUND', number>
sound2TimeCON_NATIVE_GAMEVAR<'WEAP6_SOUND2TIME', number>

IWeapon07

Interface for the Devastator weapon (weapon 07).

Properties

PropertyTypeDescription
flagsCON_NATIVE_GAMEVAR<'WEAP7_FLAGS', number>Flags for the weapon (does not control the projectile)
clipCON_NATIVE_GAMEVAR<'WEAP7_CLIP', number>
reloadCON_NATIVE_GAMEVAR<'WEAP7_RELOAD', number>
fireDelayCON_NATIVE_GAMEVAR<'WEAP7_FIREDELAY', number>
holdDelayCON_NATIVE_GAMEVAR<'WEAP7_HOLDDELAY', number>
totalTimeCON_NATIVE_GAMEVAR<'WEAP7_TOTALTIME', number>
flashColorCON_NATIVE_GAMEVAR<'WEAP7_FLASHCOLOR', number>
shootsCON_NATIVE_GAMEVAR<'WEAP7_SHOOTS', number>
shotsPerBurstCON_NATIVE_GAMEVAR<'WEAP7_SHOTSPERBURST', number>
spawnCON_NATIVE_GAMEVAR<'WEAP7_SPAWN', number>
spawnTimeCON_NATIVE_GAMEVAR<'WEAP7_SPAWNTIME', number>
reloadSound1CON_NATIVE_GAMEVAR<'WEAP7_RELOADSOUND1', number>
reloadSound2CON_NATIVE_GAMEVAR<'WEAP7_RELOADSOUND2', number>
selectSoundCON_NATIVE_GAMEVAR<'WEAP7_SELECTSOUND', number>
fireSoundCON_NATIVE_GAMEVAR<'WEAP7_FIRESOUND', number>
initialSoundCON_NATIVE_GAMEVAR<'WEAP7_INITIALSOUND', number>
sound2SoundCON_NATIVE_GAMEVAR<'WEAP7_SOUND2SOUND', number>
sound2TimeCON_NATIVE_GAMEVAR<'WEAP7_SOUND2TIME', number>

IWeapon08

Interface for the Tripbomb weapon (weapon 08).

Properties

PropertyTypeDescription
flagsCON_NATIVE_GAMEVAR<'WEAP8_FLAGS', number>Flags for the weapon (does not control the projectile)
clipCON_NATIVE_GAMEVAR<'WEAP8_CLIP', number>
reloadCON_NATIVE_GAMEVAR<'WEAP8_RELOAD', number>
fireDelayCON_NATIVE_GAMEVAR<'WEAP8_FIREDELAY', number>
holdDelayCON_NATIVE_GAMEVAR<'WEAP8_HOLDDELAY', number>
totalTimeCON_NATIVE_GAMEVAR<'WEAP8_TOTALTIME', number>
flashColorCON_NATIVE_GAMEVAR<'WEAP8_FLASHCOLOR', number>
shootsCON_NATIVE_GAMEVAR<'WEAP8_SHOOTS', number>
shotsPerBurstCON_NATIVE_GAMEVAR<'WEAP8_SHOTSPERBURST', number>
spawnCON_NATIVE_GAMEVAR<'WEAP8_SPAWN', number>
spawnTimeCON_NATIVE_GAMEVAR<'WEAP8_SPAWNTIME', number>
reloadSound1CON_NATIVE_GAMEVAR<'WEAP8_RELOADSOUND1', number>
reloadSound2CON_NATIVE_GAMEVAR<'WEAP8_RELOADSOUND2', number>
selectSoundCON_NATIVE_GAMEVAR<'WEAP8_SELECTSOUND', number>
fireSoundCON_NATIVE_GAMEVAR<'WEAP8_FIRESOUND', number>
initialSoundCON_NATIVE_GAMEVAR<'WEAP8_INITIALSOUND', number>
sound2SoundCON_NATIVE_GAMEVAR<'WEAP8_SOUND2SOUND', number>
sound2TimeCON_NATIVE_GAMEVAR<'WEAP8_SOUND2TIME', number>

IWeapon09

Interface for the Freezer weapon (weapon 09).

Properties

PropertyTypeDescription
flagsCON_NATIVE_GAMEVAR<'WEAP9_FLAGS', number>Flags for the weapon (does not control the projectile)
clipCON_NATIVE_GAMEVAR<'WEAP9_CLIP', number>
reloadCON_NATIVE_GAMEVAR<'WEAP9_RELOAD', number>
fireDelayCON_NATIVE_GAMEVAR<'WEAP9_FIREDELAY', number>
holdDelayCON_NATIVE_GAMEVAR<'WEAP9_HOLDDELAY', number>
totalTimeCON_NATIVE_GAMEVAR<'WEAP9_TOTALTIME', number>
flashColorCON_NATIVE_GAMEVAR<'WEAP9_FLASHCOLOR', number>
shootsCON_NATIVE_GAMEVAR<'WEAP9_SHOOTS', number>
shotsPerBurstCON_NATIVE_GAMEVAR<'WEAP9_SHOTSPERBURST', number>
spawnCON_NATIVE_GAMEVAR<'WEAP9_SPAWN', number>
spawnTimeCON_NATIVE_GAMEVAR<'WEAP9_SPAWNTIME', number>
reloadSound1CON_NATIVE_GAMEVAR<'WEAP9_RELOADSOUND1', number>
reloadSound2CON_NATIVE_GAMEVAR<'WEAP9_RELOADSOUND2', number>
selectSoundCON_NATIVE_GAMEVAR<'WEAP9_SELECTSOUND', number>
fireSoundCON_NATIVE_GAMEVAR<'WEAP9_FIRESOUND', number>
initialSoundCON_NATIVE_GAMEVAR<'WEAP9_INITIALSOUND', number>
sound2SoundCON_NATIVE_GAMEVAR<'WEAP9_SOUND2SOUND', number>
sound2TimeCON_NATIVE_GAMEVAR<'WEAP9_SOUND2TIME', number>

IWeapon10

Interface for the Hand Remot/Detonator weapon (weapon 10).

Properties

PropertyTypeDescription
flagsCON_NATIVE_GAMEVAR<'WEAPON10_FLAGS', number>Flags for the weapon (does not control the projectile)
clipCON_NATIVE_GAMEVAR<'WEAP10_CLIP', number>
reloadCON_NATIVE_GAMEVAR<'WEAP10_RELOAD', number>
fireDelayCON_NATIVE_GAMEVAR<'WEAP10_FIREDELAY', number>
holdDelayCON_NATIVE_GAMEVAR<'WEAP10_HOLDDELAY', number>
totalTimeCON_NATIVE_GAMEVAR<'WEAP10_TOTALTIME', number>
flashColorCON_NATIVE_GAMEVAR<'WEAP10_FLASHCOLOR', number>
shootsCON_NATIVE_GAMEVAR<'WEAP10_SHOOTS', number>
shotsPerBurstCON_NATIVE_GAMEVAR<'WEAP10_SHOTSPERBURST', number>
spawnCON_NATIVE_GAMEVAR<'WEAP10_SPAWN', number>
spawnTimeCON_NATIVE_GAMEVAR<'WEAP10_SPAWNTIME', number>
reloadSound1CON_NATIVE_GAMEVAR<'WEAP10_RELOADSOUND1', number>
reloadSound2CON_NATIVE_GAMEVAR<'WEAP10_RELOADSOUND2', number>
selectSoundCON_NATIVE_GAMEVAR<'WEAP10_SELECTSOUND', number>
fireSoundCON_NATIVE_GAMEVAR<'WEAP10_FIRESOUND', number>
initialSoundCON_NATIVE_GAMEVAR<'WEAP10_INITIALSOUND', number>
sound2SoundCON_NATIVE_GAMEVAR<'WEAP10_SOUND2SOUND', number>
sound2TimeCON_NATIVE_GAMEVAR<'WEAP10_SOUND2TIME', number>

Enum Reference

FileReadType

Member Value Description
binary 0 -
text 1 -

EOrientationFlags

Bit-flags accepted by the Build-engine `rotatesprite*` family of functions.
Combine multiple flags with the bitwise OR (`|`) operator.

MemberValueDescription
TRANS11Translucency level 1 (≈ 66 % opacity).
AUTO2Enable 320 × 200 coordinate scaling (recommended for portability).
YFLIP4Flip the sprite vertically; combine with angle = 1024 for X-flip.
NOCLIP8Make sprite immune to screen-size changes (e.g. status bar).
TOPLEFT16Treat the sprite’s top-left as its origin; ignore tile offsets.
TRANS232Translucency level 2 (≈ 33 % opacity). Requires `TRANS1`.
NOMASK64Disable masking (and translucency).
PERM128**Deprecated** “permanent” tile flag.
ALIGN_L256Align sprite to the left edge on widescreen displays.
ALIGN_R512Align sprite to the right edge on widescreen displays.
STRETCH1024Stretch sprite to full resolution (pre-widescreen behaviour).
ROTATESPRITE_FULL162048Interpret coordinates as 16-bit-shifted “full-precision” values.
LERP4096Interpolate position between calls (per `guniqhudid`).
FORCELERP8192Force interpolation even when the tile number changes.

ETextFlags

Bit-flags that control how EDuke32 renders on-screen strings.
Combine multiple flags with the bitwise OR (`|`) operator to build a render style.

MemberValueDescription
XRIGHT1Right-align text on the x axis.
XCENTER2Center-align text on the x axis.
YBOTTOM4Bottom-align text on the y axis.
YCENTER8Center-align text on the y axis.
INTERNALSPACE16Engine chooses ``; your value is added.
TILESPACE32`` derived from the width of the tile after `'~'`.
INTERNALLINE64Engine chooses ``; your value is added.
TILELINE128`` derived from the height of the tile after `'~'`.
XOFFSETZERO256Treat `` as a constant glyph width.
XJUSTIFY512Justify text horizontally (compatible with `XRIGHT` and `XCENTER`).
YOFFSETZERO1024Treat `` as a constant line height.
YJUSTIFY2048Justify text vertically (compatible with `YBOTTOM` and `YCENTER`).
RESERVED_40964096*Reserved – do not use.*
UPPERCASE8192Force all letters to uppercase.
INVERTCASE16384Swap the case of each letter (combine with `UPPERCASE` for lowercase).
IGNOREESCAPE32768Ignore palette escape sequences (`#`, `##`).
LITERALESCAPE65536Render palette escape sequences literally.
RESERVED_131072131072*Reserved – do not use.*
CONSTWIDTHNUMS262144Render numerals with constant width.
DIGITALNUMBER524288Tile order starts at `'0'`; for digital number tiles.
BIGALPHANUM1048576Use the red main-menu font tile order.
GRAYFONT2097152Use the gray-font tile order.
NOLOCALE4194304Skip localization translation.
VARHEIGHT8388608Shift by half a tile when `RS_TOPLEFT` is not set.
CENTERCONSTWIDTH16777216Center glyphs and respect `` in constant-width mode.

ESpriteFlags

**ESpriteFlags** – per-sprite runtime flags (the “SFLAG_” bits from EDuke 32).

MemberValueDescription
SHADOW1Generate a shadow (`spriteshadow`).
NVG2Switch to palette 6 when night-vision goggles are active (`spritenvg`).
NOSHADE4Ignore sector shade (`spritenoshade`).
PROJECTILE8Was created with `defineprojectile`.
DECAL16Prevents teleporting; not entered into the decal-deletion queue.
BADGUY32Marks the sprite as an enemy (`useractor`).
NOPAL64Immune to floor palette (`spritenopal`).
NOEVENTS128Excluded from `EVENT_GAME` and `EVENT_PREGAME`.
NOLIGHT256Suppress hard-coded Polymer lights.
USEACTIVATOR512Reserved flag used by `useractor` (`activate`).
NULL1024“Null sprite” placeholder in multiplayer (internal).
NOCLIP2048Calls `clipmove()` with a 0 clipmask (no sprite collisions) – useful for particles.
NOFLOORSHADOW4096Don’t draw a floor shadow.
SMOOTHMOVE8192Enable client-side interpolation (smooth movement).
NOTELEPORT16384Prevent teleportation.
BADGUYSTAYPUT32768Enemy will not leave its original sector.
CACHE65536Engine-side cache hint.
ROTFIXED131072Rotation-fixed around a pivot to avoid round-off drift.
HARDCODED_BADGUY262144Hard-coded enemy marker (internal).
DIDNOSE7WATER524288Temporary internal flag.
NODAMAGEPUSH1048576Actor isn’t pushed back by damage.
NOWATERDIP2097152Actor won’t dip into water sectors (lotag 1).
HURTSPAWNBLOOD4194304Spawn blood when hurt (as hard-coded enemies do).
GREENSLIMEFOOD8388608Can be eaten by **GREENSLIME** (Protozoid Slimer).
REALCLIPDIST16777216Always use its explicit `clipdist`.
WAKEUPBADGUYS33554432Wakes up nearby enemies when activated.
DAMAGEEVENT67108864Fires `EVENT_(POST)DAMAGESPRITE` when damaged.
NOWATERSECTOR134217728Cannot move into water sectors.
QUEUEDFORDELETE268435456Marked for deletion by the engine.

EPlayerStates

Represents the valid player states.
This enum is used to determine the current state of the player.
Only one state should be set at a time.

MemberValueDescription
standing1The player is standing.
walking2The player is walking.
running4The player is running.
ducking8The player is ducking.
falling16The player is falling.
jumping32The player is jumping.
higher64The player is in a higher state (e.g., during a jump).
walkingback128The player is walking backwards.
runningback256The player is running backwards.
kicking512The player is kicking.
shrunk1024The player is shrunk.
jetpack2048The player is using a jetpack.
onsteroids4096The player is on steroids.
onground8192The player is on the ground.
alive16384The player is alive.
dead32768The player is dead.
facing65536The player is facing (direction indicated).

EStats

SpriteCStat flags control how a sprite is rendered and interacts in the world.

MemberValueDescription
BLOCK1Make sprite blockable
TRANSLUCENT2Make sprite transparent (first level)
XFLIP4Flip sprite around X-axis
YFLIP8Flip sprite around Y-axis
WALL16Draw sprite as vertically flat (wall-aligned)
FLOOR32Draw sprite as horizontally flat (floor-aligned)
ONE_SIDE64Make sprite one-sided
YCENTER128Half-submerged (Y-centered)
BLOCK_HITSCAN256Make sprite hittable by hitscan weapons
TRANS_FLIP512Second transparency level (combine with TRANSLUCENT)
DRAW_PRIORITY1024Draw in front of other sprites (high priority)
NOSHADE2048Ignore sector shading
NO_POLYMER_SHADOW8192Do not cast a Polymer shadow
INVISIBLE_SHADOW16384Invisible but still casts Polymer shadow
INVISIBLE32768Completely invisible (skip rendering & events)

EMoveFlags

Flags for movement.

MemberValueDescription
faceplayer1Actor faces the player.
geth2Use horizontal velocity.
getv4Use vertical velocity.
randomangle8Actor will face random direction.
faceplayerslow16Same as faceplayer, but done gradually.
spin32Spin in a clockwise circle.
faceplayersmart64Same as faceplayer, but with a slight "lead" on position.
fleeenemy128Actor faces away from the player.
jumptoplayer257Actor will move vertically and then fall as if jumping.
seekplayer512Actor will try to find the best path to the nearest player.
furthestdir1024Actor faces the furthest distance from the closest player.
dodgebullet4096Actor attempts to avoid all shots directed at him. The actor will not avoid GROWSPARK.

EOperateFlags

Enumeration for Operate function flags.
Determines how the Operate function works by activating a specific element:
doors, activators, master switches, respawns, sectors, or all activators within a sector.
Only one flag should be set at a time.

MemberValueDescription
doors1Activates doors.
activators2Activates activators.
master_switches4Activates master switches.
respawns8Activates respawns.
sectors16Activates sectors.
all_activators_in_a_sector32Activates all activators within a sector.