by gerolf » Tue Sep 08, 2020 2:27 pm
With the introduction of Raze, I am sure many of you are wanting to mod Duke Nukem 3D. The following guide will explain the roles of each CON file that comes with Duke Nukem 3D and how to manipulate them, but this guide assumes a few things:
-you have little to no programming knowledge or experience.
-you have a copy of the Atomic Edition (though, other versions also work with these changes, but the tutorials are using this version specifically).
-while this will be aimed at Raze, these tutorials should work in any DN3D port that supports custom CON files
Please, understand that this is targeted towards beginners. Most tutorials I see are aimed at people that have at least some programming knowledge, which I find makes it hard on novices to get started. These will attempt to explain what the code means while also showing ways for you to edit the game. This will NOT cover editing art and level design (that's for a different thread).
For the record, I am not an expert. Nothing I'll cover is really anything "new", and there's more than likely documentation elsewhere covering the exact same stuff, but I figured why not try to see if I can help anyone out who finds other tutorials to be difficult to follow. This is not the definitive guide to editing DN3D, but it should be enough to get you started at the very least. I hope people will find this information to be useful. Anyways, with that said...
What you need:
-You will need Wordpad, Notepad, Notepad++, or any other similar app that you prefer.
-You will need to place the 3 CON files (USER.CON, GAME.CON, and DEFS.CON) in your Raze folder. When you run Raze, it will run these custom CON files.
Now, what does each CON file mean and represent?
The color yellow will be used for anything
USER.CON specific, red for anything
GAME.CON specific, and blue for
DEFS.CON specific.
CON file info:
USER.CON (User Configuration File) –
Editing the User Configuration file (USER.CON) is a great way to modify DN3D, and this is the CON file we will be working with the most throughout this guide. Essentially, this file is used to control many parts of the game. For example: enemy hitpoints, weapon strength (including blast radius), text strings (messages, episode names, level names, etc), par times, and much more. While I can't go over EVERYTHING, I am going to go over enough to get you started! This file is the best for beginners to mess with because it shows direct change in the game. Many might find themselves fully satisfied with what can be done with USER.CON, and will not need to edit GAME.CON or DEFS.CON.
DEFS.CON (Definitions Configuration File) –
This file is essentially a list of numbers that are defined by phrases. The reason for this is so that a programmer doesn't have to remember the numbers; they just need to remember the phrases. So when adding to DEFS.CON you would write a phrase tied to a number so you'd be able to remember the phrase without needing to remember the number, but you can look at DEFS.CON to look up a number/phrase and when the game loads DEFS.CON, the phrases are converted back to their defined numbers for the machine to understand. Unless you intend on making major changes to the game, like rewriting actors or adding in new features that are not present currently, you more than likely will not need to mess with DEFS.CON. The more you edit GAME.CON, the more likely you'll need to edit DEFS.CON, though, and if all you are doing is USER.CON edits then you usually shouldn't have to mess with DEFS.CON. This guide won't have any DEFS.CON specific tutorials because it is generally the CON file you will not bother with until you have enough experience to do so, and it goes beyond the purpose of this guide.
GAME.CON (Game Configuration File)-
This file tells the game to load up DEFS.CON and USER.CON, as well as being home to a lot of actor code. This is the instructions that tell the game to do various things like making animation sequences. This file is not as straight forward as USER and DEFS. It can be very complicated to edit and takes time to learn and understand what all is in it and what can be changed. The purpose of this tutorial session is to familiarize you with the files, but going over everything in relation to GAME.CON goes beyond the scope of this guide. I will cover what I find to be the easiest things you can change, and give you some example tutorials that you can try out on your own that are specific to GAME.CON.
Now you should have a basic understanding of what each CON file is for. Now, let's get started with USER.CON. Open it up with your text editor of choice, and follow along.
USER CON TUTORIALS:
Getting started:
Spoiler:
So... How do you edit these files today? Well, not too differently from how you would've done it back in the day. You just need a text editor like WordPad or NotePad, a keyboard, and a mouse! Right click the USER.CON file you just pasted into the test folder, and select "open with" and select WordPad or NotePad (or whatever). Whichever you prefer. Personally, I find either to work just fine, but Notepad++ is most likely the best for this. You can also edit CON files through SLADE if you prefer.
Now that you've got it opened, take a look at the text, but don't change anything yet, read the notice at the top until you get down to "// MISC GAME SETTINGS" and from there just glance over USER.CON and see if you can make sense of anything for yourself. . .
You should notice something almost immediately, and we're going to test it out for ourselves.
Take an extra look at this (just search for SWEARFREQUENCY if you cannot find it):
Code: Select all
define SWEARFREQUENCY 100 // The lower, the less.
define CAMERASDESTRUCTABLE NO // YES
Can you guess what SWEARFREQUENCY means? The lower, the less? Let's leave it alone for now, we don't need Duke to cuss less now do we? For those unaware, the "//" is a sign that this is a "comment", so usually when you see "//" there will be some helpful information following it. Look at the very next line, which is the one we will be messing with:
Code: Select all
define CAMERASDESTRUCTABLE NO // YES
This is a very clear example of how useful USER.CON editing can be to make/add a few extra effects to your map. Read this line as if it were a question. Camera destructible (yeah, they made a typo didn't they? don't change that though)? No. This means that the security cameras you see throughout the game that usually control the security monitor screen views cannot be shot and destroyed. They are bullet proof, rocket proof, etc. What if we want our cameras to be able to break? Well, simply change the code above to this:
Code: Select all
define CAMERASDESTRUCTABLE YES // YES
You can change // YES to // NO if you want to, but the game does not read anything that is commented with "//" as a command, so the game ignores that bit. You could even just remove // YES altogether if you wanted to.
From there, save the file in the text editor with your new change. Then, run the game and warp to E1L2 and shoot at the security camera that surveys the area around the erotica book store. You will see that instead of just taking your hits, it now breaks into pieces! Now, go to the monitor in the book store and you will discover that when you shoot a camera, the security monitor loses the feed from that camera. Pretty cool right? Definitely would add something to Dukematch don't you think? Well, before you get too excited, remember that if you intend on using your edited CONs for online play, ALL players MUST use the same edited CON, so be sure to send it to all that intend on playing in your multiplayer game.
If you want to revert back to the old behavior, simply revert the YES back to a NO again, and you're all set. Pretty simple so far? Let's move on to something else.
Altering Game Messages:
Spoiler:
So now you know how to open and manipulate the USER.CON. You have now seen firsthand a change in the game simply by changing a NO to a YES. Now, let's take this a step further to something that may be useful for your new level. Let's say you want to give the player a secret hint or two in your new level. Maybe Duke flicks on his night vision goggles and you cleverly put a hidden message "type DNBETA" or "type DNALLEN" that can only be seen with the goggles on. Maybe Duke uses a monitor and you put a message on the screen for the same reasons. Maybe you hide it somewhere like in E1L1 with the "867-5309" secret. These commands have no use for you the way they are now, but what if we changed what message pops up to be something useful for your map? What if you want to ensure that when someone types these cheats a message displays that tells them the map is from you? There's so many things you could do and it is a very simple edit just like the starter tutorial, and you can explore the USER.CON yourself and find other text strings that can be changed to fit your level, but for now we will focus on altering these cheat codes to be useful for your Duke scenario:
Simply click "Find" with WordPad or Edit/Find with NotePad and do a search for "MAJOR STRYKER" this is what you should find:
This is the message that displays when DNALLEN is typed in-game. Do we really need this message for our map? No, so let's change it to something else. Remember, you are limited to 64 characters, so don't write a wall of text here. I'll let you decide what you want to type in to replace "BUY MAJOR STRYKER". Keep it ALL CAPS just like the rest of the strings.
Next do a search for "PIRATES SUCK!" and you will find:
This is the message that displays when DNBETA is typed in-game. Once again, 1996 was a long time ago. I think we can live without this piracy taunt. Change "PIRATES SUCK!" to your own message, once again remembering 64 character limit. Keep it ALL CAPS just like the rest of the strings.
Now, save your progress and run the game. Type in DNBETA as a cheat to see one message, DNALLEN to see the other. Now, you have two secret messages that can only be found by typing these codes in, and most players aren't going to expect this change. They'll either catch the message by surprise or you can make a note of it in your projects TXT file/forum post if you want to give player's a heads up, or you can find a way to convince the player to type these commands somehow through your map's design. Now, let’s cover the other messages you can change..
Many of the messages you may not want to change, but if you change the art of your project to reflect a certain theme, you may want to change some of these messages. For example, a "PORTABLE MEDKIT" might not make sense in an Army of Darkness inspired scenario, but something like "BAG OF HEALING" might fit the theme of your map better. If you want to change other messages, there are a few lines that say <Please leave blank> - just leave them as is! Other messages appear when Duke activates something in the game. Whether it's LOCKED/UNLOCKED or other text, these can all be changed to your liking or for use in your map. One example is this one:
Code: Select all
definequote 102 WE'RE GONNA FRY YOUR ASS, NUKEM!
This is displayed when you walk into the trap at the end of E1L2, and you can change the text and reuse the effect in your own map but now with a message of your own (changing the sound will be discussed at a different time)! There are a few other text strings that you can alter to display a message, so with the knowledge you have now you should be able to easily change the messages in the game to your liking. There are a few lines that are leftovers from beta builds of DN3D that are currently useless, so you will only want to edit messages you can confirm are present in-game.
Changing Level, Episode, Difficulty Titles, and adjusting Par Times:
Spoiler:
Open USER.CON and search for "E1L1.map" you should find this line:
Code: Select all
definelevelname 0 0 E1L1.map 01:45 00:53 HOLLYWOOD HOLOCAUST
definelevelname 0 0 means just that, define the level name. The first zero means Episode 1, the second zero means it is the first map (they start from 0 instead of 1). E1L1.map (notice that Duke uses Episode/Level whereas Doom and Quake use Episode/Map) is just the name of the map file to tell the game that this is the first map in the first episode. Leave the numbers alone. You can change the .map file name to your own user map, and the game will call for your map file instead of the base game maps.
The numbers after E1L1.map are the par times for beating the level. 01:45 is the standard par time, while 00:53 is 3DR's "best time" par time.
HOLLYWOOD HOLOCAUST is the title of the level when it loads. You see ENTERING HOLLYWOOD HOLOCAUST when it loads up.
While you could just name your map file and have the player load it up through USERMAPS, if your plan is to make more than one level in a set then there really isn't much reason not to at least alter the par times and level names of your map set to reflect the new designs!
Simply change the min/seconds but be sure to keep it like: XX:XX (that's 5 characters) and don't try to make it longer or shorter than 5 characters. You may repeat this as many times as you need to, in any of the episodes you plan to replace the levels for.
Here's an example just in case you don't follow what I'm saying.Look at this line again:
Code: Select all
definelevelname 0 0 E1L1.map 01:45 00:53 HOLLYWOOD HOLOCAUST
To add your usermap change this code to look like this - replaceing "myfilename" with the name of your map file, changing the X's into numbers for your par time, and then replace MYFILENAME with the map's name without the map extension.
Code: Select all
definelevelname 0 0 myfilename.map XX:XX XX:XX MYFILENAME
Just be sure not to exceed 32 characters in your level name, spaces included. Be sure to save your edits and test them out in game. Now let's move on to changing the episode and difficulty titles..
This is just as easy as changing the par times and level names. Let's say you don't want to be limited to replacing the game's scenarios (3 city episodes, 1 space episode) and want to give your episodes titles that reflect your new episodes, here's how you will do this... If you didn't already notice that the code for the episode names is only a few lines above where you changed the level and par time names:
Search for "Volume" and you should find this:
Code: Select all
// Volume titles cannot excede 32 characters.
definevolumename 0 L.A. MELTDOWN
definevolumename 1 LUNAR APOCALYPSE
definevolumename 2 SHRAPNEL CITY
definevolumename 3 THE BIRTH
Volume is just another way of saying "Episode". Remember the warning says don't exceed (they made a typo, not me) over 32 characters. 0-3 are the same sort of situation we discussed earlier, 0 is truly "1" and so on.
Simply change the names of the episodes to your liking and save your progress, once again testing the change in-game to ensure you did everything correctly.
You should be a pro by now at changing text to display what you want it to in DN3D, so if you were able to do any of the tutorials before this one, then changing the difficulty names is not any different..
Search for "Skill" (though honestly if you followed the last two tutorials, you should be able to see this section without even needing to do a search). You should see this:
Code: Select all
// Skill titles cannot excede 32 characters.
defineskillname 0 PIECE OF CAKE
defineskillname 1 LET'S ROCK
defineskillname 2 COME GET SOME
defineskillname 3 DAMN I'M GOOD
Again, just like before, don't exceed 32 characters. You should see a pattern by now in how easy it is to change simple things like this with CON editing. Once again, don't forget to save and test your new episode selection screen!
Working with Sound and Music in USER.CON:
Spoiler:
Use
this as a reference for knowing which MIDI is which.
Open USER.CON, search for "Music will not" give that a read, and then look for this code:
Code: Select all
// Music for title and end
music 0 GRABBAG.MID BRIEFING.MID
The comment is incorrect. BRIEFING.MID plays during Episode 4's intro movie. GRABBAG.MID is Duke Nukem 3D's theme song. The "0" means that one song is the menu song and the other is the episode 4 movie song. Try switching their order around like this:
Code: Select all
// Music for title and end
music 0 BRIEFING.MID GRABBAG.MID
Now run the game and see the change. You could replace both with GRABBAG.MID to get the song to play on the menu and in the Episode 4 movie intro like this (note that this does not loop the song):
Code: Select all
// Music for title and end
music 0 GRABBAG.MID GRABBAG.MID
What if you want there to be no music here? Just make the code look like this:
Code: Select all
// Music for title and end
music 0
So really, all you need to do is change the names of the MIDI files around to change the order of the music tracks in the game. You can also remove music altogether by removing the text mentioning the .MID file.
What if you want to add your own custom music? There are a few ways of doing this:
1) When you make a USERMAP file, or play someone else's map. The default song will be DETHTOLL.MID. When you release a usermap without CON changes but want custom music all you need to do is rename the midi the same as the map file name. So for example:
When you run the game and select user maps, select your map and the MIDI track will play.
2) You could name your MIDI the same as a midi in the game. Place it in your folder and run the game. Whenever the title of the MIDI you placed in the folder is called for from USER.CON, it will play your copy of the file instead. The problem with this method is say you want to use the song you replaced later from the original game? Follow method three
3) Place a midi in your test folder, but make sure it's not named anything from DN3D's midi tracks. For example,
PASSPORT.MID. Now go to USER.CON and rename "stalker.mid" to "PASSPORT.MID" and run the game. Now PASSPORT.MIDI plays on E1L1, but you can still use stalker.mid elsewhere.
Outside of DOS, you can use other file types as well, so let's try that. Let's use
this for testing (click on the 3 dot icon next to the speaker icon to download the OGG file). Place this OGG file into your test folder, and right click the OGG file, and click rename. Rename it to "spring" so the file will be called: spring.ogg (this is so you don't have to use too many characters for the song name)..
Now, go back to USERCON and let's rename GRABBAG.MID to spring.ogg. When you run the game you will now hear the OGG file.
Editing sounds isn't too different from editing music. Replacing sounds with different sounds from the game is done the same way as swapping midi files. So you would either name your new sound the same as a game sound to replace it, or edit the CON file to load up a new sound effect. In DOS, VOC is the only format you'll want to use. It claims WAV support but it doesn't seem to work 100%, but with Raze and other source ports WAV, OGG, and FLAC should work in addition to VOC. With that said, there are a few additional things you can change through USER.CON for sound files.
Do a search for "ABOUT CHANGING SOUND FX" give this section a good read to understand the limitations of DOS Duke, but most modern ports allows you to use other sound file formats like OGG as we showed with the music tutorial. So with that said, let's search for "DUKE_BOOBY " you will see this code:
Code: Select all
definesound DUKE_BOOBY BOOBY04.voc 0 0 255 4 0
This is the "I should've known those alien maggots booby-trapped the sub.." line from Toxic Dump.
As the text you read before said:
- The first 2 numbers define a random pitch variation range. They can be positive or negative numbers.
- The 3rd number is a priority flag.
- The 4th number is a bit parsed set of technical variables that identify the type of sound it is in the game.
- The 5th number is volume adjustment.
Generally, you will want to leave these alone, but let's try something out. Replace the first two zeros with a higher number, let's say 500:
Code: Select all
definesound DUKE_BOOBY BOOBY04.voc 500 500 255 4 0
Run the game and warp to E1L4. You'll notice that Duke sort of sounds like the "shrunk Duke" from DNF now. Going through most of the DUKE related sounds and adding these same numbers will cause the same effect if you want Duke to be higher pitched sounding in your levels. Now try this instead:
Code: Select all
definesound DUKE_BOOBY BOOBY04.voc -666 -666 255 4 0
Again, run the game and warp to E1L4. Now Duke sounds like a demon!
So generally, you won't want to edit past the first two numbers, unless you are adding a custom sound that needs to behave differently than it does in-game. You'll only want to edit the first two numbers if you want different sound pitch ranges. So if you put 100 and 500 for example, the sound will randomly play various pitches between those two numbers. Put them as the same number in both spots like in the tutorial if you want the sound to remain at a constant pitch.
Now, we are pretty much finished with the most basic changes you can make to USER.CON. Nothing too interesting so far is probably what some are thinking, but these are very useful edits to make your sets have a feel of their own. Now, let's get a little more involved with USER.CON.
-Altering Duke, His Guns, and Inventory:
Spoiler:
Duke can be altered in a few ways if you desire. Maybe you want Duke to be able to have more health, or maybe you want him to move faster/slower. Maybe Duke is injured in your map and can't get above a certain health point and can't run as fast? Whatever the case, here's a few things to look at:
Let's start with altering Duke's health values..
Do a search for "MAXPLAYERHEALTH" and you should see the following:
Also search for "MAXPLAYERATOMICHEALTH" which is close to the above line, you'll see this code:
Code: Select all
define MAXPLAYERATOMICHEALTH 200 // doubles as maxarmor.
The first line defines the max health Duke can have when starting a level and through conventional health powerups, I would try to keep it between 1-999. The second line defines the max health Duke can have through Atomic Health powerups. Again, try to keep it between 1-999. Save your changes and test them out for yourself.
Here's another line that you can change to your liking - search for "RETRIEVEDISTANCE" and you will see:
This code determines how far Duke can "stretch" to grab items.
This is where the "advanced" stuff starts. 844 is quite a random number and if you don't understand the reasons for the number it can be confusing. So, you have to do some guess work. Obviously, you know that "844" is the distance that the game calls for and that's the standard behavior. So try doubling the number to make Duke stretch further. You'll see that the higher you raise this number, the further out Duke will grab stuff. Get it too high, and Duke will collect items that aren't even in his line of sight! Lower it to 0 and Duke can't grab anything!
So now you know how to alter Duke's health and his ability to retrieve objects. Let's mess with two other things that you might find useful for your map project!
Search for "STARTARMORHEALTH" you will see this line:
This code states that when Duke starts a level (pistol start), he starts with 0 armor. Let's say you've made a very challenging set of maps, but don't want to make the game easier by giving Duke higher amounts of health. Instead, just let Duke start out with armor when the game begins. This makes the level slightly easier, but not nearly as much as buffing up Duke's hit points. Change the code to this if you want Duke to have full armor:
Alternatively, you could make it 50 or 75 to give Duke "Used Armor" instead.
Now, one other thing that you might want to alter about Duke would be his speed. Do a search for "RUNNINGSPEED" and you will find this line of code:
Code: Select all
define RUNNINGSPEED 53200
define GRAVITATIONALCONSTANT 176
The first line controls Duke's speed, while the second line controls Duke's gravity. With the first line, lowering the number will make Duke move much slower, but decrease it too low and Duke won't move at all! Also, increasing this number of course makes Duke go faster, but you will discover that Duke's "Speed" isn't just about speed as much as it's about Duke's friction. Try raising it to just 63200 and see how hard it is to control Duke, bump it up to 73200 and Duke will almost always slide into the fence on the rooftop of E1L1 and kill himself, in the DOS game you'd receive an error instead. Personally, I would only add a little to the number, like 56600 if you want Duke to run more like Doomguy. I would lower it to 43000 if you want to "cripple" Duke into only being able to walk. Anything lower than 40000 tends to keep Duke from bobbing when walking, and he goes a little too slow if you get the number too low.
So the second line we mentioned earlier:
This code changes the gravity constant in the game. Basically, the lower the number, the lighter Duke falls, the higher, the harder he falls. You'll notice that this code doesn't just change Duke's behavior, but it also makes the pipe bombs act differently as well as a lot of the other effects like blood splats and things that would "fall" to the ground. This is something you may be better off leaving alone, but if you are making a space themed episode this may be worth messing with in your case. When you increase the number Duke can't make a lot of the jumps he used to be able to make, and if you lower it then he floats down slower. So this is an effect you will want to test with your map.
Now you know how to change Duke's health, armor, speed, and gravity. Let's move on to altering Duke's weaponry!
Before we edit the weapons, let's look at how you'd make the ammo items give you more ammo than they currently do. Go back to the "// Enemy strengths (hit points)." area you were at earlier and look for this line of code:
This line states that when you pick up a pistol magazine, you get 12 bullets. The rest of the ammo pickups are directly below this line. Changing these values will allow you to give Duke more or less ammo when he picks up ammo pick-ups! That's all there is to that. Note that this does not change the total rounds Duke shoots before reloading, it only changes how much ammo Duke gets from picking up the magazine.
Then do a search for "MAXPISTOLAMMO" and you should see this:
You will find the other weapons here as well. This code defines how much ammo Duke can have for each weapon. Double these numbers if you want the max ammo amounts from Doom. Now, onto changing the power and blasts of the weapons! If you want to learn how to change the amount of ammo Duke gets when he picks up the pistol weapon, that will be covered in GAME.CON!
To start with editing weapons, do a search for "// Weapon Strengths" and you will see the following code for the weapon strengths. Let's take a look at part of this code:
Code: Select all
define KNEE_WEAPON_STRENGTH 10
define PISTOL_WEAPON_STRENGTH 6
define HANDBOMB_WEAPON_STRENGTH 140
Then, directly below this you will see this:
Code: Select all
// For direct hits with the rocket launcher,
// this amount is actually doubled. Otherwise,
// damage values depend on distance. The
// further, the weaker.
define RPG_WEAPON_STRENGTH 140
With this in mind, let's make Duke's kick as strong as a direct RPG hit. As the text says, a direct hit from the RPG is double the integer 140. So 140x2= 280. While we're at it, let's make the Pipe bomb (code calls it HANDBOMB) have that amount of strength, too. This is what your code should look like to test these changes:
Code: Select all
define KNEE_WEAPON_STRENGTH 280
define PISTOL_WEAPON_STRENGTH 6
define HANDBOMB_WEAPON_STRENGTH 280
Test that out and see what you think! You may notice now that Duke can kick his way through most of the common enemies and the pipe bomb has a higher chance of dealing a direct kill compared to the original. You'll also notice that the stronger kick sends enemies flying back further than they usually would! There's a problem though, while the pipe bomb may now deal more damage, it should have a wider blast radius too to compensate the added power. Do a search for "// Various blast radius distances" and here's the code you'll look for:
Since we doubled the strength of the pipe bomb, let's just double the blast radius too. So 2500x2= 5000. Here's your replacement code:
Save your progress and test this out now. You'll see that you must be a bit further away now from the pipe bomb to not hurt yourself now and the damage dealt seems to be grander than before.
So with this you should understand how to edit the weapons for the most part, but there's a few other things in USER.CON that relate to weapons you might find to be useful. Let's start with the Shrink Ray. Want to make it more like a rail gun+BFG hybrid? Simple. Go back to the weapon strength section you were just at, and change this code:
to this
Code: Select all
define SHRINKER_WEAPON_STRENGTH 1000
Now, the weapon only takes a few hits to kill bosses and one hit kills pretty much everything else! It no longer shrinks enemies though, but it instead pushes their corpses much like the kick did from before! While I prefer the Shrink Ray as is, changes like this can make it to where you can create a weapon replacement of your own. You'll be able to change the text strings relating to the Shrink Ray to match your new weapon, and adding new art will help too!
The Trip-Bombs have some really neat featues you can mess with outside of their strength and blast radius. You can alter how they appear in the game. Search for "TRIPBOMBLASERMODE". Let's take a look at the code:
Code: Select all
define TRIPBOMBLASERMODE 0 // 0 = always visable
// 1 = transluscense
// 2 = invisible w/o IR goggles
// 3 = totally invisable
By default, the game uses 0. Try changing it to 1, 2, or 3. Don't try other numbers because they won't work. This simply changes how the red laser appears in-game.
While I could go on, most of what I haven't covered is stuff you can easily figure out just by repeating what you've been doing, but I'd like to mention one more weapon before moving on... The Freezethrower!
The Freezethrower has a lot of controls besides just the strength control within USER.CON that you can change to make the gun do a few things differently. Here are the lines in question we will be going over, to find them just search for the wording that's in ALL CAPS:
- this is pretty self explanatory. When this is set to YES, the freeze rays can bounce back and if they hit Duke, it will hurt him. Simply remove YES and type in NO to make it no longer do this.
Code: Select all
define NUMFREEZEBOUNCES 3 // 0 - 255
- this is the amount of times the freeze projectiles will bounce around before shattering if they don't hit a target. Set it to a number between 0-255 and test the changes you've made.
- how long it takes for the dripping effect to happen when enemies begin to thaw out. Lower it to make the effect happen sooner, increase to make it happen later, but don't make it longer than the thaw time because you won't see the effect.
- when the enemy will thaw out. Again, increase/decrease the value to make this take longer or less time.
That's all I have for weapons, but with this knowledge you should be able to change Duke's behavior and weaponry!
If you've been following along so far then you pretty much already know how to edit the inventory.
Do a search for "//Players' inventory amounts" and you will see that changing these isn't much different from changing the ammo amounts. Increase the values to make them last longer, decrease to make them last less. Remember, you will need to test your changes to see what effect they have in the game!
Altering Duke's Adversaries:
Spoiler:
Duke has quite the roster of enemies, but did you know that their hit points actually aren't hard-coded? There's a few things you can do to make them easier or harder to battle with.
Do a search for "// Enemy strengths (hit points)." and you will find this:
Code: Select all
define TROOPSTRENGTH 30
define PIGCOPSTRENGTH 100
define PIG_SHIELD_AMOUNT1 75
define PIG_SHIELD_AMOUNT2 50
You will see a lot of other hit points for the other enemies, but for this tutorial will we just go over a few things since the rest are all done just the same, but you will need to tinker around and see which ones actually have an effect and which ones are leftover code from previous versions of DN3D. Most people don't feel the need to edit the existing enemies unless they change the art files as well, but let's say you made a level where the Pig Cops are really, really prepared for Duke's arrival... Let's look at this code again:
Code: Select all
define PIGCOPSTRENGTH 100
define PIG_SHIELD_AMOUNT1 75
define PIG_SHIELD_AMOUNT2 50
PIGCOPSTRENGTH is the overall hit points of the Pig Cop, while PIG_SHIELD covers the two various "Used Armor" droppings the Pig Cops will occasionally drop when they die. If the Pig Cops are really ready for some action, change the code to this:
Code: Select all
define PIGCOPSTRENGTH 175
define PIG_SHIELD_AMOUNT1 50
define PIG_SHIELD_AMOUNT2 25
Now the Pig Cops can have extra HP to simulate they have more armor on than usual and give Duke less armor % when they die. It's about as simple as that in making enemies stronger. Just make the values larger numbers, and to make them weaker just make the values smaller numbers.
Remember those annoying robot mouse things? Let's make them more or less annoying depending on how you look at it. Search for "ROBOTMOUSESTRENGTH"...
Here's the line:
45? Let's make that more like... 1... like this:
You will either be insanely amused or insanely annoyed!
Another thing to search for is "PLAYDEADTIME" and you will see that lowering the number from 120 to 0 makes the Assault Trooper/Captain come back to life quicker when they choose to "play dead", and increasing the number past 120 makes it take longer than it does in the standard game.
Also, search for "RESPAWNACTORTIME" and set that to 0 instead of 768 and check out the game on Damn, I'm Good. Makes the enemies respawn instantly! Another thing to search for as well would be "SPAWNAMMOODDS" which is at 96. Increase the number to make enemies more likely to drop ammo, decrease it or set to 0 to make them drop less or none at all.
Now you should understand the purpose and use of USER.CON. There's more that can be done with USER.CON, but I have covered the basics. Please note the following tutorials and info below are more challenging than what has been presented above. If you have trouble understanding it, it takes more patience to edit GAME.CON than editing USER.CON. If you are happy with USER.CON editing and feel the guides below are too tough or hard to follow, maybe you're better off just sticking with USER.CON editing for now. If you are ready for more, then let's move on, but first:
Commenting CON files:
Spoiler:
When making changes to USER.CON, or any CON file, you should get in the habit of "//" commenting your changes in the lines if you intend on sharing your files. If you intend on becoming a programmer then you should get use to this habit. Many professors require you to comment your code, and this is an easy way to get the hang of it. Also, commenting your code is useful for you to look back on later to explain the changes you've made. You can also add in comments for extra info or credits. Remember, the game does not pay attention to comments, but other people can read what you write. That's another reason to comment your code is so that other people can learn from it and utilize it for themselves.
Here's an example of what commenting code from the tutorials above would look like:
Code: Select all
define BOSS1STRENGTH 4500 // shoot him in the head!
Another way to comment code is through */ and */ -look at the starting text in USER.CON for an example of how that is done, but here's my example:
Just remember, don't get "/" mixed up with "\".
"\" is not used. Use the "//" to comment in a line, use the "/*" "*/" for commenting elsewhere.
Now, we are finished with the USER.CON session of this guide. Let's move on to GAME.CON. GAME.CON is a much more complicated file than USER.CON. What I intend to do is show you how to do a few things with GAME.CON. Here's a couple routines to try:
GAME.CON TUTORIALS:
-Adjust the ammo the Pistol weapon pick-up gives Duke:
Spoiler:
While you were able to adjust how much ammo a pistol magazine (called a clip in the code) gives Duke in USER.CON, you may have noticed you couldn't adjust the pistol pickups. Well, that's because the way to control that is in GAME.CON.
This should at least get you familiar with how GAME.CON works. Do a search for "actor FIRSTGUNSPRITE". Then, look for this code under it:
Code: Select all
ifgotweaponce 0
break
addweapon PISTOL_WEAPON 48
ifspawnedby FIRSTGUNSPRITE
state getweaponcode
else
state quikweaponget
}
enda
This code is essentially saying "If Duke doesn't have the pistol when grabbing the weapon, give him the pistol and 48 bullets" and then "If Duke spawns with a pistol start, then Duke will crack his knuckles and equip the weapon with 48 bullets, and when picking up another pistol, it will give him 48 more bullets."
If you want to make the game more "realistic" we could change the number 48 to 12. That is the same amount that Duke's magazine holds for the pistol. This change makes the pistol and clip close to being the same. The only difference is if Duke doesn't have the pistol, he will grab it with 12 rounds in the gun. Go to this line:
and change it to
Now when Duke picks up a pistol, it only gives him 12 rounds. Notice that when you start pistol-start levels that Duke still has 48 rounds when starting with a pistol. So this only changes the actual weapon pickup amount.
-Enabling WACKPLAYER:
Spoiler:
WACKPLAYER is a command that is off by default, but when enabled it makes the screen jilt a little at times when Duke takes damage with 25 HP or less. Do a search for "Unrem" you should see this code:
Code: Select all
state headhitstate
// Unrem the following line to invoke screen tilting during
// low player hitpoint damage.
// wackplayer
ends
Let's do what the text said and make the code look like this now:
Code: Select all
state headhitstate
// Unrem the following line to invoke screen tilting during
// low player hitpoint damage.
wackplayer
ends
That's it! Run the game and when Duke is very low on HP the screen will react now.
Altering Enemies & Gore through GAME.CON:
Spoiler:
With USER.CON you were able to change enemy hit points and sounds, but with GAME.CON you can edit quite a bit more, but it can be difficult. I will go over some of the things I think will be most useful:
We'll stick with the Pig Cop for these examples. Do a search for "SHOTGUN_WEAPON 0" and look at this code:
Code: Select all
ifspawnedby PIGCOP
{
addweapon SHOTGUN_WEAPON 0
ifrnd 64
addammo SHOTGUN_WEAPON 4
else ifrnd 64
addammo SHOTGUN_WEAPON 3
else ifrnd 64
addammo SHOTGUN_WEAPON 2
else
addammo SHOTGUN_WEAPON 1
}
These are the Pig Cop's shells that he can possibly have in his shotgun when he drops it. Try changing the values to this:
Code: Select all
ifspawnedby PIGCOP
{
addweapon SHOTGUN_WEAPON 0
ifrnd 64
addammo SHOTGUN_WEAPON 6
else ifrnd 64
addammo SHOTGUN_WEAPON 5
else ifrnd 64
addammo SHOTGUN_WEAPON 4
else
addammo SHOTGUN_WEAPON 3
}
Save, test the game. Now when the pig cops drop shotguns, the number of shells they may give you have been increased.
Another thing you can do is adjust enemy speed in GAME.CON, again, we will use the PIG COP as an example. Search for "move PIGWALKVELS"and look at this code:
Code: Select all
move PIGWALKVELS 72
move PIGRUNVELS 108
move PIGSTOPPED
PIGWALKVELS is the speed of the Pig Cop when they are walking. PIGRUNVELS controls their faster moving speed. Let's raise them to this:
Code: Select all
move PIGWALKVELS 172
move PIGRUNVELS 208
move PIGSTOPPED
Save and test the game. Now the Pig Cop moves much faster. You can find lines to adjust the other enemy speeds as well. You should have the hang of that by now to be able to find them yourself.
Another cool change you could make is to have it to where the Pig Cops and Enfocers eject brass in their firing animations...
When Duke uses his pistol, shotgun, or chain gun.. you see ejected brass casings falling to the ground. Let's give this effect to the Enforcer and the Pig Cop. We'll start with the Enforcer.
Search for "CAPT_ATTACK" and look at this code:
Code: Select all
ifcanshoottarget
{
sound CAPT_ATTACK
shoot SHOTSPARK1
resetactioncount
}
else
This is the game seeing if the Enforcer can see the player and if so, he will start this attack sequence. To make the Enforcer eject brass in between shots, edit the code to look like this:
Code: Select all
ifcanshoottarget
{
sound CAPT_ATTACK
shoot SHOTSPARK1
spawn SHELL
resetactioncount
}
else
spawn SHELL is what makes this effect work. Putting it under "shoot" so that it happens after his shot is fired. Save, and test this out to see if it worked. The Enforcer should now have bullet casings fly around while he's attacking with his gun!
Now, let's do the same thing for the Pig Cop. Search for the second instance of "action APIGCOCK" and look for this code (there should be three instances of APIGCOCK, we only need to deal with two of them, the last two):
Code: Select all
ifcount 24
{
action APIGCOCK
sound SHOTGUN_COCK
}
Make it look like this:
Code: Select all
ifcount 24
{
action APIGCOCK
sound SHOTGUN_COCK
spawn SHOTGUNSHELL
}
Then, search for the next instance of "action APIGCOCK":
Code: Select all
ifcount 59
{
action APIGCOCK
sound SHOTGUN_COCK
}
Make that look like this:
Code: Select all
ifcount 59
{
action APIGCOCK
sound SHOTGUN_COCK
spawn SHOTGUNSHELL
}
What you've done here is made it to where every time the Pig Cop cocks his shotgun, he will eject a shell casing. When he's prone, the shells can't travel far with him blocking the ejection port of the gun, hey, that's at least my reasoning for why. You can attempt to make him eject brass when he is prone if you want to, but personally I would leave it as-is.
The casings seem to eject based on the direction the player and the enemy are viewing each other, so it isn't always consistent which in real life it wouldn't always be either.
Another fun change you can make in GAME.CON is to alter the amounts of gore when enemies explode.
I'm sure some of you were waiting for this one, so here's a few things you can do in GAME.CON to make more gore in the game. Search for "jibs" starting at the top of GAME.CON and you should find this code:
Code: Select all
state standard_jibs
guts JIBS2 1
guts JIBS3 2
guts JIBS4 3
guts JIBS5 2
guts JIBS6 3
ifrnd 6
{
guts JIBS1 1
spawn BLOODPOOL
} // a badly drawn spine
Try editing it like this:
Code: Select all
state standard_jibs
guts JIBS2 10
guts JIBS3 20
guts JIBS4 30
guts JIBS5 20
guts JIBS6 30
ifrnd 6
{
guts JIBS1 10
spawn BLOODPOOL
} // a badly drawn spine
Now when you blow things up, they have a lot more guts. Test it out, and if you think that it's not enough, add an extra 0 to each. Explore GAME.CON for similar strings like this one and see if you can make other effects have more bits and pieces fly around than they currently do.
Obviously, there's much more to GAME.CON than just these tutorials, but I think these are some easy changes you can make that can help you make further changes elsewhere in GAME.CON with the knowledge you now have. Just be aware that you need to be very careful messing with GAME.CON. There's less room for user error here, so make sure to save often and be able to backtrack if you make a mistake.
The End (For Now):
That's it for now. I feel that I have written quite a bit of info that should help someone who knew nothing know a lot more than nothing about modding DN3D now that you've read from the start to the finish of this tutorial. You've learned all about USER.CON. You've learned what's inside of DEFS.CON (though currently we've had no reason to change anything in there). You've learned what GAME.CON is all about and have even learned a few things you can do inside of GAME.CON. With this knowledge, you should have the ability to look around these CON files and make changes to them, testing them out along the way and seeing what works and what doesn't.
Bottom line: You can say you know how to modify DN3D. There's still more to modding Duke than just CON files. Level design, art design, etc. have not really been covered here because they aren't really specific to CON editing.
I hope someone finds this information useful.
With the introduction of Raze, I am sure many of you are wanting to mod Duke Nukem 3D. The following guide will explain the roles of each CON file that comes with Duke Nukem 3D and how to manipulate them, but this guide assumes a few things:
-you have little to no programming knowledge or experience.
-you have a copy of the Atomic Edition (though, other versions also work with these changes, but the tutorials are using this version specifically).
-while this will be aimed at Raze, these tutorials should work in any DN3D port that supports custom CON files
Please, understand that this is targeted towards beginners. Most tutorials I see are aimed at people that have at least some programming knowledge, which I find makes it hard on novices to get started. These will attempt to explain what the code means while also showing ways for you to edit the game. This will NOT cover editing art and level design (that's for a different thread).
For the record, I am not an expert. Nothing I'll cover is really anything "new", and there's more than likely documentation elsewhere covering the exact same stuff, but I figured why not try to see if I can help anyone out who finds other tutorials to be difficult to follow. This is not the definitive guide to editing DN3D, but it should be enough to get you started at the very least. I hope people will find this information to be useful. Anyways, with that said...
What you need:
-You will need Wordpad, Notepad, Notepad++, or any other similar app that you prefer.
-You will need to place the 3 CON files (USER.CON, GAME.CON, and DEFS.CON) in your Raze folder. When you run Raze, it will run these custom CON files.
Now, what does each CON file mean and represent?
The color yellow will be used for anything [color=#FFFF40]USER.CON[/color] specific, red for anything [color=#FF0000]GAME.CON[/color] specific, and blue for [color=#0000BF]DEFS.CON[/color] specific.
[b][i]CON file info:[/i][/b]
[b][color=#FFFF40]USER.CON (User Configuration File)[/color] –[/b]
Editing the User Configuration file (USER.CON) is a great way to modify DN3D, and this is the CON file we will be working with the most throughout this guide. Essentially, this file is used to control many parts of the game. For example: enemy hitpoints, weapon strength (including blast radius), text strings (messages, episode names, level names, etc), par times, and much more. While I can't go over EVERYTHING, I am going to go over enough to get you started! This file is the best for beginners to mess with because it shows direct change in the game. Many might find themselves fully satisfied with what can be done with USER.CON, and will not need to edit GAME.CON or DEFS.CON.
[i][color=#0000BF]DEFS.CON (Definitions Configuration File) –[/color][/i]
This file is essentially a list of numbers that are defined by phrases. The reason for this is so that a programmer doesn't have to remember the numbers; they just need to remember the phrases. So when adding to DEFS.CON you would write a phrase tied to a number so you'd be able to remember the phrase without needing to remember the number, but you can look at DEFS.CON to look up a number/phrase and when the game loads DEFS.CON, the phrases are converted back to their defined numbers for the machine to understand. Unless you intend on making major changes to the game, like rewriting actors or adding in new features that are not present currently, you more than likely will not need to mess with DEFS.CON. The more you edit GAME.CON, the more likely you'll need to edit DEFS.CON, though, and if all you are doing is USER.CON edits then you usually shouldn't have to mess with DEFS.CON. This guide won't have any DEFS.CON specific tutorials because it is generally the CON file you will not bother with until you have enough experience to do so, and it goes beyond the purpose of this guide.
[b][color=#FF0000]GAME.CON (Game Configuration File)-[/color][/b]
This file tells the game to load up DEFS.CON and USER.CON, as well as being home to a lot of actor code. This is the instructions that tell the game to do various things like making animation sequences. This file is not as straight forward as USER and DEFS. It can be very complicated to edit and takes time to learn and understand what all is in it and what can be changed. The purpose of this tutorial session is to familiarize you with the files, but going over everything in relation to GAME.CON goes beyond the scope of this guide. I will cover what I find to be the easiest things you can change, and give you some example tutorials that you can try out on your own that are specific to GAME.CON.
Now you should have a basic understanding of what each CON file is for. Now, let's get started with USER.CON. Open it up with your text editor of choice, and follow along.
[b][color=#FFFF40]USER CON TUTORIALS:[/color][/b]
[b][color=#FFFF40]Getting started:[/color][/b]
[spoiler]So... How do you edit these files today? Well, not too differently from how you would've done it back in the day. You just need a text editor like WordPad or NotePad, a keyboard, and a mouse! Right click the USER.CON file you just pasted into the test folder, and select "open with" and select WordPad or NotePad (or whatever). Whichever you prefer. Personally, I find either to work just fine, but Notepad++ is most likely the best for this. You can also edit CON files through SLADE if you prefer.
Now that you've got it opened, take a look at the text, but don't change anything yet, read the notice at the top until you get down to "// MISC GAME SETTINGS" and from there just glance over USER.CON and see if you can make sense of anything for yourself. . .
You should notice something almost immediately, and we're going to test it out for ourselves.
Take an extra look at this (just search for SWEARFREQUENCY if you cannot find it):
[code]define SWEARFREQUENCY 100 // The lower, the less.
define CAMERASDESTRUCTABLE NO // YES[/code]
Can you guess what SWEARFREQUENCY means? The lower, the less? Let's leave it alone for now, we don't need Duke to cuss less now do we? For those unaware, the "//" is a sign that this is a "comment", so usually when you see "//" there will be some helpful information following it. Look at the very next line, which is the one we will be messing with:
[code]define CAMERASDESTRUCTABLE NO // YES[/code]
This is a very clear example of how useful USER.CON editing can be to make/add a few extra effects to your map. Read this line as if it were a question. Camera destructible (yeah, they made a typo didn't they? don't change that though)? No. This means that the security cameras you see throughout the game that usually control the security monitor screen views cannot be shot and destroyed. They are bullet proof, rocket proof, etc. What if we want our cameras to be able to break? Well, simply change the code above to this:
[code]define CAMERASDESTRUCTABLE YES // YES[/code]
You can change // YES to // NO if you want to, but the game does not read anything that is commented with "//" as a command, so the game ignores that bit. You could even just remove // YES altogether if you wanted to.
From there, save the file in the text editor with your new change. Then, run the game and warp to E1L2 and shoot at the security camera that surveys the area around the erotica book store. You will see that instead of just taking your hits, it now breaks into pieces! Now, go to the monitor in the book store and you will discover that when you shoot a camera, the security monitor loses the feed from that camera. Pretty cool right? Definitely would add something to Dukematch don't you think? Well, before you get too excited, remember that if you intend on using your edited CONs for online play, ALL players MUST use the same edited CON, so be sure to send it to all that intend on playing in your multiplayer game.
If you want to revert back to the old behavior, simply revert the YES back to a NO again, and you're all set. Pretty simple so far? Let's move on to something else.[/spoiler]
[b][color=#FFFF40]Altering Game Messages:[/color][/b]
[spoiler]So now you know how to open and manipulate the USER.CON. You have now seen firsthand a change in the game simply by changing a NO to a YES. Now, let's take this a step further to something that may be useful for your new level. Let's say you want to give the player a secret hint or two in your new level. Maybe Duke flicks on his night vision goggles and you cleverly put a hidden message "type DNBETA" or "type DNALLEN" that can only be seen with the goggles on. Maybe Duke uses a monitor and you put a message on the screen for the same reasons. Maybe you hide it somewhere like in E1L1 with the "867-5309" secret. These commands have no use for you the way they are now, but what if we changed what message pops up to be something useful for your map? What if you want to ensure that when someone types these cheats a message displays that tells them the map is from you? There's so many things you could do and it is a very simple edit just like the starter tutorial, and you can explore the USER.CON yourself and find other text strings that can be changed to fit your level, but for now we will focus on altering these cheat codes to be useful for your Duke scenario:
Simply click "Find" with WordPad or Edit/Find with NotePad and do a search for "MAJOR STRYKER" this is what you should find:
[code]definequote 79 BUY MAJOR STRYKER[/code]
This is the message that displays when DNALLEN is typed in-game. Do we really need this message for our map? No, so let's change it to something else. Remember, you are limited to 64 characters, so don't write a wall of text here. I'll let you decide what you want to type in to replace "BUY MAJOR STRYKER". Keep it ALL CAPS just like the rest of the strings.
Next do a search for "PIRATES SUCK!" and you will find:
[code]definequote 105 PIRATES SUCK![/code]
This is the message that displays when DNBETA is typed in-game. Once again, 1996 was a long time ago. I think we can live without this piracy taunt. Change "PIRATES SUCK!" to your own message, once again remembering 64 character limit. Keep it ALL CAPS just like the rest of the strings.
Now, save your progress and run the game. Type in DNBETA as a cheat to see one message, DNALLEN to see the other. Now, you have two secret messages that can only be found by typing these codes in, and most players aren't going to expect this change. They'll either catch the message by surprise or you can make a note of it in your projects TXT file/forum post if you want to give player's a heads up, or you can find a way to convince the player to type these commands somehow through your map's design. Now, let’s cover the other messages you can change..
Many of the messages you may not want to change, but if you change the art of your project to reflect a certain theme, you may want to change some of these messages. For example, a "PORTABLE MEDKIT" might not make sense in an Army of Darkness inspired scenario, but something like "BAG OF HEALING" might fit the theme of your map better. If you want to change other messages, there are a few lines that say <Please leave blank> - just leave them as is! Other messages appear when Duke activates something in the game. Whether it's LOCKED/UNLOCKED or other text, these can all be changed to your liking or for use in your map. One example is this one:
[code]definequote 102 WE'RE GONNA FRY YOUR ASS, NUKEM![/code]
This is displayed when you walk into the trap at the end of E1L2, and you can change the text and reuse the effect in your own map but now with a message of your own (changing the sound will be discussed at a different time)! There are a few other text strings that you can alter to display a message, so with the knowledge you have now you should be able to easily change the messages in the game to your liking. There are a few lines that are leftovers from beta builds of DN3D that are currently useless, so you will only want to edit messages you can confirm are present in-game.[/spoiler]
[b][color=#FFFF40]Changing Level, Episode, Difficulty Titles, and adjusting Par Times:[/color][/b]
[spoiler]Open USER.CON and search for "E1L1.map" you should find this line:
[code]definelevelname 0 0 E1L1.map 01:45 00:53 HOLLYWOOD HOLOCAUST[/code]
definelevelname 0 0 means just that, define the level name. The first zero means Episode 1, the second zero means it is the first map (they start from 0 instead of 1). E1L1.map (notice that Duke uses Episode/Level whereas Doom and Quake use Episode/Map) is just the name of the map file to tell the game that this is the first map in the first episode. Leave the numbers alone. You can change the .map file name to your own user map, and the game will call for your map file instead of the base game maps.
The numbers after E1L1.map are the par times for beating the level. 01:45 is the standard par time, while 00:53 is 3DR's "best time" par time.
HOLLYWOOD HOLOCAUST is the title of the level when it loads. You see ENTERING HOLLYWOOD HOLOCAUST when it loads up.
While you could just name your map file and have the player load it up through USERMAPS, if your plan is to make more than one level in a set then there really isn't much reason not to at least alter the par times and level names of your map set to reflect the new designs!
Simply change the min/seconds but be sure to keep it like: XX:XX (that's 5 characters) and don't try to make it longer or shorter than 5 characters. You may repeat this as many times as you need to, in any of the episodes you plan to replace the levels for.
Here's an example just in case you don't follow what I'm saying.Look at this line again:
[code]definelevelname 0 0 E1L1.map 01:45 00:53 HOLLYWOOD HOLOCAUST[/code]
To add your usermap change this code to look like this - replaceing "myfilename" with the name of your map file, changing the X's into numbers for your par time, and then replace MYFILENAME with the map's name without the map extension.
[code]definelevelname 0 0 myfilename.map XX:XX XX:XX MYFILENAME[/code]
Just be sure not to exceed 32 characters in your level name, spaces included. Be sure to save your edits and test them out in game. Now let's move on to changing the episode and difficulty titles..
This is just as easy as changing the par times and level names. Let's say you don't want to be limited to replacing the game's scenarios (3 city episodes, 1 space episode) and want to give your episodes titles that reflect your new episodes, here's how you will do this... If you didn't already notice that the code for the episode names is only a few lines above where you changed the level and par time names:
Search for "Volume" and you should find this:
[code]// Volume titles cannot excede 32 characters.
definevolumename 0 L.A. MELTDOWN
definevolumename 1 LUNAR APOCALYPSE
definevolumename 2 SHRAPNEL CITY
definevolumename 3 THE BIRTH[/code]
Volume is just another way of saying "Episode". Remember the warning says don't exceed (they made a typo, not me) over 32 characters. 0-3 are the same sort of situation we discussed earlier, 0 is truly "1" and so on.
Simply change the names of the episodes to your liking and save your progress, once again testing the change in-game to ensure you did everything correctly.
You should be a pro by now at changing text to display what you want it to in DN3D, so if you were able to do any of the tutorials before this one, then changing the difficulty names is not any different..
Search for "Skill" (though honestly if you followed the last two tutorials, you should be able to see this section without even needing to do a search). You should see this:
[code]// Skill titles cannot excede 32 characters.
defineskillname 0 PIECE OF CAKE
defineskillname 1 LET'S ROCK
defineskillname 2 COME GET SOME
defineskillname 3 DAMN I'M GOOD[/code]
Again, just like before, don't exceed 32 characters. You should see a pattern by now in how easy it is to change simple things like this with CON editing. Once again, don't forget to save and test your new episode selection screen![/spoiler]
[b][color=#FFFF40]Working with Sound and Music in USER.CON:[/color][/b]
[spoiler]Use [url=https://dukenukem.fandom.com/wiki/Music_in_Duke_Nukem_3D]this[/url] as a reference for knowing which MIDI is which.
Open USER.CON, search for "Music will not" give that a read, and then look for this code:
[code]// Music for title and end
music 0 GRABBAG.MID BRIEFING.MID[/code]
The comment is incorrect. BRIEFING.MID plays during Episode 4's intro movie. GRABBAG.MID is Duke Nukem 3D's theme song. The "0" means that one song is the menu song and the other is the episode 4 movie song. Try switching their order around like this:
[code]// Music for title and end
music 0 BRIEFING.MID GRABBAG.MID[/code]
Now run the game and see the change. You could replace both with GRABBAG.MID to get the song to play on the menu and in the Episode 4 movie intro like this (note that this does not loop the song):
[code]// Music for title and end
music 0 GRABBAG.MID GRABBAG.MID[/code]
What if you want there to be no music here? Just make the code look like this:
[code]// Music for title and end
music 0
[/code]
So really, all you need to do is change the names of the MIDI files around to change the order of the music tracks in the game. You can also remove music altogether by removing the text mentioning the .MID file.
What if you want to add your own custom music? There are a few ways of doing this:
1) When you make a USERMAP file, or play someone else's map. The default song will be DETHTOLL.MID. When you release a usermap without CON changes but want custom music all you need to do is rename the midi the same as the map file name. So for example:
[code]nuked.map
nuked.mid[/code]
When you run the game and select user maps, select your map and the MIDI track will play.
2) You could name your MIDI the same as a midi in the game. Place it in your folder and run the game. Whenever the title of the MIDI you placed in the folder is called for from USER.CON, it will play your copy of the file instead. The problem with this method is say you want to use the song you replaced later from the original game? Follow method three
3) Place a midi in your test folder, but make sure it's not named anything from DN3D's midi tracks. For example, [url=https://bitmidi.com/uploads/84045.mid]PASSPORT.MID[/url]. Now go to USER.CON and rename "stalker.mid" to "PASSPORT.MID" and run the game. Now PASSPORT.MIDI plays on E1L1, but you can still use stalker.mid elsewhere.
Outside of DOS, you can use other file types as well, so let's try that. Let's use [url=https://ia802501.us.archive.org/29/items/ETitleA.Vivaldi-TheFourSeasons/1.%20Spring%201%28allegro%29.ogg]this[/url] for testing (click on the 3 dot icon next to the speaker icon to download the OGG file). Place this OGG file into your test folder, and right click the OGG file, and click rename. Rename it to "spring" so the file will be called: spring.ogg (this is so you don't have to use too many characters for the song name)..
Now, go back to USERCON and let's rename GRABBAG.MID to spring.ogg. When you run the game you will now hear the OGG file.
Editing sounds isn't too different from editing music. Replacing sounds with different sounds from the game is done the same way as swapping midi files. So you would either name your new sound the same as a game sound to replace it, or edit the CON file to load up a new sound effect. In DOS, VOC is the only format you'll want to use. It claims WAV support but it doesn't seem to work 100%, but with Raze and other source ports WAV, OGG, and FLAC should work in addition to VOC. With that said, there are a few additional things you can change through USER.CON for sound files.
Do a search for "ABOUT CHANGING SOUND FX" give this section a good read to understand the limitations of DOS Duke, but most modern ports allows you to use other sound file formats like OGG as we showed with the music tutorial. So with that said, let's search for "DUKE_BOOBY " you will see this code:
[code]definesound DUKE_BOOBY BOOBY04.voc 0 0 255 4 0[/code]
This is the "I should've known those alien maggots booby-trapped the sub.." line from Toxic Dump.
As the text you read before said:
[quote]- The first 2 numbers define a random pitch variation range. They can be positive or negative numbers.
- The 3rd number is a priority flag.
- The 4th number is a bit parsed set of technical variables that identify the type of sound it is in the game.
- The 5th number is volume adjustment.[/quote]
Generally, you will want to leave these alone, but let's try something out. Replace the first two zeros with a higher number, let's say 500:
[code]definesound DUKE_BOOBY BOOBY04.voc 500 500 255 4 0[/code]
Run the game and warp to E1L4. You'll notice that Duke sort of sounds like the "shrunk Duke" from DNF now. Going through most of the DUKE related sounds and adding these same numbers will cause the same effect if you want Duke to be higher pitched sounding in your levels. Now try this instead:
[code]definesound DUKE_BOOBY BOOBY04.voc -666 -666 255 4 0[/code]
Again, run the game and warp to E1L4. Now Duke sounds like a demon!
So generally, you won't want to edit past the first two numbers, unless you are adding a custom sound that needs to behave differently than it does in-game. You'll only want to edit the first two numbers if you want different sound pitch ranges. So if you put 100 and 500 for example, the sound will randomly play various pitches between those two numbers. Put them as the same number in both spots like in the tutorial if you want the sound to remain at a constant pitch.[/spoiler]
Now, we are pretty much finished with the most basic changes you can make to USER.CON. Nothing too interesting so far is probably what some are thinking, but these are very useful edits to make your sets have a feel of their own. Now, let's get a little more involved with USER.CON.
[b][color=#FFFF40]-Altering Duke, His Guns, and Inventory:[/color][/b]
[spoiler]Duke can be altered in a few ways if you desire. Maybe you want Duke to be able to have more health, or maybe you want him to move faster/slower. Maybe Duke is injured in your map and can't get above a certain health point and can't run as fast? Whatever the case, here's a few things to look at:
Let's start with altering Duke's health values..
Do a search for "MAXPLAYERHEALTH" and you should see the following:
[code]define MAXPLAYERHEALTH 100[/code]
Also search for "MAXPLAYERATOMICHEALTH" which is close to the above line, you'll see this code:
[code]define MAXPLAYERATOMICHEALTH 200 // doubles as maxarmor.[/code]
The first line defines the max health Duke can have when starting a level and through conventional health powerups, I would try to keep it between 1-999. The second line defines the max health Duke can have through Atomic Health powerups. Again, try to keep it between 1-999. Save your changes and test them out for yourself.
Here's another line that you can change to your liking - search for "RETRIEVEDISTANCE" and you will see:
[code]define RETRIEVEDISTANCE 844[/code]
This code determines how far Duke can "stretch" to grab items.
This is where the "advanced" stuff starts. 844 is quite a random number and if you don't understand the reasons for the number it can be confusing. So, you have to do some guess work. Obviously, you know that "844" is the distance that the game calls for and that's the standard behavior. So try doubling the number to make Duke stretch further. You'll see that the higher you raise this number, the further out Duke will grab stuff. Get it too high, and Duke will collect items that aren't even in his line of sight! Lower it to 0 and Duke can't grab anything!
So now you know how to alter Duke's health and his ability to retrieve objects. Let's mess with two other things that you might find useful for your map project!
Search for "STARTARMORHEALTH" you will see this line:
[code]define STARTARMORHEALTH 0[/code]
This code states that when Duke starts a level (pistol start), he starts with 0 armor. Let's say you've made a very challenging set of maps, but don't want to make the game easier by giving Duke higher amounts of health. Instead, just let Duke start out with armor when the game begins. This makes the level slightly easier, but not nearly as much as buffing up Duke's hit points. Change the code to this if you want Duke to have full armor:
[code]define STARTARMORHEALTH 100[/code]
Alternatively, you could make it 50 or 75 to give Duke "Used Armor" instead.
Now, one other thing that you might want to alter about Duke would be his speed. Do a search for "RUNNINGSPEED" and you will find this line of code:
[code]define RUNNINGSPEED 53200
define GRAVITATIONALCONSTANT 176[/code]
The first line controls Duke's speed, while the second line controls Duke's gravity. With the first line, lowering the number will make Duke move much slower, but decrease it too low and Duke won't move at all! Also, increasing this number of course makes Duke go faster, but you will discover that Duke's "Speed" isn't just about speed as much as it's about Duke's friction. Try raising it to just 63200 and see how hard it is to control Duke, bump it up to 73200 and Duke will almost always slide into the fence on the rooftop of E1L1 and kill himself, in the DOS game you'd receive an error instead. Personally, I would only add a little to the number, like 56600 if you want Duke to run more like Doomguy. I would lower it to 43000 if you want to "cripple" Duke into only being able to walk. Anything lower than 40000 tends to keep Duke from bobbing when walking, and he goes a little too slow if you get the number too low.
So the second line we mentioned earlier:
[code]define GRAVITATIONALCONSTANT 176[/code]
This code changes the gravity constant in the game. Basically, the lower the number, the lighter Duke falls, the higher, the harder he falls. You'll notice that this code doesn't just change Duke's behavior, but it also makes the pipe bombs act differently as well as a lot of the other effects like blood splats and things that would "fall" to the ground. This is something you may be better off leaving alone, but if you are making a space themed episode this may be worth messing with in your case. When you increase the number Duke can't make a lot of the jumps he used to be able to make, and if you lower it then he floats down slower. So this is an effect you will want to test with your map.
Now you know how to change Duke's health, armor, speed, and gravity. Let's move on to altering Duke's weaponry!
Before we edit the weapons, let's look at how you'd make the ammo items give you more ammo than they currently do. Go back to the "// Enemy strengths (hit points)." area you were at earlier and look for this line of code:
[code]define PISTOLAMMOAMOUNT 12[/code]
This line states that when you pick up a pistol magazine, you get 12 bullets. The rest of the ammo pickups are directly below this line. Changing these values will allow you to give Duke more or less ammo when he picks up ammo pick-ups! That's all there is to that. Note that this does not change the total rounds Duke shoots before reloading, it only changes how much ammo Duke gets from picking up the magazine.
Then do a search for "MAXPISTOLAMMO" and you should see this:
[code]define MAXPISTOLAMMO 200[/code]
You will find the other weapons here as well. This code defines how much ammo Duke can have for each weapon. Double these numbers if you want the max ammo amounts from Doom. Now, onto changing the power and blasts of the weapons! If you want to learn how to change the amount of ammo Duke gets when he picks up the pistol weapon, that will be covered in GAME.CON!
To start with editing weapons, do a search for "// Weapon Strengths" and you will see the following code for the weapon strengths. Let's take a look at part of this code:
[code]define KNEE_WEAPON_STRENGTH 10
define PISTOL_WEAPON_STRENGTH 6
define HANDBOMB_WEAPON_STRENGTH 140[/code]
Then, directly below this you will see this:
[code]// For direct hits with the rocket launcher,
// this amount is actually doubled. Otherwise,
// damage values depend on distance. The
// further, the weaker.
define RPG_WEAPON_STRENGTH 140[/code]
With this in mind, let's make Duke's kick as strong as a direct RPG hit. As the text says, a direct hit from the RPG is double the integer 140. So 140x2= 280. While we're at it, let's make the Pipe bomb (code calls it HANDBOMB) have that amount of strength, too. This is what your code should look like to test these changes:
[code]define KNEE_WEAPON_STRENGTH 280
define PISTOL_WEAPON_STRENGTH 6
define HANDBOMB_WEAPON_STRENGTH 280[/code]
Test that out and see what you think! You may notice now that Duke can kick his way through most of the common enemies and the pipe bomb has a higher chance of dealing a direct kill compared to the original. You'll also notice that the stronger kick sends enemies flying back further than they usually would! There's a problem though, while the pipe bomb may now deal more damage, it should have a wider blast radius too to compensate the added power. Do a search for "// Various blast radius distances" and here's the code you'll look for:
[code]define PIPEBOMBRADIUS 2500[/code]
Since we doubled the strength of the pipe bomb, let's just double the blast radius too. So 2500x2= 5000. Here's your replacement code:
[code]define PIPEBOMBRADIUS 5000[/code]
Save your progress and test this out now. You'll see that you must be a bit further away now from the pipe bomb to not hurt yourself now and the damage dealt seems to be grander than before.
So with this you should understand how to edit the weapons for the most part, but there's a few other things in USER.CON that relate to weapons you might find to be useful. Let's start with the Shrink Ray. Want to make it more like a rail gun+BFG hybrid? Simple. Go back to the weapon strength section you were just at, and change this code:
[code]define SHRINKER_WEAPON_STRENGTH 0[/code]
to this
[code]define SHRINKER_WEAPON_STRENGTH 1000[/code]
Now, the weapon only takes a few hits to kill bosses and one hit kills pretty much everything else! It no longer shrinks enemies though, but it instead pushes their corpses much like the kick did from before! While I prefer the Shrink Ray as is, changes like this can make it to where you can create a weapon replacement of your own. You'll be able to change the text strings relating to the Shrink Ray to match your new weapon, and adding new art will help too!
The Trip-Bombs have some really neat featues you can mess with outside of their strength and blast radius. You can alter how they appear in the game. Search for "TRIPBOMBLASERMODE". Let's take a look at the code:
[code]define TRIPBOMBLASERMODE 0 // 0 = always visable
// 1 = transluscense
// 2 = invisible w/o IR goggles
// 3 = totally invisable[/code]
By default, the game uses 0. Try changing it to 1, 2, or 3. Don't try other numbers because they won't work. This simply changes how the red laser appears in-game.
While I could go on, most of what I haven't covered is stuff you can easily figure out just by repeating what you've been doing, but I'd like to mention one more weapon before moving on... The Freezethrower!
The Freezethrower has a lot of controls besides just the strength control within USER.CON that you can change to make the gun do a few things differently. Here are the lines in question we will be going over, to find them just search for the wording that's in ALL CAPS:
[code]define FREEZERHURTOWNER YES[/code] - this is pretty self explanatory. When this is set to YES, the freeze rays can bounce back and if they hit Duke, it will hurt him. Simply remove YES and type in NO to make it no longer do this.
[code]define NUMFREEZEBOUNCES 3 // 0 - 255[/code] - this is the amount of times the freeze projectiles will bounce around before shattering if they don't hit a target. Set it to a number between 0-255 and test the changes you've made.
[code]define FROZENDRIPTIME 90[/code] - how long it takes for the dripping effect to happen when enemies begin to thaw out. Lower it to make the effect happen sooner, increase to make it happen later, but don't make it longer than the thaw time because you won't see the effect.
[code]define THAWTIME 138[/code] - when the enemy will thaw out. Again, increase/decrease the value to make this take longer or less time.
That's all I have for weapons, but with this knowledge you should be able to change Duke's behavior and weaponry!
If you've been following along so far then you pretty much already know how to edit the inventory.
Do a search for "//Players' inventory amounts" and you will see that changing these isn't much different from changing the ammo amounts. Increase the values to make them last longer, decrease to make them last less. Remember, you will need to test your changes to see what effect they have in the game![/spoiler]
[b][color=#FFFF40]Altering Duke's Adversaries:[/color][/b]
[spoiler]Duke has quite the roster of enemies, but did you know that their hit points actually aren't hard-coded? There's a few things you can do to make them easier or harder to battle with.
Do a search for "// Enemy strengths (hit points)." and you will find this:
[code]define TROOPSTRENGTH 30
define PIGCOPSTRENGTH 100
define PIG_SHIELD_AMOUNT1 75
define PIG_SHIELD_AMOUNT2 50[/code]
You will see a lot of other hit points for the other enemies, but for this tutorial will we just go over a few things since the rest are all done just the same, but you will need to tinker around and see which ones actually have an effect and which ones are leftover code from previous versions of DN3D. Most people don't feel the need to edit the existing enemies unless they change the art files as well, but let's say you made a level where the Pig Cops are really, really prepared for Duke's arrival... Let's look at this code again:
[code]define PIGCOPSTRENGTH 100
define PIG_SHIELD_AMOUNT1 75
define PIG_SHIELD_AMOUNT2 50[/code]
PIGCOPSTRENGTH is the overall hit points of the Pig Cop, while PIG_SHIELD covers the two various "Used Armor" droppings the Pig Cops will occasionally drop when they die. If the Pig Cops are really ready for some action, change the code to this:
[code]define PIGCOPSTRENGTH 175
define PIG_SHIELD_AMOUNT1 50
define PIG_SHIELD_AMOUNT2 25[/code]
Now the Pig Cops can have extra HP to simulate they have more armor on than usual and give Duke less armor % when they die. It's about as simple as that in making enemies stronger. Just make the values larger numbers, and to make them weaker just make the values smaller numbers.
Remember those annoying robot mouse things? Let's make them more or less annoying depending on how you look at it. Search for "ROBOTMOUSESTRENGTH"...
Here's the line:
[code]define ROBOTMOUSESTRENGTH 45[/code]
45? Let's make that more like... 1... like this:
[code]define ROBOTMOUSESTRENGTH 1[/code]
You will either be insanely amused or insanely annoyed!
Another thing to search for is "PLAYDEADTIME" and you will see that lowering the number from 120 to 0 makes the Assault Trooper/Captain come back to life quicker when they choose to "play dead", and increasing the number past 120 makes it take longer than it does in the standard game.
Also, search for "RESPAWNACTORTIME" and set that to 0 instead of 768 and check out the game on Damn, I'm Good. Makes the enemies respawn instantly! Another thing to search for as well would be "SPAWNAMMOODDS" which is at 96. Increase the number to make enemies more likely to drop ammo, decrease it or set to 0 to make them drop less or none at all.[/spoiler]
Now you should understand the purpose and use of USER.CON. There's more that can be done with USER.CON, but I have covered the basics. Please note the following tutorials and info below are more challenging than what has been presented above. If you have trouble understanding it, it takes more patience to edit GAME.CON than editing USER.CON. If you are happy with USER.CON editing and feel the guides below are too tough or hard to follow, maybe you're better off just sticking with USER.CON editing for now. If you are ready for more, then let's move on, but first:
[b][i]Commenting CON files:[/i][/b]
[spoiler]When making changes to USER.CON, or any CON file, you should get in the habit of "//" commenting your changes in the lines if you intend on sharing your files. If you intend on becoming a programmer then you should get use to this habit. Many professors require you to comment your code, and this is an easy way to get the hang of it. Also, commenting your code is useful for you to look back on later to explain the changes you've made. You can also add in comments for extra info or credits. Remember, the game does not pay attention to comments, but other people can read what you write. That's another reason to comment your code is so that other people can learn from it and utilize it for themselves.
Here's an example of what commenting code from the tutorials above would look like:
[code]define BOSS1STRENGTH 4500 // shoot him in the head![/code]
Another way to comment code is through */ and */ -look at the starting text in USER.CON for an example of how that is done, but here's my example:
[code]/*
my message - myname
*/[/code]
Just remember, don't get "/" mixed up with "\".
"\" is not used. Use the "//" to comment in a line, use the "/*" "*/" for commenting elsewhere.[/spoiler]
Now, we are finished with the USER.CON session of this guide. Let's move on to GAME.CON. GAME.CON is a much more complicated file than USER.CON. What I intend to do is show you how to do a few things with GAME.CON. Here's a couple routines to try:
[b][i][color=#FF0000]GAME.CON TUTORIALS:[/color][/i][/b]
[b][i][color=#FF0000]-Adjust the ammo the Pistol weapon pick-up gives Duke:[/color][/i][/b]
[spoiler]While you were able to adjust how much ammo a pistol magazine (called a clip in the code) gives Duke in USER.CON, you may have noticed you couldn't adjust the pistol pickups. Well, that's because the way to control that is in GAME.CON.
This should at least get you familiar with how GAME.CON works. Do a search for "actor FIRSTGUNSPRITE". Then, look for this code under it:
[code]ifgotweaponce 0
break
addweapon PISTOL_WEAPON 48
ifspawnedby FIRSTGUNSPRITE
state getweaponcode
else
state quikweaponget
}
enda[/code]
This code is essentially saying "If Duke doesn't have the pistol when grabbing the weapon, give him the pistol and 48 bullets" and then "If Duke spawns with a pistol start, then Duke will crack his knuckles and equip the weapon with 48 bullets, and when picking up another pistol, it will give him 48 more bullets."
If you want to make the game more "realistic" we could change the number 48 to 12. That is the same amount that Duke's magazine holds for the pistol. This change makes the pistol and clip close to being the same. The only difference is if Duke doesn't have the pistol, he will grab it with 12 rounds in the gun. Go to this line:
[code]addweapon PISTOL_WEAPON 48[/code]
and change it to
[code]addweapon PISTOL_WEAPON 12[/code]
Now when Duke picks up a pistol, it only gives him 12 rounds. Notice that when you start pistol-start levels that Duke still has 48 rounds when starting with a pistol. So this only changes the actual weapon pickup amount.[/spoiler]
[b][i][color=#FF0000]-Enabling WACKPLAYER:[/color][/i][/b]
[spoiler]WACKPLAYER is a command that is off by default, but when enabled it makes the screen jilt a little at times when Duke takes damage with 25 HP or less. Do a search for "Unrem" you should see this code:
[code]state headhitstate
// Unrem the following line to invoke screen tilting during
// low player hitpoint damage.
// wackplayer
ends[/code]
Let's do what the text said and make the code look like this now:
[code]state headhitstate
// Unrem the following line to invoke screen tilting during
// low player hitpoint damage.
wackplayer
ends[/code]
That's it! Run the game and when Duke is very low on HP the screen will react now.[/spoiler]
[b][i][color=#FF0000]Altering Enemies & Gore through GAME.CON:[/color][/i][/b]
[spoiler]With USER.CON you were able to change enemy hit points and sounds, but with GAME.CON you can edit quite a bit more, but it can be difficult. I will go over some of the things I think will be most useful:
We'll stick with the Pig Cop for these examples. Do a search for "SHOTGUN_WEAPON 0" and look at this code:
[code] ifspawnedby PIGCOP
{
addweapon SHOTGUN_WEAPON 0
ifrnd 64
addammo SHOTGUN_WEAPON 4
else ifrnd 64
addammo SHOTGUN_WEAPON 3
else ifrnd 64
addammo SHOTGUN_WEAPON 2
else
addammo SHOTGUN_WEAPON 1
}[/code]
These are the Pig Cop's shells that he can possibly have in his shotgun when he drops it. Try changing the values to this:
[code]ifspawnedby PIGCOP
{
addweapon SHOTGUN_WEAPON 0
ifrnd 64
addammo SHOTGUN_WEAPON 6
else ifrnd 64
addammo SHOTGUN_WEAPON 5
else ifrnd 64
addammo SHOTGUN_WEAPON 4
else
addammo SHOTGUN_WEAPON 3
}[/code]
Save, test the game. Now when the pig cops drop shotguns, the number of shells they may give you have been increased.
Another thing you can do is adjust enemy speed in GAME.CON, again, we will use the PIG COP as an example. Search for "move PIGWALKVELS"and look at this code:
[code]move PIGWALKVELS 72
move PIGRUNVELS 108
move PIGSTOPPED[/code]
PIGWALKVELS is the speed of the Pig Cop when they are walking. PIGRUNVELS controls their faster moving speed. Let's raise them to this:
[code]move PIGWALKVELS 172
move PIGRUNVELS 208
move PIGSTOPPED[/code]
Save and test the game. Now the Pig Cop moves much faster. You can find lines to adjust the other enemy speeds as well. You should have the hang of that by now to be able to find them yourself.
Another cool change you could make is to have it to where the Pig Cops and Enfocers eject brass in their firing animations...
When Duke uses his pistol, shotgun, or chain gun.. you see ejected brass casings falling to the ground. Let's give this effect to the Enforcer and the Pig Cop. We'll start with the Enforcer.
Search for "CAPT_ATTACK" and look at this code:
[code]
ifcanshoottarget
{
sound CAPT_ATTACK
shoot SHOTSPARK1
resetactioncount
}
else[/code]
This is the game seeing if the Enforcer can see the player and if so, he will start this attack sequence. To make the Enforcer eject brass in between shots, edit the code to look like this:
[code]
ifcanshoottarget
{
sound CAPT_ATTACK
shoot SHOTSPARK1
spawn SHELL
resetactioncount
}
else[/code]
spawn SHELL is what makes this effect work. Putting it under "shoot" so that it happens after his shot is fired. Save, and test this out to see if it worked. The Enforcer should now have bullet casings fly around while he's attacking with his gun!
Now, let's do the same thing for the Pig Cop. Search for the second instance of "action APIGCOCK" and look for this code (there should be three instances of APIGCOCK, we only need to deal with two of them, the last two):
[code]ifcount 24
{
action APIGCOCK
sound SHOTGUN_COCK
}[/code]
Make it look like this:
[code]ifcount 24
{
action APIGCOCK
sound SHOTGUN_COCK
spawn SHOTGUNSHELL
}[/code]
Then, search for the next instance of "action APIGCOCK":
[code]ifcount 59
{
action APIGCOCK
sound SHOTGUN_COCK
}[/code]
Make that look like this:
[code]ifcount 59
{
action APIGCOCK
sound SHOTGUN_COCK
spawn SHOTGUNSHELL
}[/code]
What you've done here is made it to where every time the Pig Cop cocks his shotgun, he will eject a shell casing. When he's prone, the shells can't travel far with him blocking the ejection port of the gun, hey, that's at least my reasoning for why. You can attempt to make him eject brass when he is prone if you want to, but personally I would leave it as-is.
The casings seem to eject based on the direction the player and the enemy are viewing each other, so it isn't always consistent which in real life it wouldn't always be either.
Another fun change you can make in GAME.CON is to alter the amounts of gore when enemies explode.
I'm sure some of you were waiting for this one, so here's a few things you can do in GAME.CON to make more gore in the game. Search for "jibs" starting at the top of GAME.CON and you should find this code:
[code]state standard_jibs
guts JIBS2 1
guts JIBS3 2
guts JIBS4 3
guts JIBS5 2
guts JIBS6 3
ifrnd 6
{
guts JIBS1 1
spawn BLOODPOOL
} // a badly drawn spine[/code]
Try editing it like this:
[code]state standard_jibs
guts JIBS2 10
guts JIBS3 20
guts JIBS4 30
guts JIBS5 20
guts JIBS6 30
ifrnd 6
{
guts JIBS1 10
spawn BLOODPOOL
} // a badly drawn spine[/code]
Now when you blow things up, they have a lot more guts. Test it out, and if you think that it's not enough, add an extra 0 to each. Explore GAME.CON for similar strings like this one and see if you can make other effects have more bits and pieces fly around than they currently do.[/spoiler]
Obviously, there's much more to GAME.CON than just these tutorials, but I think these are some easy changes you can make that can help you make further changes elsewhere in GAME.CON with the knowledge you now have. Just be aware that you need to be very careful messing with GAME.CON. There's less room for user error here, so make sure to save often and be able to backtrack if you make a mistake.
[color=#00BF00]The End (For Now):[/color]
That's it for now. I feel that I have written quite a bit of info that should help someone who knew nothing know a lot more than nothing about modding DN3D now that you've read from the start to the finish of this tutorial. You've learned all about USER.CON. You've learned what's inside of DEFS.CON (though currently we've had no reason to change anything in there). You've learned what GAME.CON is all about and have even learned a few things you can do inside of GAME.CON. With this knowledge, you should have the ability to look around these CON files and make changes to them, testing them out along the way and seeing what works and what doesn't.
Bottom line: You can say you know how to modify DN3D. There's still more to modding Duke than just CON files. Level design, art design, etc. have not really been covered here because they aren't really specific to CON editing.
I hope someone finds this information useful.