Enhanced Duke Nukem3D - CON guide   v1-01-2000  Release 1 ©  RTCM Cyborg

Introduction | Basics | Variables and Operators | Events | Weapons
Sector, Sprite, Wall and Player Structures | Miscellaneous Commands | Index

Introduction

Official EDuke Site

This guide is a bit outdated an inaccurate in places and is being totally re-rewritten. I leave this guide up because people have found it useful in the past. Please see eduke-con-guide2 for the work in progress of the rewrite.

Basics

Basics

First things first, all the old stuff from Duke Nukem Atomic has pretty much remained intact (although the properties of some primitives may change later). Thus, it would be a pretty good idea to know about the Duke Nukem Atomic CONs before you get started with EDuke. The article I'm writing on standard CON effects will not cover this: that's an article for experienced people who are looking to spice up their CONs. No, what you want is a CON FAQ written for beginners. You might find the one at MapFAQ Central a good start, I learnt all the commands pretty quickly using it.
Once you've absorbed the basics of the CON language and tried out some of the stuff in my other article you are ready to start here.

New stuff

The new stuff added so far:
* CON additions from WWII GI, including Events, Weapon Changes, Weapon Settings.
* Global variables and mathematical operators
* Texture detection for floors (not quite walls yet)
* System Variables
* Access to the tags
* Access to Sector, sprite, wall and player structures

There are also a few other miscellaneous things like being able to change the MIDI track and such.

Contents


Contents

Variables and operators
Usage
Syntax
Eh?
Examples
Bitstrip
Sector height
Appendix
Gamevar Flags
Operators
Addendum

Events
Usage
Syntax
Eh?
Examples
Event defines
Change load tile
Appendix
Events

Weapons
Usage
Syntax
Eh?
Examples
Change pistol clip amount
Appendix
Weapon properties
Addendum

Sector, sprite, wall and player structures
Usage
Syntax
Eh?
Examples
Raise floor
Tricolour
Appendix
Actor member properties
Sector member properties
Wall member properties
Player member properties
Addendum

Miscellaneous commands
Audio commands
Texture commands
Tag commands
Actor/player commands
Miscellaneous commands

Index
 

Variables and Operators


^  Variables and operators

Useage

Variables and operators open up a whole load of new possibilities for Eduke. With previous versions of Duke Nukem keeping track of variables for things like the score in a CTF game required the use of inventory items or other methods. Now we can simply define a variable for the score and do any operation with it we wish, quickly and easily.
Variables are numbers which vary. They are assigned tags so that you can keep track of their values. Operators are devices which alter the numbers stored by a variable. The end result of using variables and operators is to perform a mathematical function of some sort. How complex or how simple that is depends entirely on the programmer.

^  Syntax

gamevar <name> <value> <flag>
operatorvar <var1> <value>
operatorvarvar <var1> <var2>

^  Eh?

Gamevar tells Eduke to set up a new variable with a name and value you give it. The flag value tells it how to use the variable. It can either be a global variable, i.e. used everywhere, per-player, for multiplayer values etc, or per actor, for individual enemy settings etc...
Performing an operation either occurs with a variable and a value or another variable. They all take the form of the operator's name then var for a variable and number operation or varvar for variable and variable operation. See the appendix for information on these operators.

^  Examples

Here is the code to perform a 'bitstrip'. A bitstrip is a way of obtaining the values of the individual bits of a variable which is being used as a flag. That is to say, the value of the flag has no meaning in its decimal form, only the binary form gives us useful information. You'll need this code later on.

Outside the actor code...

// Bitstrip - by Cyborg

gamevar BIT 0 0 // This variable is used to check the bits that are set
gamevar FLAGVAR 0 0 // The variable stores the value of the flags you are checking

In the actor code...

