Con Editing Information v1.3


This document includes D3D v1.3D information, which is relevent to later versions, it does not however contain material relevent only to v1.4 and/or v1.5.

If at all possible, use the WYSIWYG version (RTF), that is if you download it.

This file has been tested using:



© James Ferry, 10th February 1999

http://

(mind the capitals at the end, it is case sensitive)




Contents






^ Introduction


This document was written to clear up any misinformation from other sources regarding this subject. No diagrams were included, as they display differently in different programs.

The topics may not be ordered very well, but it suffices, and it will provide you with all the information that you need to edit the con files in Duke Nukem 3D v1.3D. These commands should still be in v1.4/v1.5, although there are also newer commands included in v1.4/v1.5. I am not sure what version, and how compatible the Macintosh versions are.


^ 1 Con files



The con files are files that can be modified by the user to change the way the program behaves. These don't have to be con files, they can be any name that you want them to be, it is just that the default name is game.con, which is where the name came from.

You may be wondering why you would want to modify/rewrite the con files, the answer might be you don't want to, another would be don't bother, and one more would be why not?.

Con editing can be useful just to change some of the values in D3D to make it a bit more fun, or just when you get bored, or if you need a few modifications to make some map you made just that bit more like how you wanted it to be. The other reason is when for larger projects such as total conversions (TC from here on). Many people/groups try to pass off a bunch of maps with some new graphics and some minor changes to the original con files as a TC, but all it is just a map package. A proper TC should consist of major overhauls to the game. Even if there are no new maps, and barely any or graphics changes at all, as long as there is major changes in the game play, done via the con editing, it will become a TC. On the other hand, a package containing many maps and lots of new graphics, while using no or barely any con editing, would not really be a TC, it would be more of a patch for D3D.


^ 2 Printing



In case you want to print this document out, you might want to remove the page breaks, and make the margins smaller, and maybe remove/shrink the header/footer so that you don't use as much paper. Double sided printing helps. If you are using a laser printer or some other large/heated printer, don't feed the paper back into the machine, as they may jam if a fresh print is feed back into it, similar to photocopiers, because the paper can curl, and will not feed correctly through the machine.

Unfortunately, because different viewers/editors may have different page sizes, pagination is very difficult, so some of the tables and information will cross over to the next page.


^ 3 Internal functions



Listing 3.1

Details 3.2

^ 3.1 Listing

This list of functions is directly extracted from duke3d.exe.

//, /* and */

ends

ifhitweapon

mikesnd

{ and }

fall

ifinouterspace

money

action

gamestartup

ifinspace

move

actor

getlastpal

ifinwater

music

addammo

globalsound

ifmove

operate

addinventory

guts

ifmultiplayer

palfrom

addkill

hitradius

ifnotmoving

pkick

addphealth

ifaction

ifonwater

pstomp

addweapon

ifactioncount

ifoutside

quote

ai

ifactor

ifp

resetactioncount

betaname

ifactornotstayput

ifpdistg

resetcount

break

ifai

ifpdistl

resetplayer

cactor

ifawayfromwall

ifphealthl

respawnhitag

count

ifbulletnear

ifpinventory

shoot

cstat

ifcansee

ifrespawn

sizeto

debris

ifcanseetarget

ifrnd

sound

debug

ifcanshoottarget

ifspawnedby

soundonce

define

ifceilingdistl

ifspritepal

spawn

definelevelname

ifcount

ifsquished

spritepal

definequote

ifdead

ifstrength

state

definesound

iffloordistl

ifwasweapon

stopsound

else

ifgapzl

include

strength

enda

ifgotweaponce

killit

tip

endofgame

ifhitspace

lotsofglass

wackplayer

^ 3.2 Details

Firstly, the format for the parameters of some of these functions, is as follows.

Square brackets ( [ ] ) represent optional parameters.

Braces represent ( { } ) optionally repeated parameters.

