ANIMATED and SWITCHES - Doom Legacy Wiki

ANIMATED and SWITCHES

From Doom Legacy Wiki

Jump to: navigation, search
Editing Tutorials

ANIMATED is a binary lump created with an external program that allows Legacy to have custom animated textures and flats. This feature is inherited from Boom. A lump closely related to ANIMATED is SWITCHES, which allows the creation of custom switch textures (textures that change their appearance when used with the "use" key in the game). Both lumps can be created with the same program in a single process that we'll be detailing shortly.

To create your own custom animated textures, flats and switch textures you'll need the following:

  • The program swantbls.exe that is used to generate both ANIMATED and SWITCHES lumps.
  • A file called defswani.dat which the above program reads to get the information needed and generate the lumps. This file already comes packaged with swantbls.exe.
  • A wad manager to insert the generated lumps into your custom wad.
  • Graphic material for your textures.
  • Basic command line knowledge to run swatbles.exe.

Contents

Basic notions

Swantbls basically reads the contents of defswani.dat and generates the two lumps in the current folder. Swantbls does only create lumps so it won't check if the name of your textures is correct or if the textures or flats do actually exist in your custom wad. In other words, Swantbls won't directly do anything to your wad file but will provide it with a guide to use and interpret the already existing custom material in it.

Double check the names of your textures, their format and their order before creating the lumps or you may get unexpected results.

DEFSWANI.DAT format

The format for defswani.dat is really simple. The file can be edited with any text program like wordpad or even the windows notepad. When you open it you'll notice that it looks like this:

	#
	# This file is input for SWANTBLS.EXE, it specifies the switch names
	# and animated textures and flats usable with BOOM. The output of
	# SWANTBLS is two lumps, SWITCHES.LMP and ANIMATED.LMP that should
	# be inserted in the PWAD as lumps.
	#
	#switches usable with each IWAD, 1=SW, 2=DOOM2, 3=registered/Ultimate DOOM
	[SWITCHES]
	#epi    texture1        texture2
	1       SW1BRCOM        SW2BRCOM
	2       SW1BLUE         SW2BLUE 
	3       SW1SKULL        SW2SKULL

	#animated flats, spd is number of frames between changes
	[FLATS]
	#spd    last        first
	8       NUKAGE3     NUKAGE1      
	8       FWATER4     FWATER1      

	#animated textures, spd is number of frames between changes
	[TEXTURES]
	#spd    last        first
	8       BLODGR4     BLODGR1      
	8       SLADRIP3    SLADRIP1     

Each line preceded with a # symbol can be considered a comment and won't be read by swantbls.exe so you don't need to worry about those. Actually, most lines with # are actually explaining and clarifying the format and utility of the file itself. Notice also that some lines of the file are just a single keyword wrapped by brackets like [SWITCHES]. These lines mark the beginning of data for swantbls.exe concerning switches, animated flats and animated textures. Each single addition you make to the wad must be in the correct section so don't go inserting animated floors in the switches lump or anything like that.

A final note before proceeding with the format: the actual file contains all of the original Doom and Doom2 animated textures, flats and switches. It's not advised to delete them as the original set of animated stuff and switches would just don't work. Add your own creations at the end of each section instead!.

As you can see, the file begins with a short explanation of the file's usage and what to do with the lumps once you're done. Next you have a key to interpret the first section: [Switches]. The switches section is particularly easy to interpret: first you have a number, which tells the engine to which wad does the switch belong (being 1-Shareware Doom, 2-Doom2 and 3-Doom or Ultimate Doom).One would say that you have to correctly identify your Iwad but it every value has been tested with Doom2 with satisfactory results so this is most likely to be a relic. Next you have the names for the two textures that represent the switch's on and off positions, one after the other. All you have to do is put the name of your textures there. It doesn't matter the order in which the textures are set (as you can select either the on or off positions as a texture in your map editor and it just will change to the other position when used in game).

You don't have to be careful at with all switch textures' names. All the original in-game textures begin either with SW1 (for on) or SW2 (for off). But switches switches with names like GUITSW1, GUITSW2, HOLA or ADIOS will be as usable as SW1RUST or SW2RUST!.

The second section is [Flats] and it's a bit harder to understand that [Switches]. The Animated flats section is comprised of three different parts of information. First you have the speed, which is the number of tics the frame lasts before moving to the next frame. The lower this number is, the faster the change will be so a value of 1 will be ultra quick while 35 will be a second of real time. Next is the name of the last frame of the series and then the first (notice the backwards order). About the names, they're sequentially read in either numerical or alphabetical order so a sequence like MYFLOOR1 to MYFLOOR4 would work the same as MYFLOORA to MYFLOORD. It is advised to keep the names from colliding with each other.