getactor[THISACTOR].cstat FLAGVAR // Get the cstat flag for this actor
setvar BIT 1 // Set the first bit of the variable BIT
andvarvar BIT FLAGVAR // Check to see if bit 1 is set in FLAGVAR too
ifvare BIT 1 { ...rest of code, you know that bit one is set } else { ...do something else or... }
setvar BIT 2 // Set the second bit of the variable BIT
andvarvar BIT FLAGVAR // Check to see if bit 2 is set in FLAGVAR too
ifvare BIT 2 { ...bit 2 is set, do something } else { ...it's not set... }
setvar BIT 4 // Ser the third bit of the variable BIT
andvarvar BIT FLAGVAR // Check to see if bit 3 is set in FLAGVAR too

and so on... using values of 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768 to check all the bits of a 16 bit variable. You will not need to use all these values for cstat however, not all the bits contain usefull informaiton.
The code above works by performing an AND operator on the variable BIT that stores the value you want to check for. The AND function works by checking each of the bits in both variables and the result returned will only have the bits that are set in both. In the first line the BIT variable has bit 1 set by the decimal number 1. If the FLAGVAR variable also has bit 1 set then on performing an AND operation the value returned for BIT will be the same as it was before, otherwise it will be zero.

// Sector height - By Cyborg

gamevar CEILINGZ 0 2 // This is used to store the ceiling height
gamevar FLOORZ 0 2 // This will store the floor height
In the actor code...
getsector[THISACTOR].floorz FLOORZ // Get the floor height in FLOORZ
getsector[THISACTOR].ceilingz CEILINGZ // Get the ceiling height in CEILINGZ
mulvar CEILINGZ -1
addvarvar FLOORZ CEILINGZ // This will take the value of the ceilingz away from the floorz and store the result in the variable floorz. As the ceilingz is always less than the floorz this will produce a positive result that is the relative height of the sector.

^  Appendix

Gamevar flags

0 - Global variable
1 - Perplayer variable
2 - Peractor variable

Operators

Note that the variable that is altered is always the first one written. The second variable for varvar operations is never altered. The argument is either a variable or a value.
set - set the value of the variable with the argument
add - add the value of the variable with the argument
if...e - returns true if the argument is equal
if...l - returns true if the variable is less than the argument
if...g - returns true if the variable is greater than the argument
mul - multiplies the value of the variable with the argument
div - divides the value of the variable with the argument
mod - gives the remainder of a division of the variable with the argument
and - gives the result of an AND function of the variable with the argument. An AND function checks the bits of each of the two values being compared and the bits in the result are set only if they were set in both of the values being operated on.
or - gives the result of an OR function of the variable with the argument. An OR function checks the bits of each of the two values being compared and the bits in the result are set if they were set in either of the values being operated on.
rand - gives a random number from 0 to the argument. Does not have a varvar yet, only numbers are valid agreements.

^ Addendum

Note on System Variables:
System variables are variables which you can alter like other variables above but are not defined by gamevar. They are used internally for several settings. The easiest way to explain is to tell you what they are and what they do.

RESPAWN_MONSTERS, RESPAWN_ITEMS, RESPAWN_INVENTORY, MONSTERS_OFF, COOP, MARKER and FFIRE are all variables associated with multiplay. They are the respawn times for monsters, items and inventory, monsters on or off, co-op play or not, respawn markers on or off and friendly fire on or off. You can change these dynamically in game. It's hard to see how some of them may be used but there you are...
LEVEL and VOLUME refer to the current map you are playing. They cannot be altered, only read.
TRIPBOMB_CONTROL changes the action of the tripbomb using 1 for a Trip wire (default), 2 for a timer and 3 for both (it's another flag system).

Events

^ Events

^ Usage

Events are, well, events that happen in the game. Just read the stuff below to get an idea of what to use them for.

^ Syntax

onevent EVENT_NAME
{ ...do something... }
endevent

^ Eh?

Basically if the event with EVENT_NAME occurs the code in the curly brackets is executed. Many events have system variables associated with them that can alter their effects, maybe disable an effect or change its use. Look in the appendix for the full list.

^ Examples

Before you do anything else, cut and paste this into your DEFS.CON

^  // Event value defines - By Cyborg

define EVENT_INIT 0
define EVENT_ENTERLEVEL 1
define EVENT_RESETWEAPONS 2
define EVENT_RESETINVENTORY 3
define EVENT_HOLSTER 4
define EVENT_LOOKLEFT 5
define EVENT_LOOKRIGHT 6
define EVENT_SOARUP 7
define EVENT_SOARDOWN 8
define EVENT_CROUCH 9
define EVENT_JUMP 10
define EVENT_RETURNTOCENTER 11
define EVENT_LOOKUP 12
define EVENT_LOOKDOWN 13
define EVENT_AIMUP 14
define EVENT_AIMDOWN 15
define EVENT_FIRE 16
define EVENT_CHANGEWEAPON 17
define EVENT_GETSHOTRANGE 18
define EVENT_GETAUTOAIMANGLE 19
define EVENT_GETLOADTILE 20
define EVENT_CHEATGETSTEROIDS 21
define EVENT_CHEATGETHEAT 22
define EVENT_CHEATGETBOOT 23
define EVENT_CHEATGETSHIELD 24
define EVENT_CHEATGETSCUBA 25
define EVENT_CHEATGETHOLODUKE 26
define EVENT_CHEATGETJETPACK 27
define EVENT_CHEATGETFIRSTAID 28
define EVENT_QUICKKICK 29
define EVENT_INVENTORY 30
define EVENT_USENIGHTVISION 31
define EVENT_USESTEROIDS 32
define EVENT_INVENTORYLEFT 33
define EVENT_INVENTORYRIGHT 34
define EVENT_HOLODUKEON 35
define EVENT_HOLODUKEOFF 36
define EVENT_USEMEDKIT 37
define EVENT_USEJETPACK 38
define EVENT_TURNAROUND 39

Don't like using the current load tile?

^ // Change load tile - By Cyborg

onevent EVENT_GETLOADTILE // The entry tile for a level
setvar RETURN 1 // The entry tile will be set to tile 1
endevent // That's all folks...

^ Appendix

^ Events

EVENT_INIT - called just when the game is initiated, only called once.
EVENT_ENTERLEVEL - called upon entering a level. The system variables LEVEL and VOLUME return the map being used.
EVENT_RESETWEAPONS - called when the player's weapons are reset when they enter a level or die.
EVENT_RESETINVENTORY - similar to RESETWEAPONS but for inventory instead.
EVENT_HOLSTER - the player has pressed the key for holster as defined in the setup file. Set the system variable RETURN to zero to allow default processing.
EVENT_LOOKLEFT - similar to HOLSTER but the player has pressed the look left key.
EVENT_LOOKRIGHT - similar to HOLSTER but the player has pressed the look right key.
EVENT_SOARUP - similar to HOLSTER but the player has pressed the jump key whilst using the jetpack.
EVENT_SOARDOWN - similar to HOLSTER but the player has pressed the crouch key whilst using the jetpack.
EVENT_CROUCH - similar to HOLSTER but the player has pressed the crouch key.
EVENT_JUMP - similar to HOLSTER but the player has pressed the jump key.
EVENT_RETURNTOCENTER - similar to HOLSTER but the player has pressed the center view key.
EVENT_LOOKUP - similar to HOLSTER but the player has pressed the look up key.
EVENT_LOOKDOWN - similar to HOLSTER but the player has pressed the look down key.
EVENT_AIMUP - similar to HOLSTER but the player has pressed the aim up key.
EVENT_AIMDOWN - similar to HOLSTER but the player has pressed the aim down key.
EVENT_FIRE - called when the player has pressed the fire key. The system variable WEAPON gives the weapon ID of the weapon being fired and the system variable WORKSLIKE is the weapon's works like setting. See the Weapons section. Set RETURN to zero to allow default processing.
EVENT_CHANGEWEAPON - called when the player is changing their weapon. The system variables WEAPON and WORKSLIKE give the same results as for the event FIRE. A value -1 means no weapon and there is no system variable RETURN.
EVENT_GETSHOTRANGE - called when the player is shooting. Again the system variables WEAPON and WORKSLIKE act the same as for the FIRE event. The system variables ANGRANGE and ZRANGE alter the spread of fire using polar co-ordinates. That is an angle and a distance from the center of the shot. A ZRANGE of 0 would always produce a shot on target. The numbers must be in powers of 2 however.
EVENT_GETAUTOAIMANGLE - called when weapon autoaim is being used. The system variable AUTOAIMANGLE sets the aim tracking, 0 would disable it, 48 is the default.
EVENT_GETLOADTILE - the tile to be used as the loading background. The value is set in the system variable RETURN.
EVENT_CHEATGETSTEROIDS - the player has used a cheat to get steroids. Set RETURN to the amount of steroids to give.
EVENT_CHEATGETHEAT - the player has used a cheat to get nightvision. Set RETURN to the amount of nightvision to give.
EVENT_CHEATGETBOOT - the player has used a cheat to get boots. Set RETURN to the amount of boots to give.
EVENT_CHEATGETSHEILD - the player has used a cheat to get armour. Set RETURN to the amount of armour to give.
EVENT_CHEATGETSCUBA - the player has used a cheat to get SCUBA gear. Set RETURN to the amount of SCUBA gear to give.

Weapons

^ Weapons

^ Useage

The weapon controls for Eduke have been vastly improved and gives a lot more freedom over what you can do. I'm sure you don't need me to give you ideas about new weapons...

^ Syntax

gamevar WEAPONx_PROPERTY <value> 1

^ Eh?

Set the weapon property for weapon x with the value, x will be in the range 0-11, valid values are variable. See the appendix for the list of properties possible.

^ Examples

How many times has it been asked to change the pistol clip amount? Well now it's simpleas:

^ // Set pistol clip amount

gamevar WEAPON1_CLIP 30 0

^ Appendix

^ Properties

SHOOTS - what the weapon shoots, i.e., what tile number.
FIREDELAY - the number of animation frames before a shot actually takes place.
HOLDDELAY - the number of animation frames between shooting and reloading.
TOTALTIME - delay after firing before the weapon can be refired.
SPAWN - item to spawn, like bullet shells. If zero nothing is spawned.
SPAWNTIME - the number of frames before the item is spawned.
CLIP - the amount of ammo in the weapon's clip. 0 means there is no clip.
SHOTSPERBURST - number of shots per press of the fire button.
WORKSLIKE - how the weapon works, e.g. 9 would mean the weapon works like a trip bomb.
INITIALSOUND - the sound made initially. 0 means nothing is sounded.
FIRESOUND - sound made on the firing frame. 0 means nothing is sounded.
SOUND2TIME - as used in the shotgun for reloading sound. This is the time before it is heard.
SOUND2SOUND - sound made when SOUND2TIME is reached. 0 means nothing is sounded.
FLAGS - controls weapon operation using a flag system. From the list below add up all the values of the flags you want set to get the value to set FLAGS to.
1 - 'holstering' clears the current clip and gives you a fresh one.
2 - the weapon 'glows', like the shrinker and expander.
4 - automatic fire.
8 - during 'hold time' fire every frame.
16 - during 'hold time' fire every third frame.
32 - restart for automatic is 'randomized' by RND 3.
64 - uses ammo for each shot.
128 - weapon is the bomb trigger for the pipebomb.
256 - weapon use does not cause user to become 'visible'.
512 - weapon throws the shot item, like the pipebomb.
1024 - check weapon availability at 'reload' time.
2048 - player stops jumping.

^ Addendum

Most weapons work exactly the same. The pipebomb and tripbomb being the major exceptions. The weapon display for the moment is still the same so the tile numbers and the way the tiles are used is still the same. Certain combinations of settings may cause the program to crash. The weapon system currently uses 'worklike' to control how the weapon works so there is not a major change from the old weapon system there. Not all settings are supported by all weapon 'modes'. For example, SOUND2TIME is only supported by the shotgun.

Sector, Sprite, Wall and Player Structures

^ Sector, sprite, wall and player structures

^ Useage

With these commands you can alter a whole plethora of properties related to actors, walls, the player and sectors. I can't possibly begin to list what can be done, instead I will write some example code for you to try with some of the ideas I have come up with. When the first version of Eduke is released I will have a level pack available to show off these CONs.

^ Syntax

getthing[<var>].member <var2> setthing[<var>].member <var2>

^ Eh?

Get/set the property member for the thing with number var and place its value in var2. Note that many of the possible .members already have CON control, whereas a few certainly don't.

^ Examples

This example creates an actor for the first tile which will increase the floor height of the sector with number 0 by one every game cycle.

^ // Raise floor - By Cyborg gamevar SECTOR 0 2 // Create a per actor variable called SECTOR (first value is amount to set second is a flag to set the variable as a per actor variable.)
gamevar PROPERTY 0 2 // Create a per actor variable called PROPERTY

useractor notenemy 0 0 // Create the useractor
getsector[SECTOR].floorz PROPERTY // Get the floor height of the sector with number set in SECTOR and place the value in PROPERTY
addvar PROPERTY 1 // Increase the value of PROPERTY by 1, experiment with this bit to get different effects for the sectors rate of rise. A negative fall will make it fall, multiplying the value causes an exponential increase.
setsector[SECTOR].floorz PROPERTY // Set the floor height of the sector with number set in SECTOR with PROPERTY
enda

Why cycle through only two colours?

^ // Tricolour - By cyborg gamevar SECTOR 0 2
gamevar PAL 1 2
define TIME 30
useractor notenemy 0 0
setsector[THISACTOR].ceilingpal PAL
setsector[THISACTOR].floorpal PAL
ifcount TIME { addvar PAL 1 } // Set the speed of colour change to TIME
ifvarg PAL 8 { setvar PAL 1 } // If the palette is green set back to blue
ifvarg PAL 2 { setvar PAL 8 } // Palette goes from blue-red-green
enda

More examples to come as I think of them... possible ones to thing about include Doom style falling pillars that drop underwater...

^ Appendix

^ getactor/setactor .member values.

x - the x position of the actor
y - the y position of the actor
z - the z position of the actor
cstat - the properties of the actor, the same for the cstat CON command.
picnum - the actor's texture
shade - the shade of the actor
pal - the palette of the actor
clipdist - the clipping distance of the actor
filler - un-used bytes used to pad the next member variable out to an even alignment - Matteus.
xrepeat - the x size of the actor
yrepeat - the y size of the actor
xoffset - the x orientation of the actor texture
yoffset - the y orientation of the actor texture
sectnum - the number of the sector the actor is in
statnum - internal list that the actor is on (active, inactive, etc). - Matteus
ang - the direction the sprite faces
owner - 'owner' for actor is used to determine who shot something. This is used to give proper credit when a pipebomb blows somebody up, for instance. - Matteus.
xvel - the x velocity of the actor
yvel - the y velocity of the actor
zvel - the z velocity of the actor
lotag - the actor's lotag
hitag - the actor's hitag
extra - extra is used for actors to point to the offset in the compiled code for the start of the 'actor' or 'useractor'. - Matteus.

^ getsector/setsector .member values.

wallptr - the number for the first wall, i.e. the one used for slopes
wallnum - the number of walls in the sector
ceilingz - the height of the ceiling
floorz - the height of the floor
ceilingstat - miscellaneous information on the sector see addendum after this section
floorstat - miscellaneous information on the sector see addendum after this section
ceilingpicnum - the texture for the ceiling
ceilingheinum - the slope of the ceiling
ceilingshade - the shade for the ceiling
ceilingpal - the pallete for the ceiling
ceilingxpanning - the x panning for the ceiling texture
ceilingypanning - the y panning for the ceiling texture
floorpicnum - the texture for the floor
floorheinum - the slope for the floor
floorshade - the shade for the floor
floorpal - the pallete for the floor
floorxpanning - the x panning for the floor texture
floorypanning - the y panning for the floor texture
visibility - the sector visibility
filler - un-used bytes used to pad the next member variable out to an even alignment - Matteus.
lotag - the sector lotag
hitag - the sector hitag
extra - something Silverman left open to the game programmer, according to TerminX

^ getwall/setwall .member values.

x - the x co-ord of the first point of the wall
y - the y co-orf of the first point of the wall
point2 - the wall number that gives the second point's co-ords in it's x and y members
nextwall - for double sided walls, the wall number assigned to the other side, else -1
nextsector - for double sided walls, the sector number assigned to the other side, else -1
cstat - the propeties for the wall, as with the cstat for sprites. Note that some have no effect unless the wall is a red line wall.
picnum - the texture used for the normal wall
overpicnum - the texture used for the top wall
shade - the wall shade
pal - the wall palette
xrepeat - the x size of the texture
yrepeat - the y size of the texture
xpanning - the x panning of the texture
ypanning - the y panning of the texture
lotag - the wall lotag
hitag - the wall hitag
extra - something Silverman left open to the game programmer, according to TerminX

^ getplayer/setplayer .member values.

i - this is the player's sprite ID.
inven_icon - returns the value of the current icon for the inventory. 0 for no graphic.
invdisptime - counter for displaying inventory icon when pressing inventory left or right keys. It is set to 52.
shield_amount - this value stores the armor amount.
steroids_amount - this value stores the steroids amount.
jetpack_amount - this value stores the jetpack amount.
scuba_amount - this value stores the SCUBA gear amount.
airleft - player's breath amount. Used when the player does not have scuba equipment and is underwater. Is set to 390 initially. When it reaches zero health is taken and extra_extra8 is incremented by 32.
heat_amount - this value stores the nightvision amount.
holoduke_amount - this value stores the holoduke amount.
firstaid_amount - inventory amount of med kit.
boot_amount - boot item amount.
holoduke_on - returns a value of 2 if the holoduke is on, else it is -1. Not a good idea to set it.
scuba_on - 1 if the scuba gear is being used, set to zero if not in water or if scuba_amount is zero. Not a good idea to set probably.
jetpack_on - works a bit differently, value changes when it is activated and then returns to zero. The value seems to change from 0 to 2 to 8 when activating the jetpack.
heat_on - 1 if it's on.
hbomb_on - 1 if a hbomb is thrown and detonator is ready. If the weapon is set to time detonate (no remote) this value remains 1.
over_shoulder_on - view mode, 1 means it's on, 0 means it's not.
look_ang - the angle that you are looking, not facing, i.e. when you use the lookleft or lookright keys.
ang - the angle that you are facing.
oang - the last angle you were facing. Used for interpolation of frames. Don't alter.
actors_killed - number of monsters you have killed.
max_actors_killed - maximum number of monsters to kill.
secret_rooms - number of secrets you have found. Now we can set secrets to things other than rooms by adding one to this value.
max_secret_rooms - maximum number of secrets to find.
player_par - the time the player has been in the level as displayed on the end level screen.
holster_weapon - 1 if holstered. Setting it to one has the same effect as pressing the holster key except the fact that the animation is not executed and the gun still appears to be draw.
curr_weapon - the value of the current weapon being used.
last_weapon - the value of last weapon used. Used if you switch to a weapon with no ammo, it will switch back to this weapon. Is set to -1 if there was no last weapon or if weapon change was successful.
rapid_fire_hold - 0 unless you're holding fire whilst holding a pipebomb. Nothing seems to happen when you set it.
transporter_hold - similiar to the lockplayer command, counter for teleporter hold.
weapon_sway - value set refers to a position in the weapon's sway pattern.
bobcounter - stores the value of weapon_sway when the sway ends and returns its value when the swaying starts again so that the sway will continue at its last position.
footprintpal - pallette used for current footprints.
footprintshade - set the shade of your footprints.
footprintcount - counter for the number of foot prints you make.
crack_time - counter for knuckle cracking.
last_pissed_time - counter for the time since you last used a toilet. Used to determine whether you get health or not when you use another.
newowner - the actor ID of the view cam being used. If none is being used the value is -1. Setting it will force the view to the view cam with the appropriate actor ID. If forced an attempt to move or press esc will force the camview to the player's view. Thus if forced I would advise detecting an attempt to break the forced view and allow a return to normal viewing.
quick_kick - appears to store the information on whether a quick kick is being executed or not.
cheat_phase - 0 is none is happening, -1 when you press M, 1 when you press S and the rest of the cheat code and then back to 0. M and S are the current cheat keys. They were DN in other Duke Nukem versions.
somethingonplayer - 0 when a slimer is on you, -1 when not.
on_ground - 1 if you are on ground, 0 if you are not.
on_crane - -1 if you're not on a crane, 1 if you are: setting the value to 1 will lock the player like they are on a crane.
jumping_toggle - 1 if you are jumping, 0 if you are not.
jumping_counter - counts the lenght of time the player has been jumping.
cursectnum - the sector the player is in.
spritebridge - gives 1 if you are on a floor flattened sprite.
zoom - the map view zoom, starts at 768, minimum is 48, maximum is 2048.
exitx - set to the wall x aof the sector that contains a lotag of -1(65535). Is not used by the code however.
exity - set to the wall y of the sector that contains a lotag of -1 (65535). Is not used by the code however.
loogiex[64] - lizard spit random x position on the screen. Currently not accessible.
loogiey[64] - lizard spit random y position on the screen. Currently not accessible.
numloogs - is set to 3 a random amount from 0 to 8 to give the number of lizard spits shown. The tile displayed is given by the LOOGIE tile.
loogcnt - is set to 96. Is the counter for the spits display.
posx - the player's x position.
posy - the player's y position.
posz - the player's z position.
oposx - the player's old x position. Used for interpolation of frames. Don't alter.
oposy - the player's old y position. Used for interpolation of frames. Don't alter.
oposz - the player's old z position. Used for interpolation of frames. Don't alter.
horiz - the player's look up or down value. Added to horizoff to give the player's view.
horizoff - the look up or down value based on the slope of a sector.
ohoriz - holds old view vlaue. Used for interpolation of frames. Don't alter.
ohorizoff - holds old view vlaue. Used for interpolation of frames. Don't alter.
bobposx - relates to circular motion of a rotating sector. Used to calculate the velocity the player should be moving around the circle.
bobposy - relates to circular motion of a rotating sector. Used to calculate the velocity the player should be moving around the circle.
truefz - the z value of the floor. This is also modified by a SE with a lotag of 17, elevator transport.
truecz - the z value of the ceiling. This is also modified by a SE with a lotag of 17, elevator transport.
visibility - visibility of the player. If the player is near an explosion, it is set to -127 (negative max). Weapons without the NOVISIBLE flag set this to zero. Nothing uses this value in Duke which suggests it is a dormant feature. Probably associated with how visible you are to enemies.
*palette - pointer to the palette offset in the memory.
posxv - Untested/unknown at this time.
posyv - Untested/unknown at this time.
poszv - Untested/unknown at this time.
randomflamex - Unused. Feel free to do anything with it.
weapon_ang - It used as a negative offset from the weapon position display. It is not set by any other code. It appears to be a false attempt at weapon-bob that never got used or removed.
refresh_inventory - refresh_inventory is initialized to zero when a map is loaded. If set to non-zero, then a 'inventoryleft' is performed once and refresh_inventory is reset to zero.
angvel - Untested/unknown at this time.
wackedbyactor - This is a spriteID. This stores which actor killed the player. It is initialized to -1 when a map is loaded and on resetplayer
frag_ps - the player ID of the player that killed the current player. Initially this is set to the current player's own ID.
frag - the number of frags the player has.
fraggedself - the number of suicides the player has.
pals_time - Given by the first number in the PALFROM command. Counter for the length of time screen flashes last.
pals[3] - Pals[0-2] give the RED GREEN and BLUE values for palette flashes.
last_full_weapon - initially 0, is set to the weapon ID of the previous weapon when a new weapon is picked up.
subweapon - this flag is set if the last_full_weapon was the shrinker otherwise it is zero. This determines whether the expander is being used or not.
show_empty_weapon - counter set to 32 when a new weapon is picked up.
on_warping_sector - initially zero it is set to 1 by a transporter sector effector, it is reset to zero when processed.
ammo_amount[MAX_WEAPONS] - Specify the ammo amounts for each weapon. Currently inaccessible.
gotweapon[MAX_WEAPONS] - Specify whether tCurrently inaccessible.
extra - extra contains the player's health.
last_extra - last_extra contains the previous value of extra.
tipincs - counter for the tip animation. It is set to 26 by the tip command and executes the tip animation when non-zero.
wantweaponfire - set to the ID of the weapon that is being selected.
hurt_delay - provides a delay for items that automatically hurt the player. CACTUS: set to 16. Delay until 8. Set, but don't delay FORCEFIELD: 16, BIGFORCE: 26.
hbomb_hold_delay - this is used for display purposes. It is > 0 when the player is throwing a pipe bomb. it sequences through the animation and then is reset to zero.
knee_incs - This is used to control sequencing of the knee animation (mighty foot) (max value for animations is 11)This is a non-zero count-up timer (if set to non-zero, it counts up). It is reset to zero after is reachces 15
access_incs - similar to tip_incs, this is used to sequence the key-card access display. access_incs is a non-zero count-up timer. Max value is 20. When 'using' a wall or sprite that needs access, it checks to see if the player has the correct access card and then starts the access animation by setting access_incs to one. It also sets the access_walnum or access_spritenum to itself. For sprites, the access card animation takes on the palette of the 'target' access sprite. got_access bits are UN-set for the access after it is granted:(pal0, bit 0) (Pal21, Bit 2) (Pal23, Bit 3).
access_wallnum - see access_incs.
access_spritenum - see access_incs.
fta - count-down timer for the time to display a quote.
ftq - the quote to display.
kickback_pic - Untested/unknown at this time.
got_access - Untested/unknown at this time.
one_parallax_sectnum - For SE with a lotag of 13, the sector's ceilingpicnum and ceilingshade is set to this sector's ceilingpic and ceilingshade. This only comes from playerID of zero. This is set for player 0 only when a level is loaded to the first sector found with ceilingstat with bit 0 set.
random_club_frame - This is initialized to zero. The comment in the code says 'Glowing'.... For WW2GI, this is incremented by 64 each frame if the current has the WEAPON_FLAG_GLOWS flag. Also, if it's not zero, you can't fire the shotgun (I don't know why...) When the shrinker or grower are dispalyed on the screen, tile SHRINKER +2 is drawn using this as a modifier, then the normal weapon is drawn.
fist_incs - This is a non-zero count-up timer. This is used to sequence display of the FIST tile on the screen. It holds at 32 Set to 1 to start animation of fist.
one_eighty_count - If one_eighty_count is less than zero, then 128 is added to one_eighty_count and ang. (this lets the player turn a set angle over time...) This is set on key TURNAROUND to -1024. To completely emulate what is being done during EVENT_TURNAROUND, just set one_eighty_count to -1024.
dummyplayersprite - When going underwater, a dummyplayersprite of PLAYERUNDERWATER is spawned. This sprite ID is tracked in dummy player sprite. This sprite is made to follow the player's position. The sprite is killed when the player moves back out of water.
extra_extra8 - This is initialized to zero. The player is given this amount of damage divded by 256 (shift right by 8). If no actual damage is done, then the value is not cleared. The actual damage applied to the player is modified by shield_amount
actorsqu - This is initialized to -1. Actor Squished... This is the actor that you are stepping on when they are shrunk. When knee_incs is > 0 then the player is made to face the squishee The actor is actually killed when knee_incs reaches >15 In multiplayer, you auto-squish other players who are shrunk. This is done by setting knee_incs = 1; weapon_pos = -1; actorsqu = ps[otherp].i; This is also set by the CON command pstomp .
timebeforeexit - This is a non-zero count-down timer. At 26*5, all sounds are stopped and the customexitsound is played if it is > 0. If customexitsound, quote 102 is displayed. At one, all players are set to end of level mode (.gm) (MODE_EOL) and the next level number is set... Hmm.. Fun stuff could happen here if I hade an event...
customexitsound - Untested/unknown at this time.
weaprecs[16] - These have something to do with picking up a (active?) handbomb sprite only once... It's used (only used and set) by the CON command ifgetweaponce (so [16] should actually be [MAXWEAPONS]...)
weapreccnt - Untested/unknown at this time.
interface_toggle_flag - This is used to dis-allow commands from being processed when the menus are up. (or something) Set to zero it allows normal processing. Set to 1, it disables processing. It seems to be set when a multiplayer game is starting. More research needed...
rotscrnang - This controls the angle warping of the screen. To emulate LOOKLEFT, subtract 152 from look_ang add 24 to rotscrnang
dead_flag - This is initalized to zero. This is used to control one-time processing when player dies. When health (extra) is < 0, then dead_flag is checked and then set.
pycount - pycount is used to modify pyoff. It is an increasing angle that is used to get sin for use in pyoff (resulting in a bobbing effect). It's incremented by 32 or 52 if the jetpack isn't on, etc...
pyoff - see pycount.
opyoff - stores old pyoff values for interpolation. Do not alter.
weapon_pos - weapon_pos is used to control display placement and sequencing. When set to -9, it stops counting and checks for reseting last weapon when set to any other non-zero value, it is decrmented until it reaches zero or -9 It's also used when placing the weapon tile(s) on the screen for raising and lowering of the weapon(s)
gm -GameMode. Valid values are MODE_MENU 1 Menu is being dispalyed MODE_DEMO 2 Demo is being played back MODE_GAME 4 Game is running MODE_EOL 8 End of Level has been signaled MODE_TYPE 16 User is typing chat message MODE_RESTART 32 Level is restarting MODE_SENDTOWHOM 64 Choosing who to send message to MODE_END 128 Game is ending(exit main game loop)
name[32] - This was probably meant to be the player's name, but it's not used.
buttonpalette - This saves the palette of the hit NUKEBUTTON. It's used when fist_incs reaches 42 and the next level is calculated.
lastrandomspot - This is initialized to zero and is not used.
toggle_key_flag - This seems to be used for 'hitting' things with the space key. Cameras and queue balls..
knuckle_incs - Initialized to one. This is used for animating the knuckle cracks. If it is 10 and the game has been going for a while (totalclock>1024), then knuckle cracking is started. When it reaches 22, or when a weapon is fired, it resets to zero. .
select_dir - This is not used and is not initialized.
walking_snd_toggle - This is initialized to zero. It is a non-zero count-down timer This is used to delay making walking sounds to that they occur every 'other' frame.
palookup - This seems to be used as a pal when the sector doesn'thave a pal set... Hmm. This is the player's 'color'/'team'?. When a level is loaded, it is set to the pal of the player sprite for that player if it is non-zero. If sprite's pal is zero, then it increments from 9 to 16 and back again.
hard_landing - This is a non-zero count-down timer. When the player lands on ground with a large velocity, hard_landing is set with the velocity. This causes the display to 'bounce' down as if in a hard landing on the ground.
fire_flag - Untested/unknown at this time.
^ Addendum

Note on [THISACTOR]:
A very useful little flag, this will get the .member value for the current actor or the sector which the actor is in.
It's use is very simple, getactor[THISACTOR].x XPOS, will get the current actor's X position. getsector[THISACTOR].floorz FLOOR is a faster way of writing:

getactor[THISACTOR].sectnum SECTOR
getsector[SECTOR].floorz FLOORZ

Which would have the same effect.

Note on floorstat/ceilingstat:
bit 0: 1 = parallaxing, 0 = not
bit 1: 1 = sloped, 0 = not
bit 2: 1 = swap x&y, 0 = not
bit 3: 1 = double smooshiness, i.e. change the size of the floor textures
bit 4: 1 = x-flip
bit 5: 1 = y-flip
bit 6: 1 = Align texture to first wall of sector
bits 7-15: reserved
Thus the numbers stored in the stat's are binary flags. To read them you'll need to do a 'bitstrip', which is mentioned in the variables section.

Miscellaneous Commands

^ Miscellaneous commands

^ Audio commands:

ifsound <sound> - returns true if the current sound with number given by <sound> is playing.

starttrack <value> - start the midi track with the number value defined sequentially by the music command.

^ Texture commands:

gettexturefloor - get the current sector's floor texture in the variable TEXTURE
gettextureceiling - get the current sector's ceiling texture in the variable TEXTURE
gettexturewall - not yet implemented
Note :- these commands are achieveable using member structures.

^ lowtag/httag commands:

spgetlotag - get the current actor's lotag in the variable LOTAG
spgethitag - get the current actor's hitag in the variable HITAG
sectgetlotag - get the current sector's lotag in the variable LOTAG
sectgethitag - get the current sector's hitag in the variable HITAG

Note: these commands are achieveable using member structures.

^ Actor/player commands:

getplayerangle <var> - get the player's current angle in the variable var
setplayerangle <var> - set the player's current angle with the variable var

lockplayer <var> - lock the player's movement for a count of var.

getangletotarget <var> - get the angle to face the nearest or current player in the variable var

setactorangle <var> - set the actor's angle with the variable var
getactorangle <var> - get the actor's angle in the variable var

espawn <value> - works like spawn but the actor's ID is placed in the variable RETURN

findnearactor <type> <maxdist> <var> - finds the actor of type (e.g. PIGCOP) within the maximum distance defined and returns its actor ID into var. If none are found the value of the variable will be -1. Only works in current sector.

findnearactorvar <type> <var1> <var2> -similar to findnearactor but the distance to look is given by var1.

setactorvar[<actorID>].<avar> <var> - for the actor with the actorID set the per actor variable avar with the variable var.
getactorvar[<actorID>].<avar> <var> - for the actor with the actorID get the per actor variable avar into the variable var.

^ Miscellaneous commands:

enhance <value> - compares value with the current build version of Eduke. If the value given is greater than the current build number the user is instructed to update their executable file. Placed right at the start of the executable code. This is used so any released cons know which exe version they will work with.

Index


^ Index

Primitives

[get/set]actor
[get/set]sector
[get/set]wall
addvar
andvar
divvar
endevent
enhance
espawn
findnearactor
findnearactorvar
gamevar
getactorvar
getangletotarget
getplayerangle
gettextureceiling
gettexturefloor
gettexturewall
ifsound
ifvare
ifvarg
ifvarl
lockplayer
modvar
mulvar
onevent
orvar
randvar
sectgetlotag
sectgethitag
setactorvar
setactorangle
setplayerangle
setvar
spgethitag
spgetlotag
starttrack

Events

EVENT_INIT
EVENT_ENTERLEVEL
EVENT_RESETWEAPONS
EVENT_RESETINVENTORY
EVENT_HOLSTER
EVENT_LOOKLEFT
EVENT_LOOKRIGHT
EVENT_SOARUP
EVENT_SOARDOWN
EVENT_CROUCH
EVENT_JUMP
EVENT_RETURNTOCENTER
EVENT_LOOKUP
EVENT_LOOKDOWN
EVENT_AIMUP
EVENT_AIMDOWN
EVENT_FIRE
EVENT_CHANGEWEAPON
EVENT_GETSHOTRANGE
EVENT_GETAUTOAIMANGLE
EVENT_GETLOADTILE
EVENT_CHEATGETSTEROIDS
EVENT_CHEATGETHEAT
EVENT_CHEATGETBOOT
EVENT_CHEATGETSHEILD
EVENT_CHEATGETSCUBA

Weapon properties

SHOOTS
FIREDELAY
HOLDDELAY
TOTALTIME
SPAWN
SPAWNTIME
CLIP
SHOTSPERBURST
WORKSLIKE
INITIALSOUND
FIRESOUND
SOUND2TIME
SOUND2SOUND
FLAGS

Actor members

x
y
z
cstat
picnum
shade
pal
clipdist
filler
xrepeat
yrepeat
xoffset
yoffset
sectnum
statnum
ang
owner
xvel
yvel
zvel
lotag
hitag
extra

Sector members

wallptr
wallnum
ceilingz
floorz
ceilingstat
floorstat
ceilingpicnum
ceilingheinum
ceilingshade
ceilingpal
ceilingxpanning
ceilingypanning
floorpicnum
floorheinum
floorshade
floorpal
floorxpanning
floorypanning
visibility
filler
lotag
hitag
extra

Wall members

x
y
point2
nextwall
nextsector
cstat
picnum
overpicnum
shade
pal
xrepeat
yrepeat
xpanning
ypanning
lotag
hitag
extra

Player members

shield_amount
steroids_amount
jetpack_amount
scuba_amount
heat_amount
holoduke_amount
look_ang
ang
last_pissed_time
weapon_sway
bobcounter
curr_weapon
last_weapon
newowner
quick_kick
holoduke_on
actors_killed
max_actors_killed
secret_rooms
max_secret_room
holster_weapon
scuba_on
jetpack_on
heat_on
hbomb_on
footprintpal
transporter_hold
inven_icon
cheat_phase
somethingonplayer
on_ground
footprintshade
on_crane
firstaid_amount
rapid_fire_hold
jumping_toggle
footprintcount
jumping_counter
boot_amount
cursectnum
crack_time
spritebridge
over_shoulder_on
zoom
exitx
exity
loogiex[64]
loogiey[64]
numloogs
loogcnt
posx
posy
posz
horiz
ohoriz
ohorizoff
invdisptime
bobposx
bobposy
oposx
oposy
oposz
pyoff
opyoff
osxv
posyv
poszv
truefz
truecz
player_par
visibility
pals_time
randomflamex
weapon_ang
refresh_inventory
angvel
wackedbyactor
frag
fraggedself
last_full_weapon
on_warping_sector
ammo_amount[MAX_WEAPONS]
gotweapon[MAX_WEAPONS]
oang
last_extra
subweapon
tipincs
horizoff
wantweaponfire
hurt_delay
bomb_hold_delay
airleft
knee_incs
access_incs
fta
ftq
access_wallnum
access_spritenum
kickback_pic
got_access
i
one_parallax_sectnum
random_club_frame
fist_incs
one_eighty_count
dummyplayersprite
extra_extra8
extra
actorsqu
timebeforeexit
customexitsound
weaprecs[16]
weapreccnt
interface_toggle_flag
rotscrnang
dead_flag
show_empty_weapon
pycount
weapon_pos
frag_ps
gm
name[32]
buttonpalette
lastrandomspot
*palette
toggle_key_flag
knuckle_incs
select_dir
walking_snd_toggle
palookup
hard_landing
/*fire_flag
*/pals[3]

Copyright © 2000 James Hollidge