Primitives Tabulated  v4-2-2004  Release 2 © RTCM Jeff Armstrong , RTCM Joris B. Weimar ,
RTCM Jonah Bishop , RTCM Corvin

Introduction | primitives tabulate
a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z

Introduction

This document is not intended for beginners, however you may find it useful to occasionally refer to, and learn gradually. Others can dive in. Most of this information is retained originally in the GAME.CON when its shipped with your game. The true fact is you can place all your code in a single GAME.CON(length permitted)

Primitives are simply commands or operations (functions) made available to you, the programmer, by the game engine(You cannot write new primitives). You supply them with correct Syntax  and Arguments to makeup a code that CONtrols and validates functions in the game. Once you call a primitive, the game performs the routine for you. Most of the routines are vaguely reminiscent of the C programming language with a virtual environment.

You can collect and manage primitves to have the game do really bizarre things. For example, in some of the experiments I had the Rubbermaid trashcan spitting blood and throwing glass each time I hit it with a pistol shot. Anyway, as you read through some of the documents, you will begin to understand the basics behind the script and you will then be able to experiment with your own ideas. 

Simple Example of using the "ifrnd" primitive:

The "ifrnd"  will tell you if a  random number  between 0 and 256 was  less than  the  number  you   gave it. 
If you wanted there to be a 1 in 2 chances of something happening(50% chance), you could put:

ifrnd 128  // If  a random number is less than 128.

{

<lines of code>  // Then there is a 50% chance that this command will be started.

}

Note: For more information on the  ifxxxx  primitives, read the details in the tabulate below and also See the RTCM document   "con-primitive-declarations"

 

Here are some of the things you should know before examining the primitive tabulate below:

  • The < and > are only for this guide, not for CON files.  They mean   insert(<)  argument  here(>)
  • The { and } are intended to show where to add lines of code, some of which you will find is optional. You must use both brackets to enclose the block.
  • When it says (only available in Duke3D v1.5, NAM, WWII GI)  it means that additional scripting control is only in these games.
  • When it says (only available in WWII GI) it means that additional script control, primarly weapon customizations, is only in this game. Most weapons work exactly the same.  Except for the HANDBOMB_WEAPON(pipebomb) and HANDREMOTE_WEAPON(laser trip bomb)
  • The primitives are hardcoded in the game exe.  There are "primitive functions"(routines or states), "primitive constansts"and "primitive actors". Some primitives will accept arguments from the cons, others only use arguments that are hardcoded into the exe. In this guide standard primitives will be in lower case.
  • ARGUMENTS  are values that CONtrol a primitive. Many a defined constants.   ARGUMENTS in this guide are always uppercase.
  • Some of the Arguments are proceeded by special characters... $  or   # They are only for use in this guide for reference, they are not to be used in the CON files.
  • ARGUMENTS(parameters) that are preceded by a # are numbers(numeric values, some may use common words but are essentialy values.)
  • ARGUMENTS(parameters) that are preceded by a $ are common words(these can not be replaced with a number)


A simple example of  basic structuring for using primitives with entire routines:


 ________CONtrol  Line_________
|                              |
|                              |
primitive $ARGUMENT1 #ARGUMENT2
          |                    |
          |___Parameter List __|


...{ lines of code }...............
.....................................
|                                   |
|_________Command Lines ____________|
|
|____________________Routine______________|

The portions of the structure above is sectioned off by there placement within a routine, here are some brief descriptions:

  • A 'CONtrol Line'  -consist of  primitives and arguments.
  • A 'Parameter List'  -contains  arguments, states, functions, values, flags, etc...
  • ARGUMENTS  -are Values / Parameters that CONtrol a primitive.   ARGUMENTS in this guide are always uppercase.
  • A Command Line -cotains  programmed code, statements, sub-routines within a primitives entire routine.
  • Routine  -the entire primitive coded function.
  • Syntax  -is the structure of the script.
  • A Script  -is everything, the completed code.

    Note that not all primitives require any CONtroled arguments. The game either defaults to an internal value(hardcoded) or it executes the function as is.

 


This guide uses varous terms to describe information. These terms and phrases may become confusing so I will explain them here:

  • "current actor"
       -This part of the description indicates that the calling primitive is normally used as a sub command, executed within the actors code.
  • A String 
       -an ASCII(common words) identification, most of which will be null(close on there own)  They are indicated with a  $ symbol.
  • #ID or ID 
       -This indicates that the value(argument or parameter) is really a numerical value, and not a string. However most #ID's have a ASCII counter part.
  • ( minor actor ) 
       -This indicates that the actor is partially controllable as the rest of the functions are hardcoded.(The Lesser Demon)
  • Boolean 
       -Something that can be true or false.
  • A Number
       -A real value. It can be an argument, flag, parameter, etc...
  • Array
       -x, y and z coordinates. (x is horizontal, y is depth, z is vertical)
  • Object 
       -game object (like player, monster or actor, including useractor and 'minor' actors)
  • A Routine
       -Typicaly any bit of code that is processed. Primitives are routines(the function is hardcoded) so are states.
  • ARGUMENTS 
       -Values / Parameters that CONtrol a primitive.  ARGUMENTS in this guide are always uppercase.
  • Constants 
       -Arguments that are set at startup and can not be changed afterwards.(some Hardcoded)
  • Function 
       -A procedure, routine or state, Typically they are predefined(some Hardcoded)
  • Primitives 
      -Hardcoded Routines and Functions. In this guide standard primitives will be in lower case.
  • "defined constants" 
      -A value or function that remains unchanged and unchangeable after the game has started.
  • Tag 
      -Most commonly used to refer to placing a defined constant within the script at several locations without having to remember or re-enter the defined value.
  • Variable
      -A value that can change, a number and /or total amount. Any number.
  • Closest actor
    - When playing with more than one player, the particular primitive will effect the closest actor. This goes for all player related functions.

 

Primitives Tabulated


This is a complete listing of all the primitives that can be placed into CON files.

 

//<one space>

This REMark is used to denote comments.  Everything after this REMark is ignored by the compiler. A space must follow the REMark, or the compiler will generate an error. Simply jump back in your code and place a space in there.

 

/* and */

These two REMmarks are used to create comment blocks. Place the /* at the beginning of the area you wish the compiler to ignore, and the */ at the end of the area you wish the compiler to ignore. These type of REMarks are used to create large comments or to ignore an entire section of code.

 

{ and }

These symbols are used to delimited statement blocks, grouping several lines of code into one block. There must be a space after { and before }.

 

{ }

These symbols are used in your line of code. This function means 'do nothing' This is the same as the  nullop  primitive. There must be at least one space in between.

 

Section "A"

action NAME #STARTFRAME #NUMFRAMES #NUMANGLES #NUMJUMP #SPEED

See the RTCM document   "con-primitive-declarations" for more information.

 

action #NAME

Starts the action specified by <name>. This would produce a single static image.

See the RTCM document   "con-primitive-declarations" for more information.

 

actor #NAME #STRENGTH $ACTION #SPEED $INSTRUCTIONS1 $INSTRUCTIONS2 { AI_FUNCTION code } { actor code } enda

See the RTCM document   "con-primitive-declarations" for more information.

LameDuke Special:

Syntax: actor #NAME #STRENGTH $ACTION #SPEED $INSTRUCTIONS1 $INSTRUCTIONS2 { actor code } enda

For the <instructions> parameters see the primitive "move"

 

addammo #WEAPON #AMOUNT

Adds the <amount> of ammunition to the current or closest player's value for the appropriate <weapon>.
This function does not give the player said <weapon> if he doesn't already have it. Something else, this function
can not increase your ammo over the set maximum that is determined at game startup. If a weapon's ammo is at
maximum, 'addammo' invokes 'break'. Thus In 'ammunition items' codes where it checks for player proximity,
'addammo' always is placed first after 'if' condition lists. You can however use negative values to decrease the
ammo below zero.

When the ammo for a current weapon drops below zero, the ammo counter attempts to display a '-' before
the number. This will not automatically change the weapon like it would normally, but if the player was to manually
change the weapon and then switch it back, the CURRENT ammo counter in the lower left will display zero and
then it will automatically switch to another weapon. The main ammo counter however will continue to display the
negative numbers.

For advanced CON hacking you can use addammo as variable to determine if certain events can take place.

Legal values for    addammo <weapon> :

#ID

Common name

Hardcoded Routine

0

KNEE_WEAPON

1

PISTOL_WEAPON

2

SHOTGUN_WEAPON

3

CHAINGUN_WEAPON

4

RPG_WEAPON

5

HANDBOMB_WEAPON

This is modified in WWIIGI
6

SHRINKER_WEAPON

7

DEVISTATOR_WEAPON

8

TRIPBOMB_WEAPON

9

FREEZE_WEAPON

10

HANDREMOTE_WEAPON (only available in WWII GI)

-
11 GROW_WEAPON (only available in Duke3D v1.5, NAM, WWII GI)

 

addbatteryammo #AMOUNT (only available in Duke3D Lameduke 1-3-95Beta)

Adds <amount> of amp ammo to players inventory. 20 amps per item. For what device?

 