The pipe ( | ) represents an or between the previous and next set of parameters.

Some explanations on structures are written in pseudo code and C code.

I have tried to make the function names bold and the function parameters italic.

^ //, /* and */


^ { and }


^ action


Value Description
0 Single image - It always faces the player no matter where they look from.
5 Five images - The first image is looking from the front, the second is 45 degrees from the front, the third is from the side, the fourth is 45 degrees from the rear (135 degrees from the front) and the last/fifth value is looking from the rear. The second, third and fourth are used for either side of the image.
7 Seven images - Same as 5, except there are seven images, with images 2, 3, 4, 5 and 6 are on both sides. image 4 is the side images, 1 and 7 are the front and rear respectively. These increment every 30 degrees instead of 45 degrees.
8 Eight images - The first image is looking from the front, the second is 45 degrees from the front to the left, the third is from the left side, the fourth is 135 degrees from the front to the left, the last/fifth value is looking from the rear, the sixth is 135 degrees from the front to the right, the third is from the right side and the fourth is 45 degrees from the front to the right.



^ actor name [ strength [ action [ movement | speedxy [ speedz ] [ { directions } ] ] ] ]


^ addammo weapon amount


^ addinventory item amount


Value

Common name

Description

0

GET_STEROIDS

Steroids - will set the inventory level to amount. If the amount is not set to the maximum value, then the steroids will automatically start running.

1

GET_SHIELD

Armour - will add amount to the current inventory level

2

GET_SCUBA

Airtank/scuba gear - will set the inventory level to amount.

3

GET_HOLODUKE

Holoduke - will set the inventory level to amount.

4

GET_JETPACK

Jet pack - will set the inventory level to amount.

6

GET_ACCESS

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

7

GET_HEATS

Night vision goggles - will set the inventory level to amount.

9

GET_FIRSTAID

First aid - will set the inventory level to amount.

10

GET_BOOTS

Boots - will set the inventory level to amount.

^ addkill

^ addphealth param

^ addweapon weapon amount


^ ai


^ betaname


^ break


^ cactor name


^ count param


^ cstat param


Value

Description

1

blocking sprite (used for distances from other actors)

2

translucent

4

x-flipped

8

y-flipped

16

wall sprite (vertical)

32

floor sprite (horizontal, I think it will ignore16|wall if this one is set)

64

1-sided sprite

128

real centering

256

blocking sprite (use with hitscan / cliptype 1)

512

translucence reversing (more translucent than 2|translucent, I think 2|translucent is ignored if this is set)

1,024

reserved

2,048

reserved

4,096

reserved

8,192

reserved

16,384

reserved

32,768

invisible (I think it will also make it unable to be hit)

^ debris actor amount


Value

Common name

2,390

SCRAP6

2,400

SCRAP1

2,404

SCRAP2

2,408

SCRAP3

2,412

SCRAP4

2,416

SCRAP5


^ debug param


^ define handle value

^ definelevelname episode level map time1 time2 name

^ definequote value string


^ definesound value file pitch1 pitch2 priority type volume


^ else

^ enda

^ endofgame param

^ ends

^ fall

^ gamestartup

^ getlastpal

^ globalsound param


^ guts param value


Value

Common name

Brief Description

1,520

DUKETORSO

