.CON  Introduction  v3-27-2002  Release 2  © RTCM Corvin

Doc Info | Introduction | CON Syntax | CON Process and Safety Resources
Restore Original CONs | Using Hacked CONs | Hacked CONs in Multiplayer

The following information pertains to any BUILD game using  Todd Replogles CON Script System. Developed at 3DR while working on Duke3D. 

The supported games are listed in categories. Games that share the same line have very similar CONs:

  • [LameDuke Beta1.3.95, Duke3Dv1.0, Duke3Dv1.2, Duke3Dv1.3Shareware]
  • Duke3D v1.0, v1.3, v1.5, NAM, WWII GI, Extreme PaintBrawl
  • Redneck Rampage, Rides Again, Redneck Deer Huntin'
  • (EDuke will be covered elsewhere)

Compatibility:  Although CONs are included with each game, there are differences with the scripts, with that said. This Document mainly focuses on the Duke v1.3/v1.5 category, as listed above. There is support for the other games listed.

 

For Completeness here are the Copyrights and Authors of the original CONs that come with each game, the primary CON names are also listed:

  • LameDuke Beta (Duke Nukem IIID Script Code) 1995 3D Realms Entertainment  By Todd Replogle - GAME.CON
  • Duke Nukem 3D Script Code (c) 1996 3D Realms Entertainment  By Todd Replogle - GAME.CON
  • NAM Script Code (c) TNT / Heikki & Tuomo Korva 1998   Modified internal weapon routines Matt Seattler - GAME.CON
  • WWII GI Script Code (c) TNT / Tuomo Korva 1999  Enhanced CON system by Matt Seattler - GAME.CON
  • Extreme Paintbrawl Script Code 1998 Creative Carnage, LLC by Carlos Cuello - PAINT.CON
  • Redneck Rampage Script Code (c)
  • Redneck Rampage Rides Again Script Code (c)
  • Redneck Deer Huntin' Script Code (c)

Introduction to CON files.

The CON files are plain text files that contain a form of C/C++ (a popular programming language) , a tad bit of Pascal and other programming experiences that where needed as the game was developed. The overall reference to this script language is generally known as 'CON Scripts' , 'CONstructed Scripts' , 'DukeC Script' or the traditional 'CONtrol Scripts' 