addinventory #ITEM #AMOUNT

Adds or Sets <amount> to the current or closest player's value for the appropriate <item>.

Legal values for    addinventory <item> :

 

Value

Common name

Hardcoded Routine

0

GET_STEROIDS

Will set the inventory level to <amount> If the <amount> is not set to the maximum value, then the steroids will automatically start running.
1 GET_SHIELD Will add <amount> to the current inventory level.
2

GET_SCUBA

Will set the inventory level to <amount>
3

GET_HOLODUKE

Will set the inventory level to <amount>
4

GET_JETPACK

Will set the inventory level to <amount>
6

GET_ACCESS

This is a bit status (on/off) of which cards the player has. The actor giving the player the card's palette determines which card to give the player.
7

GET_HEATS

Will set the inventory level to <amount>
9

GET_FIRSTAID

Will set the inventory level to <amount>
10

GET_BOOTS

Will set the inventory level to <amount>

 

 

addkills #AMOUNT 

Adds <amount> to the current or closest player's kill count. Negative values   may work.

 

addkill

Adds 1 to the current or closest player's kill count. Negative values  don't work.

 

addlog (only available in WWIIGI)

un proven

 

addlogvar $NAME (only avalable in WWIIGI)

Logs current value of this variable <name>

 

addphealth #AMOUNT

Adds the value <amount> to the current or closest player's health. Only the atomic health actor can increase the players health value over the previously set MAXPLAYERHEALTH value.  Negative values work aswell.

 

addrammo #AMOUNT (only available in Duke3D Lameduke 1-3-95Beta)

Adds the <amount> of rocket ammunition to the current or closest player's inventory.
Notice how the weapon and the add primitive is combine in this function. See addammo primitive for comparison in syntax.

 

addscore #AMOUNT (only available in Duke3D Lameduke 1-3-95Beta)

Adds the value <amount> to the current player actors score. Negative numbers will work.

 

addstrength #AMOUNT

Adds <amount> to the strength (health) of the current actor.  Negative values  work aswell.

 

addweapon #WEAPON #STARTAMOUNT

Gives the current or closes player the specified <weapon> with an initial amount of ammunition equal to <startamount>.
This will call a break if the ammunition level is full.

Legal values for    addweapon <weapon>: 

 

Value

Common name

Hardcoded Routine

0

KNEE_WEAPON

1

PISTOL_WEAPON

2

SHOTGUN_WEAPON

3

CHAINGUN_WEAPON

4

RPG_WEAPON

5

HANDBOMB_WEAPON

This is modified in WWIIGI
6

SHRINKER_WEAPON

7

DEVISTATOR_WEAPON

8

TRIPBOMB_WEAPON

9

FREEZE_WEAPON

10

HANDREMOTE_WEAPON (only available in WWII GI)

-
11 GROW_WEAPON (only available in Duke3D v1.5, NAM, WWII GI)
Lameduke Weapons
#ID Common name Hardcoded Routine
WEAPON1 OTHERSHOTSPARK
WEAPON2 SHOTSPARK1
WEAPON3 BULLET
WEAPON4 HEAVYHBOMB
WEAPON5 RPG

 

addvar #NAME #NUM (only available in WWIIGI)

Adds <num> to the variable <name> with the total in <name>  The <num> value can use negative numbers to actualy subtract from.

 

addvarvar #NAME1 #NAME2 (only available in WWIIGI)

Adds variable <name2> to variable <name1> with the total in <name1>

 

ai $NAME #ACTION #SPEED #INSTRUCTIONS

This is an "artificial intelligence" routine(set of instructions) that the   computer actors  will perform during a game. The <name> is the 'defined' ai routine,  identified for use later on. The <action>  value is the name of the action that the actor will use. The <speed> is the rate of movement the actor will use when a.i. <name> is called, negative values are allowed in this argument. The <instructions> are hardcoded sub-routines, each having unquine behavior.   If you want to stack a few instructions, just place each of them on the same line. EX: randomangle dodgebullet fleeenemy

The actor seems to see if it will end in a water sector at the end of its executed a.i. routine, if so, then return true. Effectively considering the boundry between the water and the dry sector as a wall. It maybe used to block them from walking into the water and from jumping into the water.

The known legal values for <instructions> can be found in The Primitive Declaration Document under  ai 

See the RTCM document   "con-primitive-declarations" for more information.

 

ai $NAME

Calls the previously defined ai routine <name> to be the current actors routine.

See the RTCM document   "con-primitive-declarations" for more information.

 

Section "B"

betaname

un proven

 

blood #AMOUNT (only available in Duke3D Lameduke 1-3-95Beta)

Spews <amount> of blood from the current actor.

 

break

Halts and then exits an execution within an action, actor or state. Hardcoded function, no arguments, nor any required. 

 

break;  (available in Redneck Rampage RA)

Halts but does not exit? an execution within an action, actor or state? The use of  a semi-colon ";" after break such as "break;" does what?

 

Section "C"

cactor $ACTOR

Changes actors, from one to the other <actor>,  ignoring the new actors own initialization values and  continue useing the current strength, movement, palette, size, action, and AI of the original actor.

 

clipdist #NUM

The <num> parameter can be any value from 0 to 255. When a  sprite  or   actor  is blocked  via  primitive cstat (or in BUILD Editior), a CLIPing DISTance or bubble is formed around a sprite. This bubble isn't really present in the game, its more like a sensor detecting collision of  actors  or   sprites. The <num> value is the distance from the center of the   protected sprite  to the outer circumference of the bubble. This ultimately determines how close an  actor  can get to the protected sprite before being blocked or stopped (You can not pass through). The lower the value, the smaller the bubble. A clipdist of 255 equals the distance of the largest grid size in BUILD, which is 1024  basic Build units. The default for <num> is 32. The default is applied if no <num> is supplied by you.

 

count #NUM

Sets the current actors count to <num>.  30 counts is 1 second, 150 counts is 5 seconds and 10 counts is 1/3 of a second.
The game gives every actor its own counter.  If it didn't then this function could heavily mess up the timer of other actors.

 

cstat #SUM

Allows manual setting of the <sum> of the attribute bit(s) of the current actor or sprite., (16 bit, unsigned integer) , a very powerful function. Thus Changing STATus.  All previous settings   are lost   when this function is used , however the Change is temporary. 

See the primitive cstator below,  for legal values for <sum>.

 

cstator #NUM   (only available in Duke3D v1.5, NAM, WWI GI)

Same as cstat, but it doesn't reset all the previous settings. It just adds the ones you specify. Similar to 'or' in several programming languages.
Unlike cstat previous settings are   not lost   when this function is used they are added together. Thus cHANGE statUS oR. Basicaly cstator  is  cstat #NUM "oR" this #NUM. The legal values of <num> are as follows:

Values for  cstat  and  cstator and there flags (16 bit, unsigned integer hardcoded flags)

 

Value

Common name

Hardcoded Routine

0

Kills the sprite(Default)

1

Makes the sprite blockable,blocks movement ("B" in BUILD)

2

Makes the sprite translucent, Partial Invisibility (Black shade)

4

Flips the sprite around the x-axis(verticaly)

8

Flips the sprite around the y-axis(horizontal)

10 Turn upside-down and make translucent.

16

Draws the sprite as wall texture (vertically flat, X and Y are 0) If looked at it from above, this object will appear blended in with the background. Viewed from any other angle, it will look normal. Like a sheet of paper, put on its edge. Wall-Aligned. 32 ignored

32

Make the sprite a floor texture (horizontally flat, X and Z are 0 ) Draws object as a flat square on the ground, Like a sheet of paper, but fell flat on ground. Floor-Aligned. 16 ignored

64

Makes the sprite one sided

128

Half submerged(true centering) Object actually starts unsubmerge then it is dropped down.

130

256

Makes the sprite solid and blocking, You can shoot it, you can stand on it, etc. (use with hitscan / cliptype 1) ("H" in BUILD)

257

Resurrect the actor or sprite once more. used for playing dead (256+1? maybe)

260 Flipped X and bullet stopping
264 Solid and UpSide down.

289

512

Make the sprite translucent(Grey shade), more than value 2, 2 is ignored

706 Centers sprite(resizes better) and  transparent

1024

reserved, handled internally

2048

reserved, handled internally

4096

reserved, handled internally

8192

reserved, handled internally

16384

reserved, handled internally

32767

32768

Hides the sprite and can not be directly hit/shot. Full Invisibility. Splash damage such as RADIUSDAMAGE will inflict damage.

32784

Un-block the blocked sprite

32785

Hides the sprite(Full Invisibility), makes it blocking and non-rotating

33023

To use more than one setting,  add the values together (264 = solid (256) + upsidedown (8,) 256 + 8 = 264)

another example:

cstat 10     // Turn upside-down and make translucent. (10 = 8 + 2)

another example:

cstat 260  // Flipped X and bullet stopping (4 + 256 = 260)

 

Section "D"

debris $SCRAPGROUP #AMOUNT

This primitive produces pieces of flying debris or particles(actor). The <scrapgroup> parameter is the  actor  used for the debris/the sprite animation used for the debris. The higher the <amount> value, the more debris. A practical <amount> would be 2.