Finally,[Textures] deals with the animated textures themselves. Its structure is identical to what we just saw in [Flats]. Everything that applies to the [Flats] also applies to [Textures].


Tutorial

This section is a step by step guide to create and use your own custom resources. In the process we will be using the lump manager XWE and swantbls.exe to a custom animated floor, a custom animated wall and a custom switch. You will have to provide the graphics resources yourself!

Creating your custom resources

First off, you'll need graphics for your textures and animations. You can make them with many graphic, many of them available for free like "The Gimp" or Meesoft's "Image Analyzer". Just make sure that they're compatible with the Legacy engine.

For this tutorial we'll be using 10 images for the animated wall, 5 for the animated flat and 2 for the switches so start making something for them. I've personally labelled them testw01 to testw10 for the walls, tests01 to tests05 for the flats and testb01 to testb02 for the switches so these will be the names we'll be using on our tutorial.

Loading your custom resources

Once you have all the graphics you want you'll have to load them into a wad. Fire up XWE and go to File->New to create a new wad file. Enter the name you wish (mine's will be test.wad) and you'll have a blank wad file to put your images into.

First, in order to insert the textures hit Entry->New and create four entries with the names PP_START, PP_END, FF_START and FF_END. These entries will be marking the place where your resources should be: PP_START should be before PP_END and between them you should put all your textures. Same applies to FF_START and FF_END but holding flats.

To insert your textures first hit the PP_START marker and go to Entry->Load. You should be able to select all your textures (mine's would be testw01 to testw10 and testb01 to testb02) then and hit the "Ok" button. When done, all entries you wanted for your textures will be between the markers. Select your entries and hit the right button to enter a secondary menu: do that twice to "Add to patch names" and "Add to texture". From this very moment you will be able to use these textures as regular textures in Legacy.

Now for the flats, go and hit the FF_START marker and go to the Entry-Load menu. Load them into the wad as you did with the textures and, when done, select each entry and do "Image->Save as Doom Flat" with each one of them. As with the textures, you should be able to use them in Legacy now but none of them will be animated.

In this point your wad file should have four markers, all your textures, all your flats and two lumps called "patches" and "texture".

Creating a valid defswani.dat

Next step is to create a valid input file for swantbls.exe. Open up defswani.dat with your text editor of choice and head for the end of the switches list, where it reads:

3       SW1MARB         SW2MARB 
3       SW1SKULL        SW2SKULL

In this place we'll be inserting our switch that way:

3       SW1MARB         SW2MARB 
3       SW1SKULL        SW2SKULL

1       TESTB01         TESTB02

As said, the first digit doesn't appear to be useful and the other two refer to the textures that will be representing the switch. The tabulation and uppercase, (specially the uppercase thing) seem to actually matter so try to respect it.

Go now to the end of the flats list where it reads:

8       SLIME08     SLIME05      
8       SLIME12     SLIME09    

And add your own flats to the end of the list like this:

8       SLIME08     SLIME05      
8       SLIME12     SLIME09    

4       TESTS05     TESTS01

As you can see, we've chosen 4 as the speed value for our texture so it will be twice as fast as a regular Doom texture.

Finally head for the end of the textures list where you can see:

8       WFALL4      WFALL1       
8       DBRAIN4     DBRAIN1

Add your own textures there and you'll be almost finished:

8       WFALL4      WFALL1       
8       DBRAIN4     DBRAIN1
  
2       TESTW10     TESTW01

The animated texture will be twice as fast as your custom animated flat and four times as your regular Doom texture. That's pretty quick!.

Generating the lumps

Now you have the input file ready so you're ready to use swantbls.exe. This is an old program that needs parameters fed into it from the command line so it's no use if you double click on it. Swantbls.exe works like this:

swantbls.exe [input file]

So what would work for us (given that we've set our stuff in defswani.dat) would be:

swantbls.exe defswani.dat

The easy way to do this is to create a batch file inside the folder where both files are with the exact contents of the above line. Run this batch file and two lumps (ANIMATED and SWITCHES) will appear in the folder.

Inserting the lumps

All that is left to do is to go again into XWE and Entry->Load both of the new lumps into the wad file. There's no specific place to do that but I like to hit the last item of the wad file so these new lumps are loaded at the end.

When done File->Close your wad and your textures will be ready to be used.

Personal tools