This is a weapon making tutorial by Fanatic that describes
how he made an uzi with DDF. Slightly modified by Ziggy Gnarly to include instructions on creating a weapon icon and pickup message.
There's a lot involved in implementing one item, if you are doing a
completely new weapon. I'll assume you know how to make sounds, pretty
weapon pictures and how to use Wintex and make a WAD file.
Here's what it took to implement the Uzi for DOOM Anomaly.
1) Create the new sounds for it:
-weapon up sound called UZI1
-weapon firing sound called UZI2
2) Import and name them to a new WAD using Wintex called:
-DSUZI1
-DSUZI2
All digital sounds MUST be called DS[name]. You can have 6 character names total. Like DSSPINDN for example.
3) We need to define the sounds, so open EDGE's existing SOUNDS.DDF, PAGE DOWN to the bottom to add new stuff:
Anything following // is a comment, ex: // THIS IS A COMMENT. DDF
doesn't pay attention to upper or lower case, but I use upper cause it
looks better.
Add the following:
[UZI1] // UZI SELECT SOUND
LUMP_NAME="DSUZI1"; // THIS IS THE LUMP NAME OF THE SOUND
PRIORITY=90; // LOW PRIORITY, GETS CUT OFF BY HIGHER PRIORITY SOUNDS
BITS=8; // 8 BIT WAV FILE
[UZI2] // UZI FIRING SOUND
LUMP_NAME="DSUZI2"; // THIS IS THE LUMP NAME OF THE SOUND
PRIORITY=90; // LOW PRIORITY, GETS CUT OFF BY HIGHER PRIORITY SOUNDS
SINGULAR=1; // ONLY PLAY UZI2 ONE AT A TIME
BITS=8; // 8 BIT WAV FILE
The singular bit is useful for fast playing sounds. If you leave this
out, it will play each occurrance of that sound without stopping. It
can suck up all the sound channels without it, and generally make it
sound bad. Because the Uzi fires fast, we want one firing sound to
play at a time.
4) We now need to define the attack for the weapon, so open
EDGE's existing ATTACKS.DDF, PAGE DOWN to the bottom to add new
stuff.
Add the following:
[PLAYER_UZI] // NAME OF THE ATTACK -SHOULD BE UNIQUE
ATTACKTYPE=SHOT; // TYPE OF ATTACK
SHOTCOUNT=1; // NUMBER OF ITEMS SHOT
DAMAGE_RANGE=3; // DAMAGE AMOUNT
DAMAGE_MULTI=5; // DAMAGE AMOUNT
ATTACK_HEIGHT=32; // 32 IS ABOUT CHEST HIGH
ACCURACY_ANGLE=3.0; // LOW BULLET SPREAD
ACCURACY_SLOPE=1.5;
ATTACKRANGE=1024; // PLAYER PROJECTILE ATTACKS SHOULD ALWAYS BE 1024, CHAINSAW IS 63.9, FOR EXAMPLE
ENGAGED_SOUND=UZI2; // SOUND TO PLAY WHEN THIS ATTACK IS ACTIVE
If you set the ACCURACY_ANGLE to 45, it will spread all over the
place, set it to 0 (zero), it will shoot right on the middle of the
crosshair every shot.
5) We now need to create our weapon sprites, and a null one,
plus the weapon icon:
-the gun idle called UZIG
-the gun firing called UZIF
-the blank one called NULL (this is a pic that is ONE pixel of cyan)
-the gun icon called UZIC
All sprites HAVE to be 4 letters as the description, and the last two
characters are the frame letter, A, B, C, etc., to define the
sequence, and 1 thru 8 for the direction. See the Wintex documentation
for more info on this.
Weapon sprites will always be 0 (zero) for "all views" (like a dead
monster, or an item you pick up, same from all directions and spins to
face you when you walk around it).
6) We now need to import them into our WAD file that we already
have our sounds in, name them as such:
-UZIGA0
-UZIFA0
-NULLA0
-UZICA0
7) We now need to code the weapon, this is the good part, open
EDGE's existing WEAPONS.DDF, PAGE DOWN to the bottom to add new
stuff.
Add the following (no word wrap either):
[UZI] // WEAPON NAME
AMMOTYPE=BULLETS; // TYPE OF AMMO
AMMOPERSHOT=1; // AMMO PER SHOT, SHOTGUN USES A LOT MORE, ROCKET LAUNCHER USES 1, ETC.
AUTOMATIC=TRUE; // LOOPS AUTOMATICALLY
BINDKEY=8; // KEY TO SELECT THIS WEAPON
PRIORITY=-1; // WHEN YOU RUN OUT OF AMMO, IT SELECTS WHATEVER IS NEXT IN PRIORITY LIST
ATTACK=PLAYER_UZI; // ATTACK TYPE DEFINED IN ATTACKS.DDF
START_SOUND=UZI1; // THIS IS THE SOUND PLAYED WHEN THE WEAPON IS SELECTED, DOOM ONLY USES THIS FOR THE CHAINSAW, BUT WE CAN USE IT HERE
UPSTATE=UZIG:A:1:NORMAL:RAISE; // WEAPON SELECTED FRAME
DOWNSTATE=UZIG:A:1:NORMAL:LOWER; // WEAPON DESELECT FRAME
READYSTATE=UZIG:A:1:NORMAL:READY; // BOBBING OR IDLE FRAME
ATTACKSTATE=UZIF:A:1:BRIGHT:SHOOT, // FIRING FRAME
UZIG:A:1:NORMAL:NOTHING, // RECOIL FRAME
UZIG:A:0:NORMAL:REFIRE; // LOOP BACK TO FIRING FRAME IF FIRE BUTTON IS HELD
FLASHSTATE=NULL:A:1:BRIGHT:LIGHT1, // LOW LIGHT FLASH
NULL:A:1:BRIGHT:LIGHT2, // BRIGHT LIGHT FLASH
NULL:A:0:NORMAL:LIGHT0,#REMOVE; // RESET WEAPON LIGHT FLASH
// I USED THE NULL IN FLASHSTATE CAUSE I ALREADY SET THE FIRING FRAMES
// IN THE ATTACKSTATE SET, IT LOOKS BETTER, GIVES IT THAT ROCKING LOOK
// AND I DON'T LOSE THE LIGHTING EFFECT WHILE FIRING.
Now, the frames work as such:
[state]=[4 letter sprite name]:[frame letter]:[duration of the frame]:[light level -NORMAL or BRIGHT]:[action];
Remember to close the lines with a semi-colon ";". Commas indicate to
continue the loop.
The #REMOVE statement tells the frame to dissapear. Otherwise the
sprite will remain on the screen. Use this for one time sprites, e.g
an explosion's last frame.
This is enough to get the gun up and running - but to put the gun into
a TC or mod, you'll need to make:
a) an icon for the new weapon
b) a pickup message for the weapon
8) We are now going to add a weapon icon. So open THINGS.DDF,
and PAGE DOWN to the bottom to add new stuff.
Add the following (no word wrap either):
[UZI:200] // IDENTIFIES THE WEAPON ICON + NUMBER USED BY MAP EDITORS
BENEFIT_TYPE=BULLETS(40), // AMOUNT OF BULLETS THE GUN COMES WITH
BULLETS.LIMIT(400); // LIMIT THAT THE GUN CAN HOLD
RADIUS=20;
HEIGHT=16;
PICKUP_MESSAGE=GotUzi; // CALLS A STRING STORED IN LANGUAGE.LDF
PICKUP_SOUND=WPNUP; // STANDARD DOOM SFX FOR WHEN YOU GET THE UZI
SPECIAL=SPECIAL;
RESPAWN_EFFECT=ITEM_RESPAWN;
STATES(IDLE)=UZIC:A:-1:NORMAL:NOTHING; // ONE ROTATION
We now need to create a text string to play when you pick up the
weapon. If we don't do this, we'll run into problems.
9) We'll add our pickup message to the weapon. Open LANGUAGE.LDF,
and begin a text search.
You should search (or scroll down) until you find the text
"GotShotgun". This marks the end of the normal doom weapon pickup
messages. You'll need to insert a new entry called GotUzi (see above)
Add the following:
GotUzi="You got the Uzi 9mm";
At this point, you've done almost everything necessary to get your gun
working. You can access it by using the IDFA cheat code, or by placing
the uzi into a map (most good map editors have a specific method of
adding new or custom items - so read the documentation that came with
the map editor for more info). You could also make enemies drop the uzi
when killed by assigning DROPITEM=UZI; to a creature in THINGS.DDF.
But before you charge off to use your new weapon, you'll have to use
Wintex or DeuSF to append all sprites to your WAD file with the sounds
and sprites, then run EDGE as such:
edge -file [wadname].wad
That's it!
I keep my DDF file I'm editing in another directory for Anomaly, and
refer to the originals in my DOOM2 directory when editing.
If you do this, you'll need to run it as such:
edge -ddf [directory where you store your DDF files] -file [wadname].wad
back to top
DDF docs written by Andy Baker and Ziggy Gnarly, with updates by Andrew Apted.
Site design by Fanatic (with graphics and modifications by Ziggy Gnarly). Problems with the docs, errors and comments should be directed to the EDGE team.
© EDGE Team 1998, 1999, 2000.