Value

Scrapgroup

2,390

SCRAP6

2,400

SCRAP1

2,404

SCRAP2

2,408

SCRAP3

2,412

SCRAP4

2,416

SCRAP5

 

debug PARAMETER

Prints the value of <parameter> to the output buffer. If a standard game is loaded, with the default output buffer being used(which is?), it will print the value to the screen in the standard font.(viewable via cheat code: DEBUG)  If the output buffer is altered...

An example:  The command line "duke3d.exe -map test.map /q8 > test.log"   , Will  set  the  output buffer form  into "test.log"(an ASCII buffer dump) and then this allows the standard debug info to dump to the newly renamed output buffer. If the .log is in the form of  a file, it can be opened with notepad and provide readable debugging information. If its dumped to the printer spool, then you can print it out directly from the output buffer to the printer.   /q# can be 1-8.  See the Command line document for more information. (?reminder to expand?)

 

define $NAME #NUM

Defines <name> to be value <num>.  Basically it allows you to use the supplied name instead of handling digits all the time. This ultimately organizes your scripts for easy reference. If for some reason you need to change the value, changing one is allot easier than replacing many. The CON parser will replace every occurrence of <name> with <num> when compiled.

The following example sets the string MAXPLAYERHEALTH to the value of 100.

Ex::     define MAXPLAYERHEALTH 100

This is called externally only, within the script.

See the RTCM Document "con-user-con" for more information.

 

definelevelname #EPISODE #LEVEL $MAPNAME #LEVELPAR #RECORD $LEVELNAME

Is used to define the episode, level number, map file name, level par, record times and level names for each level. This is typically handled in the user.con for organization. This is called externally only, within the script.

The numbering scheme when using this primitive is a tab bit confusing, lets figure this out. The level and episode numbers starts off at zero. For the first level. Level 1 is actually #0 in the CON file,  thus Level 4 is actually #3 in the CON file. (The practice of starting a range of numbers with zero to equal an unequal number is common practice with programmers, gives you more digits to work with.) Also for good practice, always pad the par and record times with a leading 0 if your using single digits. Level file names cannot exceed 13 characters. Level par cannot exceed 5 characters min:sec (mn:sc) Level titles cannot exceed 32 characters.

See the RTCM Document "con-user-con" for more detailed information.

 

definequote #NUM $QUOTE

Binds a string to a number. The string can now be displayed by using the 'quote' primitive.
Defines the different phrases that will pop up on the screen in response to certain game events. You can define what words appear on the screen when you get some ammo or an inventory item, what words will appear when you adjust game options etc.. etc... It is however it possible to actual type a phrase into the code that your scripting, without calling upon one of the defined quotes.

See the RTCM Document "con-user-con" for more detailed information.

 

defineskillname #NUM $SKILLNAME  (only available in Duke3D v1.5, NAM, WWI GI)

Defines <num> to be equal with <skillname>.  This is called internally, it allows you to assign your own custom title to each difficulty level in the games selection menu. Legal values for <num> are: 0, 1, 2  and 3(They are the four difficulty levels in the game) <skillname> can be 32 characters in length.

 

definesound $NAME #FILENAME #PITCH1 #PITCH2 #PRIORITY #TYPE #VOLUME

The <name> parameter is the name of the sound you use within your code. Typically it resembles the file name. The <filename> is the name of the .voc or the .wav file the game loads when the sound <name> is called. The <pitch1> and <pitch2> values are random pitch variations, they can be positive or negative. The <priority> is the importance of the sound, the game only can play so many sounds at once, setting the sound priority higher indicates you want the game to play this sound instead of another sound if to many are already playing. Legal values are 0 to 255. The <type> is the type of sound in the game, a bit parsed value. The <volume> is the loudness mix of the sound, ranging from -32,767  to  32,767.(signed integer) Negative values are louder  and  positive values are softer.

See the RTCM Document "con-user-con" for more information.
See the RTCM Document "sound-making-sound" for more information.

 

definevolumename #EPISODENUM $EPISODENAME  (only available in Duke3D v1.5, NAM, WWI GI)

Defines a custom title for each episode where <episodenum> is the episode number and <episodename> is the name you provide.

 

destroyit (only available in Redneck Rampage RA)

unproven

 

Section "E"

else

This is used in "if-else" statements. This returns true if the last function returned false.

EX:

 

 

enda

END an Actor or userActor function, closing it.

 

endevent

END an EVENT_NAME, closing it.

 

endofgame #NUM

Ends the game after <num> counts down.  For an example, a value of 180 would end the game after approximately 6 seconds (30 = 1 second). A value of 52 is normally used to end each episode. This primitive is usually used at the end of each episode to provide enough time to view the boss death scenes and allow adequate time to read level 'scores'.(break time!)

 

ends

ENDs a State function, closing it.

 

Section "F"

fakebubba (only available in Redneck Rampage RA)

un proven

 

fall

Let the  current actor  fall at an increasing speed until it hits a surface. Value for acceleration is hardcoded. (?GENERICIMPACTDAMAGE may be associated?)

 

feathers #AMOUNT (only available in Redneck Rampage)

This hardcoded actor spawns <amount> of feathers up and outwards.

 

Section "G"

garybanjo (only available in Redneck Rampage RA)

un proven

 

gamestartup

This is the startup function that sets the initial values for the game. It gets all the hardcoded values passed as parameters. They are the first parameters that are compiled during launch. These variables can not be changed later in the CONs. There are a number of parameters not shown here that can be passed, and can be customizable. For WWIIGI
users, there is an entire list of pre-defined variables that can be changed dynamically. See the  gamevar  primitive.

So basically if your looking to change something you suspect maybe permanently set, you can review this list, if its here you can't change it through the CONs.

This is the actual gamestartup list

DEFAULTVISIBILITY
GENERICIMPACTDAMAGE
MAXPLAYERHEALTH
STARTARMORHEALTH
RESPAWNACTORTIME
RESPAWNITEMTIME
RUNNINGSPEED
GRAVITATIONALCONSTANT
RPGBLASTRADIUS
PIPEBOMBRADIUS
SHRINKERBLASTRADIUS
TRIPBOMBBLASTRADIUS
MORTERBLASTRADIUS
BOUNCEMINEBLASTRADIUS
SEENINEBLASTRADIUS
MAXPISTOLAMMO
MAXSHOTGUNAMMO
MAXCHAINGUNAMMO
MAXRPGAMMO
MAXHANDBOMBAMMO
MAXSHRINKERAMMO
MAXDEVISTATORAMMO
MAXTRIPBOMBAMMO
MAXFREEZEAMMO
MAXGROWAMMO
CAMERASDESTRUCTABLE
NUMFREEZEBOUNCES
FREEZERHURTOWNER
QSIZE
TRIPBOMBLASERMODE

 

Starup Variables and arguments

You may wish to copy the following list of startup variables into your USER.CON
I have included all default settings.

The parameters below are called externally.

// Startup variables

define SWEARFREQUENCY 100 // The lower, the less.

define CAMERASDESTRUCTABLE NO // NO  set to 1 if you wish security cameras to be destructible, or 0 if not
define FREEZERHURTOWNER YES  // YES

define MAXPLAYERHEALTH 100 // 100
define MAXWATERFOUNTAINHEALTH 50 // 50

define YELLHURTSOUNDSTRENGTH 40
define YELLHURTSOUNDSTRENGTHMP 50

define MAXXSTRETCH 70
define MAXYSTRETCH 70

define MINXSTRETCH 9
define MINYSTRETCH 8

define MAXPLAYERATOMICHEALTH 200 // doubles as maxarmor.
define DOUBLEMAXPLAYERHEALTH MAXPLAYERATOMICHEALTH
define STARTARMORHEALTH 0
define RETRIEVEDISTANCE 844
define SQUISHABLEDISTANCE 1024 // For actors only!
define DEFAULTVISIBILITY 512
define FROZENQUICKKICKDIST 980

define GENERICIMPACTDAMAGE 10

define MAXPISTOLAMMO 200
define MAXSHOTGUNAMMO 50
define MAXCHAINGUNAMMO 200
define MAXRPGAMMO 50
define MAXHANDBOMBAMMO 50
define MAXSHRINKERAMMO 50
define MAXGROWAMMO 50
define MAXDEVISTATORAMMO 99
define MAXFREEZEAMMO 99
define MAXTRIPBOMBAMMO 10
define TRIPBOMBLASERMODE 0   // 0 = always visable - default 0
                                                    // 1 = transluscense
                                                    // 2 = invisible w/o IR goggles
                                                    // 3 = totally invisable

define RESPAWNACTORTIME 768 // 768
define RESPAWNITEMTIME 768 // 768

define QSIZE 64 // total number of active
                        // bullet holes, blood,
                        // footprints, money, ect...
                        // (max 1024)

// The BLIMP has a high respawn time (any value smaller runs the risk
// of spawning too many sprites, resulting in "Bog City")

define BLIMPRESPAWNTIME 2048 // 2048