There are three .CON files that come with Duke3D(4 to 5 usually come with other BUILD games, which will be covered later) The ones in Duke3D are the USER.CON, DEFS.CON and GAME.CON   The GAME.CON is the primary con file to which all others are included and loaded.(Note: other BUILD games may have there primary con file named something different. This is normal and I'll explain why later.)  As you read on you will discover that the GAME.CON is the most powerful of the bunch, since it contains most and eventually all the scripted routines and executions. Beginners should stay away from the GAME.CON to ensure that it does not discourage you. The USER.CON and DEFS.CON are simply two forms of files that provide definitions for the GAME.CON to refer to. Depending on your style of coding or organization you have other possibilities of how many CONs are actually used. You can place all the code into the GAME.CON if the scripts are placed in proper order, everything must be defined prior to using them in code. This is really a poor method of coding and much harder to work with but it may be necessary time to time. Its much better to use all three CONs or create your own CONs in order to keep things easy to reference to. Each of these files will contain scripted code.

A script language is different than a true compiled language ('an executable' such as duke3d.exe)  A true compiled language runs at actual machine level (object code linked directly with the computer), while a scripted code is interpreted by the executable(duke3d.exe.) That is, the game reads from a script(CONs) to gather and execute all functions, variables and data referred, CONtrolling certain aspects of the game. However before the interpreter can use a scripted code, it must compile it first. Read on.

When you start up your game you always see the script being compiled and checked for errors, mostly Syntax and structure. The three files are parsed(combined) into a single .CON file, the primary (which is still the GAME.CON but the USER.CON and DEFS.CON are included / combined with it.) The compiled code eventually becomes part of a temporary file for the game to access. For the most part during the compiling phase many of the words become digits (numerical values) and spaces are removed, compacting the CONs into an external 'executable,' and made 'part of' the interpreter for faster code retrieval. (instead of having the game compile the code during the game, for each function it is served.

The possibilities of altering the game to behave the way you want is one of the major reasons Duke3D outlived Shadow Warrior even with a tweaked BUILD engine that Shadow Warrior has. Shadow Warrior use internal assemble code (mathematical language) for its 'scripts' that actually allowed the game to execute faster and smoother. Compare the two games on your system. You will see what I mean. Please note Shadow Warriors has no CONs but this site provides a bunch of tools to edit and patch Shadow Warriors internal hardcoded variables to produce a greater customized add-on for it. I do know of one person that has made a handful, hats off to him. Although there is more possibilities for patch's. If you hex edit exe's, try to come up with some new 'Temp Patchers'  to increase the editing abilities for Shadow Warrior. Just remember  you can not distribute any register files.

On the bright side the second release of Duke3D(v1.5) includes more options to alter the game, additional primitives and functions where added. These include the ability to add completely new actors. This was one of two major sellers for v1.5 (The #1 major seller was its new bots, by Ken Silverman-these are hardcoded)  NAM and WWII GI are essentially Duke3D v1.5 under the hood, and share these 'bonuses' aswell. Ontop of that,  NAM itself  includes a modified-hardcoded weapon system. Making the Weapon system more ideal for custom made weapons. (required for NAM conventional weapons) WWIIGI advanced on that idea and has moved nearly all of the weapon system out to the CONs, giving you precise control over weapons and ammo. WWIIGI also introduced a real Variable system and introduced control over key events. Of course many more CON features.  BTW - Yes you can interchange just about every file with each other between the BUILD Games, more than likly you will end up converting .CONs, .ART tile parameters,  maps (maps will need to be filled again after conversion.) However since the games are so close in design, it shouldn't take to long.

Alright now, to edit a con file you do not really need allot of knowledge of programming, in some cases you won't need any. So don't hesitate in trying. To open the cons, use any plain text editor (such as Wordpad, Notebook or the DOS editor) At first glance they may seem a bit complex, but skim through the con files one at at time and try to associate terms in the script to monsters or items etc with things you have seen in the game. You may find out that some of the stuff makes sense to you. After your all done, take a break, then review them again. Now think of something you would like to change in the CONs. Read as many FAQ's and documents you can to help you understand enough of the scripts that the information will lead you to the answers you seek. Keep in mind that the easiest and effective CON to modify for beginners is the USER.CON See the RTCM document "con-user-con" for further information.

For a large array of information on other CONs, see the corresponding documents. The "con-primitive-declarations" document that explains some of the more complex and unusual forms of scripting. The information below, CON Syntax and the sections following are knowledge all users should examine for general handling of the CONs. once you understand the handling processes I would suggest you further indulge into modifying the existing script code that the game developers have written for the game. Over time you will see the results of your tinkering improve. If you need further explanation about anything, notify Corvin and he will update the docs for you.

The WWIIGI section of this CON guide was derived directly from Matt's Duke3D Insider / WWII GI Enhancements  and  Matt's WWII GI Enhancements. Some EDuke Material was also reviewed for inclusion in this document.

CON Syntax

As with any programming language or script, there are syntax rules you need to follow to prevent compiling errors. In Duke3D and other .CON based BUILD Games, those errors are almost always fatal. You will know if you have a syntax/structural errors as soon as the game compiles the .CONs. Ultimately, if errors are found you will be presented a question from the compiler "Do you want to use the internal defaults (Y/N)?". When you answer yes to this question, Duke3D will then automatically load the standard set of CON files directly from the master .GRP file, by-passing your cons located externally in the game directory. The game will run normal. Using a text editor with lines numbers would benefit you here as part of the compile errors include the line numbers of the errors.

-CON Syntax Rules

  1. Comments: 
    These are remarks or reminders that you can type with in a Script to make notes for yourself or others.
    There are two types of comment line delimiters.:

      The double dash  //   -Everything after //  is commented out. The remark can only extend to the end of the line where it null outs (assumed closed)
      The  /* */   -Everything between the /* and */ is commented out and can span several lines.

  2. Comment Spacing: 
    There must be correct spacing when using remarks.

    The double dash // must have atleast one space after it. Simple example:

      //This remark is incorrect    while    // This remark is the correct spacing.

    The /*  and */ must have a space after /*  and before  */  A Simple example:

      /*see*/  is incorrect while  /* see */  is the correct spacing.

    Note:  There is no restriction on the letter case within the confines of the remarks. You may use lower and upper.

     

  3. Statement blocks are delimited by  {  and  }  and are NOT comment lines. They are strictly for code. There must be a space after {  and before  }. If you use one { then there must be one } to 'close it. In the CONs its best to line up the start and end. Such as:
    Example
        {
            code here
        }
  4. Character case is important,  primitive keywords must be in all  lowercase.   Defined constants  are all  UPPER CASE.
  5. "add"  primitives are subject to unusual conditions.  These limits are usually explained in the primitive tabulet.
  6. ifxxxx  primitives generate a Boolean true or false and behave like    if..then..else statements.  Most of the ifprimitives  use the same syntax,  ifxxx condition { code } else { code }, however a few have no condition (if thisthing is this) but simply are Boolean which will branch the same way by design. In otherwords, they are the same as IF...THEN...ELSE... structure you would find in any other programming language. These primitives are the most powerful primitives in D3D.  Further details on ifxxxx primitives can be found in the Declaration Document.

CON Process and Safety resources.

We really covered the process in which your game handles the original CON files above in the introduction above. I suggest you reread it, should be the second paragraph in. Now I will list and explain to you the 'Safety features' to protect the games original CON files from damaging your purchased game permanently. Don't let the word "damaging" scare you since this is far from anything devastating. Read on.

  1. Goto your Duke3D game directory (or your BUILD game that supports 3DRealms/Tod Repolegee scripted based CONs)
  2. You may notice that there are already three or more .CON type files present. Don't ever worry about overwriting or losing the games original CON files. The CON files that exists in the directory are redundant information and are not at all needed for the original game to run as designed. Let me explain further, The game contains the original CON files in the .GRP file (see BUILD FAQS) as well as stored on your Commercial CD in two locations, for a total of three locations where they are 'backed up'. So its safe you see. Are you still not convinced? Read on.
  3. To ensure you that the game runs fine without .CON files being present in the games directory, delete all of the files that have an extension of .CON
  4. Load and run the game as you would normally. As the game prepares to launch you will see that the CON files are still being compiled by your game even though you have deleted them from the games directory. The game defaulted from searching the directory to scanning and using the .CONS in the master .GRP file. So its safe, do you understand and believe me now?. You can not destroy your game beyond a recoverable state. See below.

Restoring the Original commercial CON files.

To bring back or restore the Register CDs original CON files, you'll have four immediate options. Read on.

  1. Method: CD Restore-Copy;
    This method is for novice or beginners. Simply place your Games CD into your drive and goto the games directory on the CD. You will see the CON files present just as they where on your Hard Drive. Copy them from CD to HD and this will restore the original cons.(Note: some of the other games where packaged differently and may not openly have .CONS present. But they are there, you may need to use method 4 below.)
  2. Method: BUILD tool-Extract;
    Obtain this tool from your CD, KEXTRACT.EXE . Place it in your games directory and at a command prompt or virtual prompt, type KEXTRACT DUKE3D.GRP *.CON  This will extract the files from the .GRP file and Restore the originals. This method is obviously for more experienced users and for further info on this tool read one of many BUILD FAQS.
  3. Method: CD Restore-.GRP;
    This method is used to completely restore your .GRP file if the internal CONs are suspected of corruption. Simply copy your .GRP file from the CD to your HD and then read step 2 above.
  4. Method: RE-Install; 
    Completely 'uninstall' or remove the game from your computer, then reinstall it.

Methods 3 and 4  may never be needed, since the game by itself has not / not capable of corrupting the .GRP

 

Using Hacked Con's (CON files that others have modified and you have obtained)

Lets start off with downloading and obtaining pre-modified CON files. Go check out the CON Download page and pick out something simple but interesting. Once you have downloaded the compressed archive, read on.

  1. Delete all the .CON files in your games directory and any previously installed files. (See the Default Component Document to view a clean folder.)
  2. Now uncompress the archive you have downloaded into your game directory. (This is done with many 'ZIP' type programs, such as WinZip)
  3. Read the included Readme files for any special instructions. (If there to hard, download another one)
  4. Load and run your game as you would normally. The games engine will first check to see if there are .CON files loose in the game directory. In this case the game will use the new .CONs you have supplied. (If they are named the same as original, most hacked cons are)
  5. Once your in the game, look for away to trigger the new coding in the new CONs, such as fire a weapon or frag a monster.
  6. Before 'installing' more CON files ensure you remove the ones you have previously 'installed' and any associated files. This is recommended to ensure you don't get a buildup of miscellaneous files.

Using Hacked Con's in MULTIPLAY

There are some rules that need to be obeyed with muliplay. Ensure to read and practice them at all times to ensure smooth and error free gaming.

  1. Get the CONs you want and place them in your game folder. (Read above for more details)
  2. To keep the game fair and in Sync (loosing Sync makes the game unplayable) each multiplayer must be using the EXACT SAME .CON files.
  3. All supporting files such as .art, .map  and sound  .voc/.wav  should be exactly the same on all players systems to help the game retain a good Sync.

If you have a slow machine or are using unusually large files, especially demanding sounds and pixel .art. You can typically throw the entire game off. To ensure you are running at best performance See the Online / Multiplayer Documents for tips and tweaks.