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 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.
To get started with TypeCON, you can install it globally using npm:
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:
With a local installation, you can run the compiler using yarn tcc
or npm tcc
.
Once TypeCON is installed, you need to set up your project. Navigate to your project's root directory and run the following command:
This command will create the necessary folders, include files, templates, and a basic TypeScript configuration to get you started.
TypeCON provides several command-line options to control the compilation process. Here is a list of all the available commands:
setup
: Creates the project's basic setup including folders, include files, templates and the basic TypeScript configuration-i, --input
: for the file path to be compiled-if, --input_folder
: for the path folder to be compiled (compiles all files inside)-il, --input_list
: for a list of files to be compiled-o, --output
: for the output file name-of, --output_folder
: for the output folder path -lp, --line_print
: to write the TS lines inside the CON code -sp, --symbol_print
: to write the symbols inside the CON code -ss, --stack_size
: to define the stack size -hs, --heap_size
: to define the heap's size-ps, --page_size
: to define the heap page's minimum size -pn, --page_number
: to define the default number of heap pages-hl, --headerless
: Don't insert the header code (init code and states) inside the output CON -h, --header
: Create the header file -np, --no_precompiled
: Don't link pre-compiled modules-l, --link
: Create the header and the init files with the following list of CON files (separated by "")-1f, --one_file
: Compile all the code into one file (must be used with -o)-di, --default_inclusion
: Default inclusion (GAME.CON) -ei, --eduke_init
: Init file is EDUKE.CONFor a full list of commands, you can also use the --help
or -?
flag:
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.
To ensure compatibility with the Build Engine's scripting capabilities, the following limitations apply:
super()
) are not allowed within constructor()
methods.if
statements are prohibited in constructor()
methods.The following examples demonstrate how to use TypeCON to create game logic. You can find these files in the templates
directory of the project.
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:
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:
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 }
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 for file operations (code is optimized)
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 |
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 |
@class for actor declaration. Use this as extension to declare your custom actors.
Property | Type | Description |
---|---|---|
defaultStrength | number | |
defaultPicnum | number | |
picnum | number | The current tile number of this actor |
isEnemy | boolean | Not accessible outside the constructor |
extra | number | The 'health' of this actor |
htExtra | number | How much damage it took |
damage | number | How much damage it took |
htPicnum | number | Which projectile damaged |
weaponHit | number | Which projectile damaged |
playerDist | number | The current distance from the nearest player |
curAction | number | The current action pointer |
curActionFrame | number | The current action frame |
curMove | number | The current move pointer |
vel | number | The current velocity |
ang | number | The current actor's angle |
pos | vec3 | The current position |
curAI | number | The current AI pointer |
pal | number | The current palette used by the actor |
curSector | CSector | The current sector object |
curSectorID | number | The current sector ID |
flags | number | The special flags active for the sprite |
tags | tag | The Lotag and Hitag of the sprite |
Method | Description | Parameters | Returns |
---|---|---|---|
constructor(picnum: constant, isEnemy: boolean, extra: constant, no_labelobj?: boolean, actor_hardcode?: boolean) | You must call this to begin the actor's declaration | picnum: 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 action | action: the IAction object declared for this class | void |
Move(move: IMove | null, flags: number) | Move the actor | move: the IMove object declared for this class flags: the movement flags | void |
StartAI(ai: IAi | null) | Start the AI configuration for this actor | ai: the IAi object declared for this class | void |
CStat(stats?: number) | Set or get the current stat for the actor | stats: The stats to be set or leave blank it to only return the current value | number |
CStatOR(stats: number) | OR the stat value to the actor's stat | stats: The stats to be set | void |
SizeAt(w: number, h: number) | Immediately set the size for this particular actor | w: 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 tick | w: 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 actor | value: Set the counter to this value. Leave blank to just retrieve the current counter value | number |
ActionCount(value?: number) | Set or gets the native action counter for this actor | value: Set the ation counter to this value. Leave blank to just retrieve the current action counter value | number |
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 actor | picnum: 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 projectile | picnum: 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 sound | sound_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 sound | sound_id: the sound ID | void |
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 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 spawn | void |
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 spawn | void |
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 spawn | void |
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 spawn | void |
Pal(color: number) | Changes the current actor's palette reference number to @param color. | color: the palette to change | void |
AddKills(amount: constant) | Add @param amount to the kill counter | amount: how many kills to add | void |
PlayerKick() | Makes the player kick | - | void |
LockPlayer(time: number) | Locks the player movement by @param time amount of time | time: the amount of time to lock the player | void |
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 |
@class for declaring events. Use this as extension.
Method | Description | Parameters | Returns |
---|---|---|---|
constructor(event: TEvents) | Starts the event declaration | event: 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 screen | x: 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 events | sound: the sound ID to be played | void |
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 |
Property | Type | Description |
---|---|---|
pos | vec2 | |
point2 | number | |
blend | number | |
nextWall | number | |
nextSector | number | |
cstat | number | |
picnum | number | |
overpicnum | number | |
shade | number | |
pal | number | |
texRepeat | vec2 | |
texPan | vec2 | |
tags | tag | |
extra | number | |
ang | number | |
wallPoint2 | CWall | |
next | { wall: CWall, sector: CSector } |
Property | Type | Description |
---|---|---|
wallPtr | number | |
wallNum | number | |
ceiling | CSectorBase | |
floor | CSectorBase | |
visibility | number | |
fogPal | number | |
tags | tag | |
extra | number | |
firstWall | CWall | |
walls | CWall[] |
Interface for declaring fonts used in the game
Property | Type | Description |
---|---|---|
tile | number | The starting tile of the font |
xSpace | number | The width of the whitespace character |
yLine | number | the height of an empty line |
xBetween | number | The x distance between characters |
yBetween | number | The y distance between lines |
offset | vec2 | The xy offset |
maxSizeChar | vec2 | The maximum width/height of the alphabet characters' (used for line ending calculations) |
flags | ETextFlags | The font's flags |
Interface representing the TypeCON system framework
Property | Type | Description |
---|---|---|
ra | CON_NATIVE_GAMEVAR<'ra', number> | Accumulator register. Used for all kinds of operations. All results are stored in it. |
rb | CON_NATIVE_GAMEVAR<'rb', number> | Base register. Used for return values and sometimes as a helper in some operations. |
rc | CON_NATIVE_GAMEVAR<'rc', number> | Counter register. Used for loops. |
rd | CON_NATIVE_GAMEVAR<'rd', number> | Data registers. Used in if/binary expressions to hold the right side of the operation. |
rf | CON_NATIVE_GAMEVAR<'rf', number> | Flags register. |
ri | CON_NATIVE_GAMEVAR<'ri', number> | Index register. Holds the current index of the stack/heap memory during operations. |
rsi | CON_NATIVE_GAMEVAR<'rsi', number> | Source Index register. In operations envolving 2 memory pointers, it usually holds the "source". |
rbp | CON_NATIVE_GAMEVAR<'rbp', number> | Base pointer register. Holds the base of the current stack. |
rsp | CON_NATIVE_GAMEVAR<'rsp', number> | Stack pointer register. Holds the current stack value. |
rssp | CON_NATIVE_GAMEVAR<'rssp', number> | String Stack pointer register. Holds the current string stack value. |
rbsp | CON_NATIVE_GAMEVAR<'rbsp', number> | String Base pointer register. Hold the base of the current string stack. |
Method | Description | Parameters | Returns |
---|---|---|---|
GetReference(register: number) | Returns a reference from the register's value | register: The register to get the reference | [] | string |
BufferToIndex(buffer: any[], array: boolean) | Returns the reference from the buffer to ri register | buffer: 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 register | buffer: The buffer reference array: If true, it adds 1 to the ri (first slot is the length) | void |
Interface for the Mighty Foot weapon (weapon 00).
Property | Type | Description |
---|---|---|
flags | CON_NATIVE_GAMEVAR<'WEAPON0_FLAGS', number> | The flags for the weapon (does not control the projectile) |
clip | CON_NATIVE_GAMEVAR<'WEAPON0_CLIP', number> | It's the amount of ammo that can be fired before there is a reloading animation and pause. |
reload | CON_NATIVE_GAMEVAR<'WEAPON0_RELOAD', number> | Defines the number of frames displayed in the weapon's reload sequence |
fireDelay | CON_NATIVE_GAMEVAR<'WEAPON0_FIREDELAY', number> | Defines what frame the weapon will fire its projectile on. |
holdDelay | CON_NATIVE_GAMEVAR<'WEAP0_HOLDDELAY', number> | The number of animation frames between shooting and reloading. |
totalTime | CON_NATIVE_GAMEVAR<'WEAPON0_TOTALTIME', number> | Defines the total number of frames a weapon uses in its firing sequence. |
flashColor | CON_NATIVE_GAMEVAR<'WEAPON0_FLASHCOLOR', number> | The flash color of the weapon. |
shoots | CON_NATIVE_GAMEVAR<'WEAPON0_SHOOTS', number> | This is the tilenum of the projectile. |
shotsPerBurst | CON_NATIVE_GAMEVAR<'WEAPON0_SHOTSPERBURST', number> | Defines the amount of projectiles that will fire when the weapon reaches its firing frame. |
spawn | CON_NATIVE_GAMEVAR<'WEAPON0_SPAWN', number> | This defines what the weapon spawns when the spawnTime is reached. |
spawnTime | CON_NATIVE_GAMEVAR<'WEAPON0_SPAWNTIME', number> | Defines what frame the item specified by spawn will spawn on. |
reloadSound1 | CON_NATIVE_GAMEVAR<'WEAPON0_RELOADSOUND1', number> | If RELOAD_TIMING is enabled, this is the first sound to be played in the weapon's reload sequence. |
reloadSound2 | CON_NATIVE_GAMEVAR<'WEAPON0_RELOADSOUND2', number> | If RELOAD_TIMING is enabled, this is the second sound to be played in the weapon's reload sequence. |
selectSound | CON_NATIVE_GAMEVAR<'WEAPON0_SELECTSOUND', number> | The sound played when a weapon is selected. |
fireSound | CON_NATIVE_GAMEVAR<'WEAPON0_FIRESOUND', number> | Plays the corresponding sound when the weapon counter reaches the number specified by fireDelay. |
initialSound | CON_NATIVE_GAMEVAR<'WEAPON0_INITIALSOUND', number> | Defines the sound that will play when the player starts to fire the weapon. |
sound2Sound | CON_NATIVE_GAMEVAR<'WEAPON0_SOUND2SOUND', number> | This is the weapon's second sound. |
sound2Time | CON_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. |
Interface for the Pistol weapon (weapon 01).
Property | Type | Description |
---|---|---|
flags | CON_NATIVE_GAMEVAR<'WEAPON1_FLAGS', number> | The flags for the weapon (does not control the projectile) |
clip | CON_NATIVE_GAMEVAR<'WEAPON1_CLIP', number> | It's the amount of ammo that can be fired before there is a reloading animation and pause. |
reload | CON_NATIVE_GAMEVAR<'WEAPON1_RELOAD', number> | Defines the number of frames displayed in the weapon's reload sequence |
fireDelay | CON_NATIVE_GAMEVAR<'WEAPON1_FIREDELAY', number> | Defines what frame the weapon will fire its projectile on. |
holdDelay | CON_NATIVE_GAMEVAR<'WEAP1_HOLDDELAY', number> | The number of animation frames between shooting and reloading. |
totalTime | CON_NATIVE_GAMEVAR<'WEAPON1_TOTALTIME', number> | Defines the total number of frames a weapon uses in its firing sequence. |
flashColor | CON_NATIVE_GAMEVAR<'WEAPON1_FLASHCOLOR', number> | The flash color of the weapon. |
shoots | CON_NATIVE_GAMEVAR<'WEAPON1_SHOOTS', number> | This is the tilenum of the projectile. |
shotsPerBurst | CON_NATIVE_GAMEVAR<'WEAP1_SHOTSPERBURST', number> | Defines the amount of projectiles that will fire when the weapon reaches its firing frame. |
spawn | CON_NATIVE_GAMEVAR<'WEAPON1_SPAWN', number> | This defines what the weapon spawns when the spawnTime is reached. |
spawnTime | CON_NATIVE_GAMEVAR<'WEAP1_SPAWNTIME', number> | Defines what frame the item specified by spawn will spawn on. |
reloadSound1 | CON_NATIVE_GAMEVAR<'WEAPON1_RELOADSOUND1', number> | If RELOAD_TIMING is enabled, this is the first sound to be played in the weapon's reload sequence. |
reloadSound2 | CON_NATIVE_GAMEVAR<'WEAP1_RELOADSOUND2', number> | If RELOAD_TIMING is enabled, this is the second sound to be played in the weapon's reload sequence. |
selectSound | CON_NATIVE_GAMEVAR<'WEAP1_SELECTSOUND', number> | The sound played when a weapon is selected. |
fireSound | CON_NATIVE_GAMEVAR<'WEAP1_FIRESOUND', number> | Plays the corresponding sound when the weapon counter reaches the number specified by fireDelay. |
initialSound | CON_NATIVE_GAMEVAR<'WEAP1_INITIALSOUND', number> | Defines the sound that will play when the player starts to fire the weapon. |
sound2Sound | CON_NATIVE_GAMEVAR<'WEAP1_SOUND2SOUND', number> | This is the weapon's second sound. |
sound2Time | CON_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. |
Interface for the Shotgun weapon (weapon 02).
Property | Type | Description |
---|---|---|
flags | CON_NATIVE_GAMEVAR<'WEAPON2_FLAGS', number> | Flags for the weapon (does not control the projectile) |
clip | CON_NATIVE_GAMEVAR<'WEAPON2_CLIP', number> | |
reload | CON_NATIVE_GAMEVAR<'WEAP2_RELOAD', number> | |
fireDelay | CON_NATIVE_GAMEVAR<'WEAP2_FIREDELAY', number> | |
holdDelay | CON_NATIVE_GAMEVAR<'WEAP2_HOLDDELAY', number> | |
totalTime | CON_NATIVE_GAMEVAR<'WEAP2_TOTALTIME', number> | |
flashColor | CON_NATIVE_GAMEVAR<'WEAP2_FLASHCOLOR', number> | |
shoots | CON_NATIVE_GAMEVAR<'WEAP2_SHOOTS', number> | |
shotsPerBurst | CON_NATIVE_GAMEVAR<'WEAP2_SHOTSPERBURST', number> | |
spawn | CON_NATIVE_GAMEVAR<'WEAP2_SPAWN', number> | |
spawnTime | CON_NATIVE_GAMEVAR<'WEAP2_SPAWNTIME', number> | |
reloadSound1 | CON_NATIVE_GAMEVAR<'WEAP2_RELOADSOUND1', number> | |
reloadSound2 | CON_NATIVE_GAMEVAR<'WEAP2_RELOADSOUND2', number> | |
selectSound | CON_NATIVE_GAMEVAR<'WEAP2_SELECTSOUND', number> | |
fireSound | CON_NATIVE_GAMEVAR<'WEAP2_FIRESOUND', number> | |
initialSound | CON_NATIVE_GAMEVAR<'WEAP2_INITIALSOUND', number> | |
sound2Sound | CON_NATIVE_GAMEVAR<'WEAP2_SOUND2SOUND', number> | |
sound2Time | CON_NATIVE_GAMEVAR<'WEAP2_SOUND2TIME', number> |
Interface for the Chaingun weapon (weapon 03).
Property | Type | Description |
---|---|---|
flags | CON_NATIVE_GAMEVAR<'WEAPON3_FLAGS', number> | Flags for the weapon (does not control the projectile) |
clip | CON_NATIVE_GAMEVAR<'WEAP3_CLIP', number> | |
reload | CON_NATIVE_GAMEVAR<'WEAP3_RELOAD', number> | |
fireDelay | CON_NATIVE_GAMEVAR<'WEAP3_FIREDELAY', number> | |
holdDelay | CON_NATIVE_GAMEVAR<'WEAP3_HOLDDELAY', number> | |
totalTime | CON_NATIVE_GAMEVAR<'WEAP3_TOTALTIME', number> | |
flashColor | CON_NATIVE_GAMEVAR<'WEAP3_FLASHCOLOR', number> | |
shoots | CON_NATIVE_GAMEVAR<'WEAP3_SHOOTS', number> | |
shotsPerBurst | CON_NATIVE_GAMEVAR<'WEAP3_SHOTSPERBURST', number> | |
spawn | CON_NATIVE_GAMEVAR<'WEAP3_SPAWN', number> | |
spawnTime | CON_NATIVE_GAMEVAR<'WEAP3_SPAWNTIME', number> | |
reloadSound1 | CON_NATIVE_GAMEVAR<'WEAP3_RELOADSOUND1', number> | |
reloadSound2 | CON_NATIVE_GAMEVAR<'WEAP3_RELOADSOUND2', number> | |
selectSound | CON_NATIVE_GAMEVAR<'WEAP3_SELECTSOUND', number> | |
fireSound | CON_NATIVE_GAMEVAR<'WEAP3_FIRESOUND', number> | |
initialSound | CON_NATIVE_GAMEVAR<'WEAP3_INITIALSOUND', number> | |
sound2Sound | CON_NATIVE_GAMEVAR<'WEAP3_SOUND2SOUND', number> | |
sound2Time | CON_NATIVE_GAMEVAR<'WEAP3_SOUND2TIME', number> |
Interface for the RPG weapon (weapon 04).
Property | Type | Description |
---|---|---|
flags | CON_NATIVE_GAMEVAR<'WEAP4_FLAGS', number> | Flags for the weapon (does not control the projectile) |
clip | CON_NATIVE_GAMEVAR<'WEAP4_CLIP', number> | |
reload | CON_NATIVE_GAMEVAR<'WEAP4_RELOAD', number> | |
fireDelay | CON_NATIVE_GAMEVAR<'WEAP4_FIREDELAY', number> | |
holdDelay | CON_NATIVE_GAMEVAR<'WEAP4_HOLDDELAY', number> | |
totalTime | CON_NATIVE_GAMEVAR<'WEAP4_TOTALTIME', number> | |
flashColor | CON_NATIVE_GAMEVAR<'WEAP4_FLASHCOLOR', number> | |
shoots | CON_NATIVE_GAMEVAR<'WEAP4_SHOOTS', number> | |
shotsPerBurst | CON_NATIVE_GAMEVAR<'WEAP4_SHOTSPERBURST', number> | |
spawn | CON_NATIVE_GAMEVAR<'WEAP4_SPAWN', number> | |
spawnTime | CON_NATIVE_GAMEVAR<'WEAP4_SPAWNTIME', number> | |
reloadSound1 | CON_NATIVE_GAMEVAR<'WEAP4_RELOADSOUND1', number> | |
reloadSound2 | CON_NATIVE_GAMEVAR<'WEAP4_RELOADSOUND2', number> | |
selectSound | CON_NATIVE_GAMEVAR<'WEAP4_SELECTSOUND', number> | |
fireSound | CON_NATIVE_GAMEVAR<'WEAP4_FIRESOUND', number> | |
initialSound | CON_NATIVE_GAMEVAR<'WEAP4_INITIALSOUND', number> | |
sound2Sound | CON_NATIVE_GAMEVAR<'WEAP4_SOUND2SOUND', number> | |
sound2Time | CON_NATIVE_GAMEVAR<'WEAP4_SOUND2TIME', number> |
Interface for the Pipebomb weapon (weapon 05).
Property | Type | Description |
---|---|---|
flags | CON_NATIVE_GAMEVAR<'WEAP5_FLAGS', number> | Flags for the weapon (does not control the projectile) |
clip | CON_NATIVE_GAMEVAR<'WEAP5_CLIP', number> | |
reload | CON_NATIVE_GAMEVAR<'WEAP5_RELOAD', number> | |
fireDelay | CON_NATIVE_GAMEVAR<'WEAP5_FIREDELAY', number> | |
holdDelay | CON_NATIVE_GAMEVAR<'WEAP5_HOLDDELAY', number> | |
totalTime | CON_NATIVE_GAMEVAR<'WEAP5_TOTALTIME', number> | |
flashColor | CON_NATIVE_GAMEVAR<'WEAP5_FLASHCOLOR', number> | |
shoots | CON_NATIVE_GAMEVAR<'WEAP5_SHOOTS', number> | |
shotsPerBurst | CON_NATIVE_GAMEVAR<'WEAP5_SHOTSPERBURST', number> | |
spawn | CON_NATIVE_GAMEVAR<'WEAP5_SPAWN', number> | |
spawnTime | CON_NATIVE_GAMEVAR<'WEAP5_SPAWNTIME', number> | |
reloadSound1 | CON_NATIVE_GAMEVAR<'WEAP5_RELOADSOUND1', number> | |
reloadSound2 | CON_NATIVE_GAMEVAR<'WEAP5_RELOADSOUND2', number> | |
selectSound | CON_NATIVE_GAMEVAR<'WEAP5_SELECTSOUND', number> | |
fireSound | CON_NATIVE_GAMEVAR<'WEAP5_FIRESOUND', number> | |
initialSound | CON_NATIVE_GAMEVAR<'WEAP5_INITIALSOUND', number> | |
sound2Sound | CON_NATIVE_GAMEVAR<'WEAP5_SOUND2SOUND', number> | |
sound2Time | CON_NATIVE_GAMEVAR<'WEAP5_SOUND2TIME', number> |
Interface for the Shrinker weapon (weapon 06).
Property | Type | Description |
---|---|---|
flags | CON_NATIVE_GAMEVAR<'WEAP6_FLAGS', number> | Flags for the weapon (does not control the projectile) |
clip | CON_NATIVE_GAMEVAR<'WEAP6_CLIP', number> | |
reload | CON_NATIVE_GAMEVAR<'WEAP6_RELOAD', number> | |
fireDelay | CON_NATIVE_GAMEVAR<'WEAP6_FIREDELAY', number> | |
holdDelay | CON_NATIVE_GAMEVAR<'WEAP6_HOLDDELAY', number> | |
totalTime | CON_NATIVE_GAMEVAR<'WEAP6_TOTALTIME', number> | |
flashColor | CON_NATIVE_GAMEVAR<'WEAP6_FLASHCOLOR', number> | |
shoots | CON_NATIVE_GAMEVAR<'WEAP6_SHOOTS', number> | |
shotsPerBurst | CON_NATIVE_GAMEVAR<'WEAP6_SHOTSPERBURST', number> | |
spawn | CON_NATIVE_GAMEVAR<'WEAP6_SPAWN', number> | |
spawnTime | CON_NATIVE_GAMEVAR<'WEAP6_SPAWNTIME', number> | |
reloadSound1 | CON_NATIVE_GAMEVAR<'WEAP6_RELOADSOUND1', number> | |
reloadSound2 | CON_NATIVE_GAMEVAR<'WEAP6_RELOADSOUND2', number> | |
selectSound | CON_NATIVE_GAMEVAR<'WEAP6_SELECTSOUND', number> | |
fireSound | CON_NATIVE_GAMEVAR<'WEAP6_FIRESOUND', number> | |
initialSound | CON_NATIVE_GAMEVAR<'WEAP6_INITIALSOUND', number> | |
sound2Sound | CON_NATIVE_GAMEVAR<'WEAP6_SOUND2SOUND', number> | |
sound2Time | CON_NATIVE_GAMEVAR<'WEAP6_SOUND2TIME', number> |
Interface for the Devastator weapon (weapon 07).
Property | Type | Description |
---|---|---|
flags | CON_NATIVE_GAMEVAR<'WEAP7_FLAGS', number> | Flags for the weapon (does not control the projectile) |
clip | CON_NATIVE_GAMEVAR<'WEAP7_CLIP', number> | |
reload | CON_NATIVE_GAMEVAR<'WEAP7_RELOAD', number> | |
fireDelay | CON_NATIVE_GAMEVAR<'WEAP7_FIREDELAY', number> | |
holdDelay | CON_NATIVE_GAMEVAR<'WEAP7_HOLDDELAY', number> | |
totalTime | CON_NATIVE_GAMEVAR<'WEAP7_TOTALTIME', number> | |
flashColor | CON_NATIVE_GAMEVAR<'WEAP7_FLASHCOLOR', number> | |
shoots | CON_NATIVE_GAMEVAR<'WEAP7_SHOOTS', number> | |
shotsPerBurst | CON_NATIVE_GAMEVAR<'WEAP7_SHOTSPERBURST', number> | |
spawn | CON_NATIVE_GAMEVAR<'WEAP7_SPAWN', number> | |
spawnTime | CON_NATIVE_GAMEVAR<'WEAP7_SPAWNTIME', number> | |
reloadSound1 | CON_NATIVE_GAMEVAR<'WEAP7_RELOADSOUND1', number> | |
reloadSound2 | CON_NATIVE_GAMEVAR<'WEAP7_RELOADSOUND2', number> | |
selectSound | CON_NATIVE_GAMEVAR<'WEAP7_SELECTSOUND', number> | |
fireSound | CON_NATIVE_GAMEVAR<'WEAP7_FIRESOUND', number> | |
initialSound | CON_NATIVE_GAMEVAR<'WEAP7_INITIALSOUND', number> | |
sound2Sound | CON_NATIVE_GAMEVAR<'WEAP7_SOUND2SOUND', number> | |
sound2Time | CON_NATIVE_GAMEVAR<'WEAP7_SOUND2TIME', number> |
Interface for the Tripbomb weapon (weapon 08).
Property | Type | Description |
---|---|---|
flags | CON_NATIVE_GAMEVAR<'WEAP8_FLAGS', number> | Flags for the weapon (does not control the projectile) |
clip | CON_NATIVE_GAMEVAR<'WEAP8_CLIP', number> | |
reload | CON_NATIVE_GAMEVAR<'WEAP8_RELOAD', number> | |
fireDelay | CON_NATIVE_GAMEVAR<'WEAP8_FIREDELAY', number> | |
holdDelay | CON_NATIVE_GAMEVAR<'WEAP8_HOLDDELAY', number> | |
totalTime | CON_NATIVE_GAMEVAR<'WEAP8_TOTALTIME', number> | |
flashColor | CON_NATIVE_GAMEVAR<'WEAP8_FLASHCOLOR', number> | |
shoots | CON_NATIVE_GAMEVAR<'WEAP8_SHOOTS', number> | |
shotsPerBurst | CON_NATIVE_GAMEVAR<'WEAP8_SHOTSPERBURST', number> | |
spawn | CON_NATIVE_GAMEVAR<'WEAP8_SPAWN', number> | |
spawnTime | CON_NATIVE_GAMEVAR<'WEAP8_SPAWNTIME', number> | |
reloadSound1 | CON_NATIVE_GAMEVAR<'WEAP8_RELOADSOUND1', number> | |
reloadSound2 | CON_NATIVE_GAMEVAR<'WEAP8_RELOADSOUND2', number> | |
selectSound | CON_NATIVE_GAMEVAR<'WEAP8_SELECTSOUND', number> | |
fireSound | CON_NATIVE_GAMEVAR<'WEAP8_FIRESOUND', number> | |
initialSound | CON_NATIVE_GAMEVAR<'WEAP8_INITIALSOUND', number> | |
sound2Sound | CON_NATIVE_GAMEVAR<'WEAP8_SOUND2SOUND', number> | |
sound2Time | CON_NATIVE_GAMEVAR<'WEAP8_SOUND2TIME', number> |
Interface for the Freezer weapon (weapon 09).
Property | Type | Description |
---|---|---|
flags | CON_NATIVE_GAMEVAR<'WEAP9_FLAGS', number> | Flags for the weapon (does not control the projectile) |
clip | CON_NATIVE_GAMEVAR<'WEAP9_CLIP', number> | |
reload | CON_NATIVE_GAMEVAR<'WEAP9_RELOAD', number> | |
fireDelay | CON_NATIVE_GAMEVAR<'WEAP9_FIREDELAY', number> | |
holdDelay | CON_NATIVE_GAMEVAR<'WEAP9_HOLDDELAY', number> | |
totalTime | CON_NATIVE_GAMEVAR<'WEAP9_TOTALTIME', number> | |
flashColor | CON_NATIVE_GAMEVAR<'WEAP9_FLASHCOLOR', number> | |
shoots | CON_NATIVE_GAMEVAR<'WEAP9_SHOOTS', number> | |
shotsPerBurst | CON_NATIVE_GAMEVAR<'WEAP9_SHOTSPERBURST', number> | |
spawn | CON_NATIVE_GAMEVAR<'WEAP9_SPAWN', number> | |
spawnTime | CON_NATIVE_GAMEVAR<'WEAP9_SPAWNTIME', number> | |
reloadSound1 | CON_NATIVE_GAMEVAR<'WEAP9_RELOADSOUND1', number> | |
reloadSound2 | CON_NATIVE_GAMEVAR<'WEAP9_RELOADSOUND2', number> | |
selectSound | CON_NATIVE_GAMEVAR<'WEAP9_SELECTSOUND', number> | |
fireSound | CON_NATIVE_GAMEVAR<'WEAP9_FIRESOUND', number> | |
initialSound | CON_NATIVE_GAMEVAR<'WEAP9_INITIALSOUND', number> | |
sound2Sound | CON_NATIVE_GAMEVAR<'WEAP9_SOUND2SOUND', number> | |
sound2Time | CON_NATIVE_GAMEVAR<'WEAP9_SOUND2TIME', number> |
Interface for the Hand Remot/Detonator weapon (weapon 10).
Property | Type | Description |
---|---|---|
flags | CON_NATIVE_GAMEVAR<'WEAPON10_FLAGS', number> | Flags for the weapon (does not control the projectile) |
clip | CON_NATIVE_GAMEVAR<'WEAP10_CLIP', number> | |
reload | CON_NATIVE_GAMEVAR<'WEAP10_RELOAD', number> | |
fireDelay | CON_NATIVE_GAMEVAR<'WEAP10_FIREDELAY', number> | |
holdDelay | CON_NATIVE_GAMEVAR<'WEAP10_HOLDDELAY', number> | |
totalTime | CON_NATIVE_GAMEVAR<'WEAP10_TOTALTIME', number> | |
flashColor | CON_NATIVE_GAMEVAR<'WEAP10_FLASHCOLOR', number> | |
shoots | CON_NATIVE_GAMEVAR<'WEAP10_SHOOTS', number> | |
shotsPerBurst | CON_NATIVE_GAMEVAR<'WEAP10_SHOTSPERBURST', number> | |
spawn | CON_NATIVE_GAMEVAR<'WEAP10_SPAWN', number> | |
spawnTime | CON_NATIVE_GAMEVAR<'WEAP10_SPAWNTIME', number> | |
reloadSound1 | CON_NATIVE_GAMEVAR<'WEAP10_RELOADSOUND1', number> | |
reloadSound2 | CON_NATIVE_GAMEVAR<'WEAP10_RELOADSOUND2', number> | |
selectSound | CON_NATIVE_GAMEVAR<'WEAP10_SELECTSOUND', number> | |
fireSound | CON_NATIVE_GAMEVAR<'WEAP10_FIRESOUND', number> | |
initialSound | CON_NATIVE_GAMEVAR<'WEAP10_INITIALSOUND', number> | |
sound2Sound | CON_NATIVE_GAMEVAR<'WEAP10_SOUND2SOUND', number> | |
sound2Time | CON_NATIVE_GAMEVAR<'WEAP10_SOUND2TIME', number> |
Member | Value | Description |
---|---|---|
binary | 0 | - |
text | 1 | - |
Bit-flags accepted by the Build-engine `rotatesprite*` family of functions.
Combine multiple flags with the bitwise OR (`|`) operator.
Member | Value | Description |
---|---|---|
TRANS1 | 1 | Translucency level 1 (≈ 66 % opacity). |
AUTO | 2 | Enable 320 × 200 coordinate scaling (recommended for portability). |
YFLIP | 4 | Flip the sprite vertically; combine with angle = 1024 for X-flip. |
NOCLIP | 8 | Make sprite immune to screen-size changes (e.g. status bar). |
TOPLEFT | 16 | Treat the sprite’s top-left as its origin; ignore tile offsets. |
TRANS2 | 32 | Translucency level 2 (≈ 33 % opacity). Requires `TRANS1`. |
NOMASK | 64 | Disable masking (and translucency). |
PERM | 128 | **Deprecated** “permanent” tile flag. |
ALIGN_L | 256 | Align sprite to the left edge on widescreen displays. |
ALIGN_R | 512 | Align sprite to the right edge on widescreen displays. |
STRETCH | 1024 | Stretch sprite to full resolution (pre-widescreen behaviour). |
ROTATESPRITE_FULL16 | 2048 | Interpret coordinates as 16-bit-shifted “full-precision” values. |
LERP | 4096 | Interpolate position between calls (per `guniqhudid`). |
FORCELERP | 8192 | Force interpolation even when the tile number changes. |
Bit-flags that control how EDuke32 renders on-screen strings.
Combine multiple flags with the bitwise OR (`|`) operator to build a render style.
Member | Value | Description |
---|---|---|
XRIGHT | 1 | Right-align text on the x axis. |
XCENTER | 2 | Center-align text on the x axis. |
YBOTTOM | 4 | Bottom-align text on the y axis. |
YCENTER | 8 | Center-align text on the y axis. |
INTERNALSPACE | 16 | Engine chooses ` |
TILESPACE | 32 | ` |
INTERNALLINE | 64 | Engine chooses ` |
TILELINE | 128 | ` |
XOFFSETZERO | 256 | Treat ` |
XJUSTIFY | 512 | Justify text horizontally (compatible with `XRIGHT` and `XCENTER`). |
YOFFSETZERO | 1024 | Treat ` |
YJUSTIFY | 2048 | Justify text vertically (compatible with `YBOTTOM` and `YCENTER`). |
RESERVED_4096 | 4096 | *Reserved – do not use.* |
UPPERCASE | 8192 | Force all letters to uppercase. |
INVERTCASE | 16384 | Swap the case of each letter (combine with `UPPERCASE` for lowercase). |
IGNOREESCAPE | 32768 | Ignore palette escape sequences (`#`, `##`). |
LITERALESCAPE | 65536 | Render palette escape sequences literally. |
RESERVED_131072 | 131072 | *Reserved – do not use.* |
CONSTWIDTHNUMS | 262144 | Render numerals with constant width. |
DIGITALNUMBER | 524288 | Tile order starts at `'0'`; for digital number tiles. |
BIGALPHANUM | 1048576 | Use the red main-menu font tile order. |
GRAYFONT | 2097152 | Use the gray-font tile order. |
NOLOCALE | 4194304 | Skip localization translation. |
VARHEIGHT | 8388608 | Shift by half a tile when `RS_TOPLEFT` is not set. |
CENTERCONSTWIDTH | 16777216 | Center glyphs and respect ` |
**ESpriteFlags** – per-sprite runtime flags (the “SFLAG_” bits from EDuke 32).
Member | Value | Description |
---|---|---|
SHADOW | 1 | Generate a shadow (`spriteshadow`). |
NVG | 2 | Switch to palette 6 when night-vision goggles are active (`spritenvg`). |
NOSHADE | 4 | Ignore sector shade (`spritenoshade`). |
PROJECTILE | 8 | Was created with `defineprojectile`. |
DECAL | 16 | Prevents teleporting; not entered into the decal-deletion queue. |
BADGUY | 32 | Marks the sprite as an enemy (`useractor`). |
NOPAL | 64 | Immune to floor palette (`spritenopal`). |
NOEVENTS | 128 | Excluded from `EVENT_GAME` and `EVENT_PREGAME`. |
NOLIGHT | 256 | Suppress hard-coded Polymer lights. |
USEACTIVATOR | 512 | Reserved flag used by `useractor` (`activate`). |
NULL | 1024 | “Null sprite” placeholder in multiplayer (internal). |
NOCLIP | 2048 | Calls `clipmove()` with a 0 clipmask (no sprite collisions) – useful for particles. |
NOFLOORSHADOW | 4096 | Don’t draw a floor shadow. |
SMOOTHMOVE | 8192 | Enable client-side interpolation (smooth movement). |
NOTELEPORT | 16384 | Prevent teleportation. |
BADGUYSTAYPUT | 32768 | Enemy will not leave its original sector. |
CACHE | 65536 | Engine-side cache hint. |
ROTFIXED | 131072 | Rotation-fixed around a pivot to avoid round-off drift. |
HARDCODED_BADGUY | 262144 | Hard-coded enemy marker (internal). |
DIDNOSE7WATER | 524288 | Temporary internal flag. |
NODAMAGEPUSH | 1048576 | Actor isn’t pushed back by damage. |
NOWATERDIP | 2097152 | Actor won’t dip into water sectors (lotag 1). |
HURTSPAWNBLOOD | 4194304 | Spawn blood when hurt (as hard-coded enemies do). |
GREENSLIMEFOOD | 8388608 | Can be eaten by **GREENSLIME** (Protozoid Slimer). |
REALCLIPDIST | 16777216 | Always use its explicit `clipdist`. |
WAKEUPBADGUYS | 33554432 | Wakes up nearby enemies when activated. |
DAMAGEEVENT | 67108864 | Fires `EVENT_(POST)DAMAGESPRITE` when damaged. |
NOWATERSECTOR | 134217728 | Cannot move into water sectors. |
QUEUEDFORDELETE | 268435456 | Marked for deletion by the engine. |
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.
Member | Value | Description |
---|---|---|
standing | 1 | The player is standing. |
walking | 2 | The player is walking. |
running | 4 | The player is running. |
ducking | 8 | The player is ducking. |
falling | 16 | The player is falling. |
jumping | 32 | The player is jumping. |
higher | 64 | The player is in a higher state (e.g., during a jump). |
walkingback | 128 | The player is walking backwards. |
runningback | 256 | The player is running backwards. |
kicking | 512 | The player is kicking. |
shrunk | 1024 | The player is shrunk. |
jetpack | 2048 | The player is using a jetpack. |
onsteroids | 4096 | The player is on steroids. |
onground | 8192 | The player is on the ground. |
alive | 16384 | The player is alive. |
dead | 32768 | The player is dead. |
facing | 65536 | The player is facing (direction indicated). |
SpriteCStat flags control how a sprite is rendered and interacts in the world.
Member | Value | Description |
---|---|---|
BLOCK | 1 | Make sprite blockable |
TRANSLUCENT | 2 | Make sprite transparent (first level) |
XFLIP | 4 | Flip sprite around X-axis |
YFLIP | 8 | Flip sprite around Y-axis |
WALL | 16 | Draw sprite as vertically flat (wall-aligned) |
FLOOR | 32 | Draw sprite as horizontally flat (floor-aligned) |
ONE_SIDE | 64 | Make sprite one-sided |
YCENTER | 128 | Half-submerged (Y-centered) |
BLOCK_HITSCAN | 256 | Make sprite hittable by hitscan weapons |
TRANS_FLIP | 512 | Second transparency level (combine with TRANSLUCENT) |
DRAW_PRIORITY | 1024 | Draw in front of other sprites (high priority) |
NOSHADE | 2048 | Ignore sector shading |
NO_POLYMER_SHADOW | 8192 | Do not cast a Polymer shadow |
INVISIBLE_SHADOW | 16384 | Invisible but still casts Polymer shadow |
INVISIBLE | 32768 | Completely invisible (skip rendering & events) |
Flags for movement.
Member | Value | Description |
---|---|---|
faceplayer | 1 | Actor faces the player. |
geth | 2 | Use horizontal velocity. |
getv | 4 | Use vertical velocity. |
randomangle | 8 | Actor will face random direction. |
faceplayerslow | 16 | Same as faceplayer, but done gradually. |
spin | 32 | Spin in a clockwise circle. |
faceplayersmart | 64 | Same as faceplayer, but with a slight "lead" on position. |
fleeenemy | 128 | Actor faces away from the player. |
jumptoplayer | 257 | Actor will move vertically and then fall as if jumping. |
seekplayer | 512 | Actor will try to find the best path to the nearest player. |
furthestdir | 1024 | Actor faces the furthest distance from the closest player. |
dodgebullet | 4096 | Actor attempts to avoid all shots directed at him. The actor will not avoid GROWSPARK. |
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.
Member | Value | Description |
---|---|---|
doors | 1 | Activates doors. |
activators | 2 | Activates activators. |
master_switches | 4 | Activates master switches. |
respawns | 8 | Activates respawns. |
sectors | 16 | Activates sectors. |
all_activators_in_a_sector | 32 | Activates all activators within a sector. |