define NUMFREEZEBOUNCES 3 // 0 - 255 inclusive - default 3 This defines how many paths a blast from a freezer can follow.
                                                 // 0 means it doesn’t go anywhere, 1 means it will last until it hits a wall or object,
                                                 // 2 means it will bounce once, 3 (default) will bounce twice, and so on.


define RUNNINGSPEED 53200 // 53200, too high a value will cause the player to keep on sliding
define GRAVITATIONALCONSTANT 176 // 176

define PLAYDEADTIME 120 // 120

define SHRUNKCOUNT 270 // 270
define SHRUNKDONECOUNT 304 // 304

define FROZENDRIPTIME 90 // 90
define THAWTIME 138 // 138


// Various blast radius distances

define RPGBLASTRADIUS 1780 // 1780
define PIPEBOMBRADIUS 2500 // 2500
define SHRINKERBLASTRADIUS 680
define TRIPBOMBBLASTRADIUS 3880
define MORTERBLASTRADIUS 2500
define BOUNCEMINEBLASTRADIUS 2500
define SEENINEBLASTRADIUS 2048

// end startup variables

 

gamevar $NAME #NUM FLAGS  (only available in WWII GI)

Defines and sets the initial value for a variable. Typically used with the enhanced weapon system, but can be used in several other ways.

See the RTCM document   "con-primitive-declarations" for more information.

 

getlastpal