flying body part (Duke's upper torso)

1,528

DUKEGUN

flying body part (Duke's forearm and gun)

1,536

DUKELEG

flying body part (Duke's leg)

1,768

HEADJIB1

flying body part (Liztroop's head)

1,772

ARMJIB1

flying body part (Liztroop's arm)

1,776

LEGJIB1

flying body part (Liztroop's leg)

1,860

INNERJAW

no image, causes damage to player if close enough

2,201

LIZMANHEAD1

flying body part (Lizman's head)

2,205

LIZMANARM1

flying body part (Lizman's arm)

2,209

LIZMANLEG1

flying body part (Lizman's leg)

2,245

JIBS1

flying internal body part

2,250

JIBS2

flying internal body part

2,255

JIBS3

flying internal body part

2,260

JIBS4

flying internal body part

2,265

JIBS5

flying internal body part

2,286

JIBS6

flying internal body part



^ hitradius rad max third half first


^ ifaction name


^ ifactioncount value


^ ifactor value


^ ifactornotstayput


^ ifai name


^ ifawayfromwall


^ ifbulletnear


^ ifcansee


^ ifcanseetarget


^ ifcanshoottarget


^ ifceilingdistl param


^ ifcount param


^ ifdead


^ iffloordistl param


^ ifgapzl param


^ ifgotweaponce param


^ ifhitspace


^ ifhitweapon


^ ifinouterspace


^ ifinspace


^ ifinwater


^ ifmove param


^ ifmultiplayer


^ ifnotmoving


^ ifonwater


^ ifoutside


^ ifp { param }

Returns true if any of the parameters param are true.

Value

Common name

Brief description

1

pstanding

standing

2

pwalking

walking

4

prunning

running (needs the run key, auto run will not work)

8

pducking

ducking

16

pfalling

falling

32

pjumping

jumping

64

phigher

higher than current actor

128

pwalkingback

walking backwards

256

prunningback

running backwards

512

pkicking

kicking (needs to be weapon one, not quick kick)

1,024

pshrunk

smaller than the normal size by a certain amount

2,048

pjetpack

using a jetpack

4,096

ponsteroids

using steroids

8,192

ponground

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

16,384

palive

alive (not dead)

32,568

pdead

dead (not alive anymore)

65,536

pfacing

looking at the current actor


^ ifpdistl value

^ ifpdistg value


^ ifphealthl value


^ ifpinventory param value




^ ifrespawn


^ ifrnd param


^ ifspawnedby value


^ ifspritepal value


^ ifsquished


^ ifstrength value


^ ifwasweapon param


^ include file


^ killit


^ lotsofglass value


^ mikesnd


^ money number


^ move


^ music param { file }


^ operate


^ palfrom [ intensity [ red [ green [ blue ] ] ] ]


^ pkick


^ pstomp


^ quote value


^ resetactioncount


^ resetcount


^ resetplayer


^ respawnhitag


^ shoot param


^ sizeto x y


^ sound param


^ soundonce param


^ spawn value


^ spritepal value


^ state handle


^ stopsound param


^ strength value


^ tip


^ wackplayer




^ 4 Directions


The actor seems to see if it will end in a water sector at the end of its movement, and if so, it will treat the boundry of the water and the dry sector as a wall. It can be useful to stop them from walking into the water. It might also stop them from jumping into the water, but I am not sure.

Value

Common name

Description

1

faceplayer

faces the player.

2

geth

travels in a horizontal direction.

4

getv

travels in a vertical direction.

8

randomangle

faces a random angle when ever it touches a wall or is shot at. This seems to only face random angles when the actor is an actor such as a monster, not an item or object.

16

faceplayerslow

faces the player a bit slower than 1 (faceplayer)

32

spin

spins in circles

64

faceplayersmart

faces slightly towards where the player is heading

128

fleeenemy

faces directly away from the player

257

jumptoplayer

attempts to jump

512

seekplayer

trys to find the player

1,024

furthestdir

faces the furthest distance from the closest player

2,048

similar to 8 (randomangle), except that once it is called, if it spins or faces another angle and returns to using this value, it will go back to using the angle that this value last used, unless the cause for the change in angle was bumping into a wall or being shot at. This seems to only face random angles when the actor is an actor such as a monster, not an item or object.

4,096

dodgebullet

attempts to avoid a projectile nearby




^ 5 Weapons


number is the tile/actor number, name is the original name assigned to the actor, shoot refers to if the actor is able to be created using the shoot funtion, hit refers to if the weapon can be tested with ifwasweapon, strength refers to if the actor has a strength value or not. The actors strength is the amount of damage that it will cause. Asterixes mean that the note should be used, otherwise the note is a general note about the actor.

The second table is the listing for the players weapon inventory.

Number

Name

Shoot

Hit

Strength

Notes

26

HEAVYHBOMB

no

no

yes

*creates 1670 damage

916

FIREEXT

no

yes

yes*

*preset strength

940

BOUNCEMINE

yes

no

yes

*creates 1670 damage

1,360

COOLEXPLOSION1

yes

yes

yes

1,625

FIRELASER

yes

yes

yes

1,636

SPIT

yes

yes

yes

1,641

FREEZEBLAST

yes

yes

yes

1,642

DEVISTATORBLAST

no

no

yes

uses 2605 code, *creates 2605 damage

1,646

SHRINKSPARK

yes

yes

yes

1,650

MORTER

yes

no

yes

*creates 1670 damage

1,670

RADIUSEXPLOSION

no*

yes

yes*

*use hitradius or other weapon

2,296

BLOODSPLAT1

yes

no

no

2,297

BLOODSPLAT2

yes

no

no

2,298

BLOODSPLAT3

yes

no

no

2,299

BLOODSPLAT4

yes

no

no

2,521

KNEE

yes

yes

yes*

*adds rnd(5)+1

2,536

CHAINGUN

yes

no

yes*

uses 2595 code, *adds rnd(5)+1

2,566

TRIPBOMB

no

no*

yes

*creates 1670 damage

2,595

SHOTSPARK1

yes

yes

yes*

code can be modified, *adds rnd(5)+1

2,605

RPG

yes

yes

yes*

*doubles damage for direct hits

2,613

SHOTGUN

yes

no

yes*

uses 2595 code, adds rnd(5)+1



Number

Common Name

0

KNEE_WEAPON

1

PISTOL_WEAPON

2

SHOTGUN_WEAPON

3

CHAINGUN_WEAPON

4

RPG_WEAPON

5

HANDBOMB_WEAPON

6

SHRINKER_WEAPON

7

DEVISTATOR_WEAPON

8

TRIPBOMB_WEAPON

9

FREEZE_WEAPON




^ 6 Interesting notes



Actor 1890 (EXPLOSION2) has a very interesting effect. When it is created, on it's very first count it will produce light. This can be used to create lighting effects. This is just one of the actors that has a very useful effect that is worth pointing out.

If actor 3400 (BLIMP) uses the debris funtion, it will through out the weaponry, ammunition and inventory actors instead of the debris actors.

If actor 100 (ATOMICHEALTH) uses the addphealth function, it is able to raise the health above the players normal health limit.

When actor 3999 (FRAMEEFFECT1) is spawned, it will take the image of the actor that spawned hit, and then disappear. This can be used to make a blurred image.

If you remove an actors image from the art file, they can not be spawned, and BUILD will replace them with actor 0 (the brick wall). I am not sure what happens if you remove the brick wall though.

Removing the defines from your confiles and replacing all the names with their corresponding numbers will increase the loading time of D3D. The pauses during loading are from either loading the multimedia drivers, reading the definitions, and any external factor such as pressing pause, or the hard drive/cdrom/modem working over time in the background.


^ 7 The if structure


This is a discription of the structure of the if statments. This derived from what was is commonly thought to be a big bug, but proves that if you had any idea of programming or simple logic (what women say we men have none of) you could clearly see that it is correct.

The misconception is that people think a statement such as


is a bug because they think that it should be equal to


The misconception in this is that these are two different structures. These are not the same because if you no how these functions work in conjunction with each other, you will find that two consequetive if statements are equal to an if-and-if statement,

ie: "if this is true and if that is true"

In pseudo code the first structure is


and in C it would be


When writing the con files, it would be better to write the first structure as follows


The second structure in pseudo code is actually


and in C it is


This structuring of the if statement is not incorrect.