Sets the palette of the current actor back to the color(#numerical) before the last or previous change.

 

globalsound $NAME

Play a sound that can be heard everywhere in the map. The <name> is the name of the defined sound to play, not the filename.  Volume output equals that of a RTS playing back-Very Loud. (?The maximum distance this can be heard is questionable? re-review?)

 

gravity (only available in PaintBrawl)

Un proven primitive

 

guts #ACTOR  #AMOUNT

'Minor Particles,' .This primitive is not limited to just body parts, however that is its original function, to spawn actors from the current actor.  The <amount> value determines the amount of  'guts'  to make fly(spawn) from current actor.

Legal values for <actor> can be found below.

 

Value

#ACTOR

Description

1,520

DUKETORSO

flying body part (Duke's upper torso)

1,528

DUKEGUN

flying body part (Duke's forearm and gun)

1,536

DUKELEG

flying body part (Duke's leg)

1,768

HEADJIB1

flying body part (Liztroop's head)

1,772

ARMJIB1

flying body part (Liztroop's arm)

1,776

LEGJIB1

flying body part (Liztroop's leg)

1,860

INNERJAW

no image, causes damage to player if close enough

2,201

LIZMANHEAD1

flying body part (Lizman's head)

2,205

LIZMANARM1

flying body part (Lizman's arm)

2,209

LIZMANLEG1

flying body part (Lizman's leg-Captain)

2,245

JIBS1

flying internal body part (spine)

2,250

JIBS2

flying internal body part

2,255

JIBS3

flying internal body part

2,260

JIBS4

flying internal body part

2,265

JIBS5

flying internal body part

2,286

JIBS6

flying internal body part

 

Section "H"

hitradius #RADIUS  #STRENGTH1 #STRENGTH2 #STRENGTH3 #STRENGTH4

Sets an actor/explosion/weapons (1670  RADIUSEXPLOSION) Blast radius(globe) and damage amount (not the actual animation but just the damage.) The <radius> value is the maximum distance from center to the outer most distance that the explosion can cause damage(concussion/burn/fragments etc). The <strength1> value is the strength or damage that is inflicted between 75% to 100% range. The <strength2> value is the damage that is inflicted between 50% to 75% range.  The <strength3> value is the damage that is inflicted between 25% to 50% range.  The <strength4> value is the damage that is inflicted between 0% to 25% range.

Note: value <strength1> is normally the least amount of damage since it is the farthest from center. However special effects may require otherwise. Example: You might want to produce an engulfing explosion, where the most damage would be at value <strength1> and increase as it moves towards center.

 

Section "I"

ifaction #ACTION { line of code }

Checks to see  IF  the current actor is executing this <action>.   If so, then return true.

    ifaction 0 would return true if no action is executed.

 

ifactioncount #AMOUNT

Checks  IF the  current actors  animation has displayed exceeded a set <amount> of frames since the last call to  the primitive resetactioncount.   If so, then return true

 

ifactor #ACTOR

Checks  if  the  current  actor  matches this <actor>(A numerical value of an actor.)  If so, then return true

 

ifactorhealthg (only available in Redneck Rampage RA)

un proven

 

ifactorhealthl (only available in Redneck Rampage RA)

un proven

 

ifactornotstayput

Checks if the  actor  has been executed EX: Seen by the player  or   the actor has seen Duke.  If either has 'seen' each other then return as true,    execute actor code. It also checks  if  the  current actor   is not set as 'stayput,' if not  then return as true, allow activation of the actor code.  (A stayput actor is a sprite that has been 'textured' with the stayput tile image.) Some actors activate immediately (such as 487 and 489) You can spot an actor just before and during its being executed, whats it do? It "falls," drawn above the world and then dropped into place. Another example: When you enter a room and a liztrooper is just standing there, not doing anything. A split second later the trooper comes to life.(the actor isn't free roaming) Normally you shouldn't see to much of this while playing, however if your running at low frame rates then it will almost always occur.

 

ifai $NAME

Checks if the current actor is using the ai <name> that has been previously defined.

 

ifangdiffl #ANGLE  (only available in Duke3D v1.5, NAM, WWII GI)

Checks if the angle between the  current actor and the player  is  less   than <angle>.  If so, then return true. 360 degrees is a value of 2048.

 

ifangdiffg #ANGLE  (only available in Duke3D v1.5, NAM, WWII GI)

Checks if the angle between the  current actor and the player  is   greater  than <angle>. If so, then return true. 360 degrees is a value of 2048.

 

ifawayfromwall

Checks if an actor is away from all or any wall(?hardcode constant is?) If so, then return true. Walls also include sector divisions, the red lines in the game.

 

ifbulletnear

Checks if an actor is near a 'flying' bullet or other projectiles that use impact damage. If so, then return true. This primitive has questionable results. One test I did is to have a sound play if a bullet was near the player(an idea to generate excitement post Crow and Pre Matrix), I never heard the sound. It maybe more useful for A.I. actors? The actual value for "near," the distance is 8 BUILD Units.

 

ifcansee

Checks if the current actor can see a target(player only, makes it hard to make helper bots). If so, then return true.

Dual Function: When using ai functions like  seekenemy  and some others(?all or which?) you will need to  call ifcansee when using ai functions to allow most routines to work 'correctly.' If you do not  call ifcansee  while using an   ai function then the actor will go to the previous position of the player and just stop there!  Effectively ending its routine.

 

ifcanseetarget

Checks if the current actor can see a target(player only, makes it hard to make helper bots). If so, then return true

 

ifcanshoottarget

Checks if the current actor can shoot a target(shoot player only, makes it hard to make helper bots). If so, then return true

 

ifceilingdistl #DISTANCE

Checks if the current actors true center(center of sprite?)  is less than <distance> to the ceiling.  If so, then return true

 

ifcoop (only available in Redneck Rampage RA)

(?The primitive has not been tested or provin' to exist?)

 

ifcount #AMOUNT

Checks if the current actors local counter has reached a <amount> of   counts.  If so, then return true
30 counts is 1 second, 150 counts is 5 seconds and 10 counts is 1/3 of a second.

 

ifdead

Checks if the current actor  had more than 0 strength(was alive) but is now dead(at 0 strength.) If so, then return true. EX:  The actor must have started with some strength to become dead. For some situations(?which?) the primitive ifhitweapon must be called prior to using the  ifdead function.

 

iffloordistl #DISTANCE

Checks if the current actors true center(center of sprite?)  is less than <distance> to the floor. If so, then return true

 

ifgapzl #AMOUNT

Checks if the distance between the floor and ceiling is less than <amount> at the current actors location.  If so, then return true

 

ifgotweaponce #VARIABLE

Checks if <variable> in multiplayer game settings(no weapon spawn, in cooperative or dukematch), is set to 0.  If so, return true and restrict player from getting more than one of each weapon type. EX:  The player can only get this weapon type if they don't already carry it.

Checks if <variable> in multiplayer game settings(no weapon spawn, in cooperative or dukematch), is set to 1.  If so, return true and restrict player from getting the current weapon he is touching/near. EX: The player can not get this weapon type at all.

 

ifhitedge (only available in Duke3D 1.0)

un proven, non functioning?

 

ifhitspace

Checks if the player (player actor is APLAYER or 1405, meaning any player-all share same code) or the nearest player is pressing the use key. This is set in the config file, default is the space bar.

 

ifhittruck (only available in Redneck Rampage)

Checks if the current actor hit(touched) the truck(tags?), if so return true. This does not check if the truck hit an actor.

 

ifhitweapon

Checks if the current actor has been hit by a weapon. This does not check which weapon it was.(Makes it hard to check weapon types and make helper bots)

 

ifinouterspace

Checks if the current actor is in outerspace. "Outerspace" means when the sector is parallaxed and the texture is one of these space textures(84-89 inclusive) and the ceiling or (?what if both?) floor palette on the BigSpace texture is 0. If so, then return true. This will instantly kill the actor with out a spacesuite(the game doesn't have a working spacesuite code.)

 

ifinspace

Checks if the current actor is in space. "Space" means when the sector is parallaxed and the texture is one of these space textures(80-89 inclusive). If so, then return true.

 

ifinwater

Checks if the current actor is  underwater.(a sector with a lotag of 2) If so, return true.

 

ifwind (only available in Redneck Rampage RA)

un proven

 

ifmotofast (only available in Redneck Rampage RA)

Checks if the current actor motorcycle is moving fast. The defined speed is hardcoded.

 

ifmove #NAME

Checks if the current actor is using the predefined  movement <name>.

 

ifmovecount #NAME (only available in Duke3D Lameduke 1-3-95Beta)

 

 

ifmultiplayer

Checks if the current multiplayer game is in cooperative mode. If so, return true.

 

ifnocover (only available in Redneck Rampage)

un proven

 

ifnosounds

Checks if the current actor is not playing any sounds. If so, then return true.

 

ifnotmoving

Checks if the current actor is still moving within the game freely.  If so, return true.  Ex: If an actor is "stuck" between walls (such as at joining points or an a.i actor monster stuck near a door) - at which point the operate(open and check) primitive can be used to allow the stuck actor to try and free himself. (Smart A.I.)

 

ifonboat (only available in Redneck Rampage RA)

Checks if the current actor is on the boat(?tile num?). If so, then return true.

 

ifonmoto (only available in Redneck Rampage RA)

Checks if the current actor is on the motorcycle(?tile num?). If so, then return true.

 

ifonmud (only available in Redneck Rampage RA)

Checks if the current actor is on mud(tile 7889). If so, then return true.
Causes player to move slow or Motorcycle Slides.

 

ifonwater

Checks if the actor is in above or near the water surface(sector with a lotag of 1.) If so, return true.

 

ifoutside

Checks if the actor is outside(a sector with a parallaxed surface.) If so, return true.

 

ifp #CONDITION

Checks if the current <condition> is true. If so, then return true. EX:  If player is doing this <condition> then do this.

Legal values for the <condition> parameter:

Value

Common name

Hardcoded Routines

1

pstanding

standing

2

pwalking

walking

4

prunning

running (only returns true if the run key is used, auto run will not work)

8

pducking

ducking

16

pfalling

falling

32

pjumping

jumping

64

phigher

higher than current actor

128

pwalkingback

walking backwards

256

prunningback

running backwards

512

pkicking

kicking (needs to be weapon one, not quick kick-Hardcoded, different routine)

1,024

pshrunk

smaller than the normal size by a certain amount

2,048

pjetpack

using a jetpack

4,096

ponsteroids

using steroids

8,192

ponground

on the ground/surface (this includes anything that can be stood on, including solid sprites)

16,384

palive

alive (not dead)

32,568

pdead

dead (not alive anymore)

65,536

pfacing

looking at the current actor

 

ifpdistg #AMOUNT

Checks if the players distance from the current actor is less than <amount> If so, then return true. A value of 1024 is equivalent to the largest grid size in Build.

 

ifpdistl #AMOUNT

Checks if the players distance from the current actor is less than <amount>. If so, then return true. A value of 1024 is equivalent to the largest grid size in Build.

 

ifpdrunk (only avalable in Redneck Rampage RA)

Checks if the current player actor is drunk.(meter level?) If so return true. The defined level of alcohol is Hardcoded. (??)

 

ifphealthl #AMOUNT

Checks if the players health is less than <amount>. If so, then return true.

 

ifphealthg #AMOUNT

Checks if  the players health is greater than <amount>. If so, then return true.

 

ifpinventory #ITEM #AMOUNT

Checks if <item> is not equal to <amount> If so, then return true. Look at the description again,  you will notice this does not test a less than, it tests a not equal to. In the original CONs it appears as if it is testing an 'if it is less than.' but its not. This has been determined several times by different editors over the years attempting to properly use 'ifpinventory.'  Its not really consistent with the way other primitives work, but then again these are the CONs.  Legal values for <item> can be found below.

    If you want to test if the player has a given amount of inventory( does #ITEM have #AMOUNT ), try this example code:

    ifpinventory #ITEM #AMOUNT { nullop } else { optional lines of code }

    Notice the  nullop, this will allow this primitive to be used as:     ifpinventory is not equal to amount, it is equal, so do this

    The following is an example of using inventory items as Variables, this was pulled out of  NewWorld 3 TC for DN3D v1.3!(by James Ferry.)  The TC also contains many other longer examples of this type of function (about 1000 lines or so), to control the flame-thrower's fuel, the credit clips, and the buying/purchasing, as well as the persuading. A mile-stone in CON Hacking. This is the code for the blue flag during a CTF type game. The code checks if the player is on the other team (If so, give them the red flag) or its own team (If so, take the red flag away). This code has been tailored for this example.

    ifpdistl FLAG_CAPTURE_DIST ifhitspace // close enough and hitting space

    {

      ifpinventory GET_FIRSTAID 2 { } else // is the team red

        { addinventory GET_FIRSTAID 4 quote 163 } // if so, give flag

      ifpinventory GET_FIRSTAID 3 { } else // is the team blue and has flag

      {

        addinventory GET_FIRSTAID 1 // take the red flag away

        quote 164 // and tell them they have scored

      }

    }


You can look at the syntax in this fashion    ifpinventory #VARIABLE #AMOUNT
To give you more of an idea how powerful inventory items can be to a CON Scripter.

 

Heres a simple little trick using ifpinventory:

    else ifp pjetpack
    {
        ifaction PJPHOUVER
         {  { ifpinventory GET_JETPACK 50 { }   // if the jetpack amount is >= 50 do nothing
                else addinventory GET_JETPACK 1600 // restore jetpack to full amount
            }
              ifactioncount 4
                 resetactioncount
         }
         else action PJPHOUVER
         break
    }

You no longer need to worry about running out of fuel. The jetpack will count down to 4%, then restart at
100%. Try this code with the night-goggles. The above example is how the items where meant to be handled
in the CONs, but don't let that fool ya, there more powerful than simply testing out item amounts.

 

 

Values for ifpinventory <item>

Value

Common name

Hardcoded Routine

GET_STEROIDS

GET_HEATS

GET_BOOTS

GET_SHIELD

GET_SCUBA

GET_HOLODUKE

GET_JETPACK

GET_FIRSTAID

GET_ACCESS

 

ifplayersweapon WEAPON#x (only available in Duke3D Lameduke 1-3-95Beta)

Checks to see which <weapon#x> the player used to attack with. Which player <weapon#x> hit the current actor.

Valid values for <WEAPON#x>:

Lameduke Weapons
#ID Common Name
WEAPON1 OTHERSHOTSPARK
WEAPON2 SHOTSPARK1
WEAPON3 BULLET
WEAPON4 HEAVYHBOMB
WEAPON5 RPG

 

ifrespawn

Checks if the current actor is an item(weapons, ammo, etc.) or an A.I. actor(monstors,) currently active(code is being executed.) If so return true.  If both factors are not met then it will return false.

 

ifrnd #NUM

Generates a random probability of something happening. The <num> value is divided by 256(100%). Example, a <num> of  128 would result in a 50% chance of happening. So a <num> of  256 would happen all the time. (Formula: <num>/256 = # = %).

 

ifsizedown (only available in Redneck Rampage RA)

un proven

 

ifskill #NUM (only available in Duke3D Lameduke 1-3-95Beta)

Checks if skill level is <num> If so, then return true. (Skill 1-4)

 

ifspawnedby #ACTOR

Checks if the current actor was spawned by <actor>. If so, then return true.

 

ifspritepal #NUM

Checks palette <num> to see if it matches the current actors palette. If so, then return true.

See the primitive 'spritepal' for palette values and explanations.

INTRODUCTION:

Palettes refer to color groups indexed with a number between 0-25. While some
of these numbers have special use in Duke3d, many are open for
level-designers or code-writers. We’ll take a look at some.

MISSING CODE IN GAME.CON / INTRODUCING "IFSPRITEPAL":

The boss from the first episode shows up as a regular player in later
episodes, but acts differently. However, they both use the same sprites, so
how is this done? A close look at the code shows the secret:

ifspritepal 0 { } else ...

It’s that "ifspritepal" that does the trick. A quick look at the MAP file
shows that the first episode boss has a palette of "0" while the
"minibosses" of later episodes are set to palette "21". Check out this code:

ifcount THAWTIME { ai AIBOSS1SEEKENEMY spritepal 21 }
else ifcount FROZENDRIPTIME { ifactioncount 26 { spawn WATERDRIP
resetactioncount } }

Yes, after the miniboss thaws out, and a quick check shows that only the
miniboss can be frozen, he’s set back to palette 21. In fact this same code
shows up for BOSS2, look under "ifaction ABOSSxFROZEN". Now here’s some
homework, 3drealms has all the code for a "mini" BOSS3 to get frozen, but
forgot to put in the thaw code, those two lines above. Your assignment is to
copy those two lines to the correct position, you have two examples in the
BOSS1 and BOSS2 code. Now you can add "mini" BOSS3s to your levels!

ADDING NEW ACTORS THE EASY WAY:

If this used anywhere else? Yes, the one other place this kind of code is
used is in the TROOPER section. And once again it’s palette 21 that’s used as
a key to change actions. So what can we do with this? Let’s add a bunch of
actors! Here’s how:

Let’s make it simple to start, let’s give different weapons to different
ranks. We can use code like this:

ifspritepal 11 { shoot RPG }
else ifspritepal 12 { shoot FIRELASER }
else ifspritepal 13 { shoot SHOTSPARK1 }
else ifspritepal 14 { shoot SHOTGUN ifrnd 128 shoot MORTER }
else ifspritepal 15 { shoot COOLEXPLOSION1 }
else { shoot SPIT }

You get the idea. By the way, that’s just about all you can have them shoot
at you. You can come up with all kinds of mixes, though I would suggest
experimenting with one weaker than normal and one stronger than normal. Say
for Pigcops you have Rookie, Street Cop, Swat Team.

 

ifsquished

Checks if an actor has been squished. Squishing occurs under several situations, being shrunken and stepped on, by being in a space to small exist in(i.e. - falling sector, the ceiling height of the sector is the same height at the floor height of the sector), teleporting to a killer shaped sector, or in a squishing sector.

 

ifstrength #AMOUNT

Checks to see if the current actors health is at <amount> or less.

 

ifsounddist $AMOUNT (only available in Redneck Rampage RA)

Checks to see if the current sound is playing at distance <amount>. If so then return true.

 

ifsoundid $NAME (only available in Redneck Rampage RA)

Checks to see if the current sound <name> is playing. The <name> is the name of the defined sound to play, not the filename.

 

iftipcow (only available in Redneck Rampage)

Checks to see if the current actor is being tipped over, checks if tipping animation is currently being used. If so return True.

 

ifwasweapon $WEAPON

Checks <weapon> to determine which weapon hit the current actor.  This primitive only functions properly if called after the   ifhitweapon  primitive.  If  so, then return true.

Legal values for    ifwasweapon <weapon>: 

 

Value

Common name

Hardcoded Routine

KNEE

SHOTSPARK1 (The Pistol. Chaingun and Shotgun use SHOTSPARK1 aswell - Hardcoded)

RPG

SHRINKSPARK

FREEZEBLAST

FIRELASER

SPIT

RADIUSEXPLOSION (Tripbomb) - (?detonation of or actual?)

COOLEXPLOSION1

Doesn't Hurt Enemies, Fireing arc is off.

FIREEXT

GROWSPARK (only available in Duke3D v1.5, NAM, WWII GI)

Lameduke Weapons
#ID Common name
WEAPON1 OTHERSHOTSPARK
WEAPON2 SHOTSPARK1
WEAPON3 BULLET
WEAPON4 HEAVYHBOMB
WEAPON5 RPG

 

ifvarg $NAME #NUM  (only available in WWII GI)

Checks if the game variable <name> is greater than the value <num>, if so then return true.

 

ifvarl $NAME #NUM  (only available in WWII GI)

Checks if the game variable <name> is less than <num>, if so then return true.

 

ifvare $NAME #NUM  (only available in WWII GI)

Checks if the game variable <name> is equal to value <num>, if so then return true.

See primitive 'setvar'  for some valid pre-set system variables.

 

ifvarvarg $NAME1 $NAME2  (only available in WWII GI)

Checks if the game variable <name1> is greater than game variable <name2>   , if so then return true.

 

ifvarvarl $NAME1 $NAME2  (only available in WWII GI)

Checks if the variable <name1> is less than variable <name2>   , if so then return true.

 

ifvarvare $NAM1 $NAME2  (only available in WWII GI)

Checks if the variable <name1> is equal to variable <name2>   , if so then return true.

 

include $FILENAME

Includes the <filename> into the location where this primitive has been called from. This is typically used to parse or combine multiple CON files to be compiled together as one. You may place these where you see fit, remember the defines all have to be done before you use them amongst the code. The <filename> can only be 13 characters long.

 

isdrunk (only available in Redneck Rampage)

un proven

 

iseat (only available in Redneck Rampage)

un proven

 

Section "J"

none

Section "K"

killit

Removes the current actor from the game map. Effectively "killing" the actor.

 

Section "L"

lotsofglass #AMOUNT

The hardcoded actor spawns <amount> of glass shards. normally used to show a glass pane breaking.

 

larrybird (only available in Redneck Rampage RA)

 

 

Section "M"

mail #AMOUNT (only available in Duke3D v1.5, NAM, WWI GI)

The hardcoded actor will spawn <amount> of envelope sprites up and outwards, they then float to the ground.

 

mamaend (only available in Redneck Rampage RA)

Ending(E2L7) animations and routines for the dieing mamma jackalop(tile 7805 pal 32)

 

mamaquake (only available in Redneck Rampage RA)

Animations and routines for when mamma jackalope jumps, the ground shakes.

 

mamaspawn (only available in Redneck Rampage RA)

Mamma jackalope spawns out a baby to protect her. Every few hits on her causes a baby creation.

 

mamatrigger (only available in Redneck Rampage RA)

 

 

mikesnd

Plays the sound assigned to the microphone sprite in BUILD(the microphone sprite's hitag is the sound number to be played). This seems for use with the microphone sprite only.(Hardcoded behavior)

 

money #AMOUNT

The hardcoded actor will spawn <amount> of dollar bill sprites, up and outwards. It then gently floats to the ground.

 

motoloopsnd (only avalable in Redneck Rampage RA)

Plays the assigned motorcycle engine sound(?filename?) and loops it.(Hardcoded behavior)

 

move $NAME #HORIZONYALSPEEDXY #VERTICALSPEEDZ #INSTRUCTIONS

Defines <name> to a horizontal <horizontalspeedxy> and vertical <verticalspeedz> speed. <instructions> is optional.

Calling Syntax:  move $NAME #INSTRUCTIONS1 #INSTRUCTIONS2

The actor seems to see if it will end in a water sector at the end of its executed a.i. routine, if so, then return true. Effectively considering the boundary between the water and the dry sector as a wall. It maybe used to block them from walking into the water and from jumping into the water.

The known legal values for <instructions> can be found in The Primitive Declaration Document under  ai

LameDuke Special:

move $NAME #HORIZONYALSPEEDXY #VERTICALSPEEDZ #INSTRUCTIONS

Sets a <name> to a horizontal <horizontalspeedxy> and vertical <verticalspeedz> speed. <instructions> is optional. With total in <name>

If <horizontalspeedxy> or  <verticalspeedz> is not set, the con parser asumes 0.

The known legal values for Lameduke <instructions> are:

Value

Common name

Hardcoded Routine

face_player

Faces the player.

geth

Travels in a horizontal direction.

getv

Travels in a vertical direction.

face_to_player

Faces the player slower than  face_player above.

rhr

?

slow_to_stop

Slowly Stop

face_exit

Faces directly away from the player??

houver

Hover

stick_to_floor

Attach self to floor

stick_to_ceiling

Attach seft to ceiling

 

 

music #FLAG FILENAME1 FILENAME2 ...

Defines the MIDI music usage for the game. If <flag> is 0, then the first song would be played at the main title and the second song would be played at the ending of the entire game(allowing a maximum of two songs for <flag> 0.)    If <flag> is 1, 2 or 3 ...then these are used to define each level in each episode <flag>.  The first song <filename1> will be for level 1 and the second song<filename2> is for level 2 ...etc... This is normally defined in the USER CON.

See the RTCM Document "con-user-con" for detailed information.

 

Section "N"

newpic #TILE (only available in Redneck Rampage RA)

Calls for a new tile image to be displayed <num>

 

nuke (only available in Duke3D Lameduke 1-3-95Beta)

Spawns a sprite that resizes, grows and shrinks very quickly with two explosions.(Hardcoded action - can not alter the tile order, etc...)

 

nullop

Another way to signify empty braces - {  }. This function means 'do nothing'

 

Section "O"

operate

If the current actor is close enough(distance?) to a swinging door it will open(if closed) or close (if open)

Special Lameduke: This function is automated when actor approaches door.

 

onevent #EVENT_property (only available in WWII GI)

Calls a specified <event> to be processed. Most events are followed by a RETURN code.

See the RTCM document   "con-primitive-declarations" for more information.

 

Section "P"

palfrom #INTENSITY #RED #GREEN #BLUE

The current screen palette of the current player, or closest player, is optionally set by a specified color (<red> + <green> + <blue> equals new color) The <intensity> is how fast it will flash, dropping one level of intensity after each flash. Effectively slowing the flashes down. The values for the parameters can be between 0 and 64 Negative values are considered zero and default values are 0. You may use a higher value than 64 to create 'special effects' as the palette spills into another region.

 

paper #AMOUNT (only available in Duke3D v1.5, NAM, WWI GI)

The hardcoded actor spawns <amount> of paper sprites up and out wards, floating gentle down to the ground.

 

pkick

The current or closest player will use the weapon "quick kick." Using the kick image(Hardcoded arguments) Note, in multiplayer this 'action' is drawn to be seen by the other players.

 

pstomp

The current players, or the nearest player view will shift down(and turn if actor is to the side), and the nearest actor will be squished(if one is present) The player's view will then shift back to normal.(Hardcoded arguments) I found if there are many(alot!) actors near a player that is stomping, it could produce unusual effects.

 

Section "Q"

quote #NUM

Prints quote <num> at the top of the screen. <num> is a predefined by   definequote

See the RTCM Document "con-user-con" for more information.

 

Section "R"

resetactioncount

Resets the current actors  action counter to 0.  This counter counts the number of frames in the animation that an action has displayed.

 

resetcount

Resets the current actors  local counter to 0.  This counter counts the number of frames in the animation that an action has displayed.

 

resetmovecount (only available in Duke3D Lameduke 1-3-95Beta)

Resets the current actors  local counter to 0.  This counter counts the number of frames in the animation that an action has displayed.

 

resetplayer

During a multiplayer game, it will reset a player(usualy used after death). It places him at any(Hardcoded, random?) of the starting positions, with default amounts of ammo, armor and health. Weapons are also set to default. The player is then able to continue playing in the same game without starting the entire game over.

During single player games it will reset the map aswell.

 

respawnhitag

Executes any nine(9) actors who have the same lotag as the current actor's hitag. Effectively respawning.

 

rise (only available in Duke3D 1.0)

un proven, non functioning?

 

rndmove (only available in Redneck Rampage RA)

 

 

runningspeed

 

Section "S"

shadeto #NUM (only available in Duke3D 1.0)

Direct control to the shade values <num> of sprites. Negative numbers work aswell.

 

state #NAME { lines of code } ends

To begin with, there are three main STATEments one must get to know when hacking a GAME.CON type file, they are: action, actor, and state. The state declaration is simply a collection of statements that will execute a subroutine or procedure when called. A state doesn't use any arguments other than the <name> (You can't define or pass parameters in a list)

Creates a function called <name>, <lines of code> can be added within the state.  This must be closed with the ends function.

Internally this calls the predefined state <name> and is treated as a normal function, no additional arguments or routines.

See the RTCM document   "con-primitive-declarations" for full details. Predefined State Functions are listed below.

 

state #NAME

This primitive calls a state function, <name> being the name of the state function called. The state function called must have been predefined above where this line calls from.

See the RTCM document   "con-primitive-declarations" for full details. Predefined State Functions are listed below.

 

Predefined State Functions

The following is a listing of (most) state functions that already exist in the GAME.CON file. You can alter these to your liking, but the default functions are described here. The states are listed in order of appearance (at least in the 1.4/1.5 CON files).

 

state jib_sounds

Plays one of those nice sounds like "What a mess" or "Let God sort em' out".

 

state standard_jibs

Spawns some random body parts.

 

state genericshrunkcode

Shrink an actor and stomp on it if you are within the correct distance.

 

state genericgrowcode (Versions 1.4/1.5 Only)

Make the current actor grow and then explode.

 

state blimphitstate

Spawn an explosion and debris, kill the actor, and some other stuff...

 

state rats

Spawn some rats.

 

state toughgalspeech (Versions 1.4/1.5 Only)

The sounds to play when the tough girl talks.

 

state jibfood (Versions 1.4/1.5 Only)

Make food disappear when shot and spawn some gross jibs.

 

state breakobject (Versions 1.4/1.5 Only)

Code that makes all the breakable objects in versions 1.4 and 1.5 break when shot by the player.

 

state headhitstate

Gets called when player is hurt badly. The screen tilts when the player gets hit and his health is very low.

 

state burningstate

Set the current actor on fire.

 

state steamcode

Update steam sprite, subtract health from player who is near, etc.

 

state random_ooz (Versions 1.4/1.5 Only)

Spawns some ooze.

 

state burningbarrelcode

Code for a burning barrel.

 

state getcode

Gets an item and prepares it for respawn (if necessary).

 

state randgetweapsnds

Plays a random sound when a weapon is picked up by the player. Examples are "Groovy" or "Come get some!".

 

state getweaponcode

Gets the current weapon and prepares it for respawn if necessary.

 

state respawnit

Respawn items in a multiplayer game.

 

state quikget

Get code for the atomic health or other items. Does not cause the sprite to respawn.

 

state quikweaponget

Get code for weapons.

 

state firestate

Updates flames, checks to see if Duke is burning himself, etc.

 

state drop_ammo

Drops ammo if the odds for dropping it are right.

 

state drop_battery

Drops chaingun ammo if the odds for dropping it are right.

 

state drop_sgshells

Drops shotgun ammo if the odds for dropping it are right.

 

state drop_shotgun

Drops shotgun if the odds for dropping it are right.

 

state drop_chaingun

Drops chaingun if the odds for dropping it are right.

 

state random_wall_jibs

Spawns blood on the walls when an enemy is shot and near a wall.

 

state femcode

Takes care of the female actors in the game.

 

state killme

Lets some women say "kill me" when the player presses the space bar near her.

 

state tipme

Lets Duke give some women a dollar bill and say "Wanna dance" or "Shake it baby".

 

state toughgaltalk (Versions 1.4/1.5 Only)

Make the tough girl talk when the player presses [SPACE].

 

state troop_body_jibs

Spawns some trooper body parts.

 

state liz_body_jibs

Spawns some lizard body parts.

 

state standard_pjibs

Spawns some Duke body parts.

 

state handle_dead_dukes

The code for making blood pools, etc. when Duke dies. Also handles the disappearing for Duke's body in multiplayer.

 

state check p_standard

Makes the animations of Duke walking when walking, jumping when jumping, etc.

 

state rf

Changes the cstat to 4 ifrnd 128, else it makes the cstat 0. This is used in flipping corpse sprites so they don't all look the same.

There are too many enemy states to put here, but they all cover the basic artificial intelligence routines for each enemy.

 

state headhitstate { } ends

This is really a custom state that gets called externally in the original CONs when the player gets hit while low on health.(how low?)  The state basically contains the 'wackplayer' primitive only. Remarked out to prevent functioning. You may make use of this state to include other code if you so desire to produce special magical effects or other ideas. See 'wackplayer' primitive.

 

setvar $NAME #NUM (only available in WWI GI)

Sets the variable <name> to be value <num> Will work with negative numbers.

Here's some valid pre-set system variables:

You are not limited to these, but these have special purposes.

Common name

Hardcoded Routine

RESPAWN_MONSTERS        Respawn times for monsters
RESPAWN_ITEMS Respawn times for items
RESPAWN_INVENTORY Respawn times for inventory
MONSTERS_OFF Monsters (1)on or (0)off
FFIRE Friendly fire (1)on or (0)off
LEVEL  Allows you to set the level number. Read-only. The current level number
VOLUME Allows you to set the episode number. Read-only. The current volume number
COOP Allows you to turn on and off CO-OP playability. 0 Off 1 ON
MULTIMODE Mutliplayer Mode on or off   0 Off 1 ON

WEAPON

act the same as for the FIRE event.? Read Only

WORKSLIKE

act the same as for the FIRE event.? Read Only

RETURN

Use by all EVENTs. Allows you to control an event. Change its hardcoded properties.

ZRANGE

Allows you to set the distance from center of shot. Alters the range of fire.
Uses polar co-ordinates in powers of 2
Special Value: 0 Zero automaticly places the shot on target.

ANGRANGE

Allows you to set the angle from the center of the shot. Alters the spread of fire.
Uses polar co-ordinates in powers of 2

AUTOAIMANGLE

Allows you to set the maximum angle that auto aimming will check.


Below is a list of other system variables than can be altered. You can change these for startup using  gamevar,
If you want to change anything later you can simply set them with setvar. I think the flags are ignored or un-settable.

You may wish to paste the following con lines into the GAME.CON under definitions.
All this is doing is making priority over these variables through the CONS.  Instead
of using the defaults the parser uses the ones in the GAME.CON This gives you
direct access, its for the better.

// Pre-set system variables(system)
// These can be changed dynamically in the cons with  setvar

gamevar RESPAWN_MONSTERS 0 0 
gamevar RESPAWN_ITEMS 0 0 
gamevar RESPAWN_INVENTORY 0 0
gamevar MONSTERS_OFF 0 0
gamevar MARKER 0 0 
gamevar FFIRE 0 0 
gamevar LEVEL 0 0 //  (read only)
gamevar VOLUME 0 0 //  (read only)
gamevar COOP 0 0 
gamevar MULTIMODE 0 0 
gamevar WEAPON 0 0 //  (read only)
gamevar WORKSLIKE 0 0 //  (read only)
gamevar RETURN 0 0 
gamevar ZRANGE 0 0 
gamevar ANGRANGE 0 0
gamevar AUTOAIMANGLE 0 0

 

 

setvarvar $NAME1 $NAME2 (only available in WWI GI)

Sets the variable <name1> equal to variable <name2>  So <name1> is now the same variable value.

 

shoot $WEAPON

Allows the current actor to spawn/shoot - eject - fire the specified projectile <weapon>. The direction that the <weapon> is fired depends on the A.I. function of the actor/ current direction facing.

Legal values for  shoot<weapon>: 

 

#ID

Common name

Hardcoded Routine

KNEE

Spawns and Shoots a KNEE (?which?)

SHOTSPARK1 (The Pistol)

Shoots a pistol 'projectile' and creates a flash of light.(?which?)

SHOTGUN (and SHOTSPARK1 - Hardcoded)

Shoots shotgun 'projectiles' and Spawns SHOTSPARK1(?#?)

CHAINGUN (and SHOTSPARK1 - Hardcoded)

Shoots chaingun 'projectiles' and Spawns SHOTSPARK1(?#?)

RPG

Spawns and Shoots a rpg rocket 'projectile'

SHRINKERSPARK

Spawns and Shoots a shrinker spark 'projectile'

DEVISTATORBLAST

Spawn and Shoots

FREEZEBLAST

Spawn and Shoots

FIRELASER (turret actors use this)

Spawns and Shoots a Lizards Laser 'projectile'
(not really a laser-beam, but packets of energy, A Blaster type Gun)

SPIT

Spawns and Shoots Lizard Acidic Spit, inflicting damage(?reminder?)

BOUNCEMINE

Spawns and Shoots a

MORTER

Spawn and Shoots

COOLEXPLOSION1

Spawn and Shoots (Doesn't Hurt Enemies, Firing arc is off.)

BLOODSPLAT1

Spawn and Shoots

BLOODSPLAT2

Spawn and Shoots

BLOODSPLAT3

Spawn and Shoots

BLOODSPLAT4

Spawn and Shoots

GROWSPARK (only available in Duke3D v1.5, NAM, WWI GI)

Spawn and Shoots

#ID Lameduke Weapons
WEAPON1 OTHERSHOTSPARK
WEAPON2 SHOTSPARK1
WEAPON3 BULLET
WEAPON4 HEAVYHBOMB
WEAPON5 RPG

 

sink (only available in Duke3D Lameduke 1-3-95Beta)

Let the  current actor  sink into the water.

 

sizeat #X #Y  (only available in Duke3D v1.5, NAM, WWI GI)

Instantly resizes the current actor to <x> width and <y> height.

 

sizeto #X #Y

Resizes <x> width and <y> height in real time(not instantly)

 

slapplayer (only available in Redneck Rampage RA)

 

 

sleeptime #TIME

Sets the current active actor  to deactivate(sleep) for <time> counts. The current actor is not executed again until it "sees" the player.

 

smackbubba (only available in Redneck Rampage RA)

 

 

smacksprite (only available in Redneck Rampage RA)

 

 

sound #SOUND

Playsback <sound> as a local sound (heard by the closest or current player). This primitive allows multiple occurrences of the <sound> to be played at once, if desired.
Use the number of the defined sound for <sound>

 

soundonce #SOUND

Playsback <sound> as a local sound (heard by the closest player or current player only) The sound cannot be activated again until it has completely finished playing.
Use the number of the defined sound for <sound>

 

soundtag (only available in Redneck Rampage RA)

 

 

soundtagonce (only available in Redneck Rampage RA)

 

 

spawn #ACTOR

Spawns a predefined <actor> into the game at the location it is called.   Some actors can be spawned to create special effects.

The actors below are effected by the spawn primitive differently than other actors. They are:

  • EXPLOSION2 - When this actor is called for the first time, it will create light(Hardcoded routine), which can be used to create some simple lighting effects. The first frame of the explosion always will show unless you draw the first frame blank, you'll always get 'flashes' when trying to make lightning effects.
  • FRAMEEFFECT1 - When this actor is spawned, a blurring effect(Hardcoded routine) is caused on the affected actor. This is used to make the blurring effect when monsters in the game are shrunk with the shrink ray weapon and Duke using steroids.

 

spritepal #PALNUM

Changes the current actor's - current image palette to <palnum>. Legal values for <palnum> are listed below.

Values for spritepal <palnum>

The following is a listing of all the legal values for the spritepal primitive. Palettes can effect 3 different 'layers' of a tile. The easiest way to understand these 3 different 'layers' is by using the stripper sprite. The 3 'layers' are: Background (her skin), Foreground (her clothes), and Minor Foreground (money, accessories, etc).

 

Value

Hardcoded Routine

0

Normal

1

Blue

Designates items(weapons/switchs) as multiplayer game only

2

Red

3 *Normal Turns off killer BIGORBIT sky(actuallly many colors do this)

4

Black

5

All red shades (on all 3 layers) become brown

6

Night Vision Green

7

Yellow-Green

weird yellow cast, could be cool effect, like low pressure sodium lights

8

Light Green

9 *Normal

10

Foreground: Red

key blue turns red

11

Foreground: Light green

key blue turns lt. green

12

Foreground: Light gray

key blue turns white

13

Foreground: Dark gray

key blue turns grey

14

Foreground: Dark green

key blue turns drk. green

15

Foreground: Brown

key blue turns brown

16

Foreground: Dark blue

key blue turns drk. blue

17

Background: Blue / Foreground: Green / Minor Foreground: Blue

blue skin on many actors

18

Exactly the same as 11

key blue turns grey/white

19

Background: Red, Foreground: Gray, Minor Foreground: Red

red skin on many actors

20

Background: Blue, Foreground: Gray, Minor Foreground: Blue

blue skin on many actors

21

Foreground: Red

key blue turns bri. red, used for red key/lock and to designate mini-boss and trooper

22

Foreground: Light gray

key blue turns green

23

Foreground: Yellow

key blue turns yellow - used for yellow key/lock
24 *Normal often stange effects, more blood, etc

25

Minor Foreground: Red

26+ Really weird. Careful, once made this color sometimes the sprite cannot
be changed back. From a distance the sprite appears solid black.

Note: There are advance ways of using the spritepal to actualy identify an actor, Ex: CTF type games such as Duke Arena demonstrate this. NYK came up with this method inorder to allow TRUE CTF game play. Also I think you can use similiar coding to allow two objects to travel together, such as a motorcyle and rider. I may be wrong on the last since it has been so long. (?reminder, review?) See the primitive 'ifspritepal' for additional information.

The following is a palette list you may wish to put in your CONs. It was tested on the Stripper sprite due to the multiple layers. Copy and paste it into the beginning of the GAME.CON or in your USER.CON

// //////////////////////////////////////////////////////////////////////////
// PALETTE
//         Stripper Sprite Layers
//       0 Normal color scheme
//       1 Blue, Designates items(weapons/switchs) as multiplayer game only
//       2 Red
//       3 Normal color scheme, turns off killer BIGORBIT sky(actuallly many colors do this)
//       4 Black
//       5 Normal color scheme? Brown?
//       6 Night Vision Green
//       7 Yellowish-Green
//       8 Light Green
//       9 Normal color scheme
//     10 Red clothing
//     11 Light Green clothing
//     12 Light Gray clothing
//     13 Dark. Gray clothing
//     14 Dark Green clothing
//     15 Brown clothing
//     16 Dark. Blue clothing
//     17 Blue skin - Green clothes
//     18 Light Gray clothing
//     19 Red skin - Grey clothes
//     20 Blue skin - Grey clothes
//     21 Red clothes, used for red key/lock and to designate mini-boss and trooper
//     22 Light Gray clothes
//     23 Yellow clothes
//     24 Normal color scheme, often stange effects, more blood, etc
//     25 Turns accessories red (made her money red)
//     26+ Really weird. Careful, once made this color sometimes
//     the sprite cannot be changed back. From a distance the sprite
//     appears solid black.
//
//      Keycards; Blue uses 0, Red uses 21, Yellow uses 23
// /////////////////////////////////////////////////////////////////////

 

stopsound $SOUND

Stops the <sound> from playing.

 

 

strafeleft (only available in Redneck Rampage RA)

unproven

 

straferight (only available in Redneck Rampage RA)

unproven

 

strength #AMOUNT

Changes the current actors strength (health) to that of <amount>.

 

Section "T"

tearitup (only available in Redneck Rampage RA)

unproven

 

tip

Starts the current or closest player's "tipping" animation routine(Hardcoded action - can not alter the tile order, etc...)

 

tossweapon

This primitive spawns(tosses) the player's currently selected weapon when the player dies. The weapon then becomes an item(minor actor) that can be obtained.

 

Section "U"

useractor useractor #INSTRUCTIONS $NAME #STRENGTH {actor code} { AI_FUNCTION code} enda  (available in DN3D v1.5, NAM, WWII GI)

See the RTCM document   "con-primitive-declarations" for all the details.

 

Section "V"

none

 

Section "W"

wackplayer (only available in Duke3D v1.3 , v1.5,  NAM, WWII GI)

Tilts the the screen to one side. The players head is tilted.(Hardcoded routine) Most commonly used for blows to the head or other body jarring effects.
Generaly called with the  'state headhitstate'  state. 'wackplayer' may be called directly. Calling Syntax:  wackplayer

 

weapon#x (only available in Duke3D Lameduke 1-3-95Beta)

Weapons 1-5

 

Section "X"

none

 

Section "Y"

none

 

Section "Z"

none

 

 

-