WADMerger Documentation

for version 1.9

Index

Introduction
Settings
WADMerger window
- New design
WADEdit frame
- SmartCopy
Object Edit frame
Included Editors frame
- Animation Editor
- Sound Maneger
- AI Editor
-- Building new enemies
-- Using AI Scripts
-- Building AI Scripts
- Switch Maneger
Object Settings
Importent Notes
Problems with WADMerger

Introduction

WADMerger has a lot of features. This made wadmerger a bit hard to use, so here is the doc with all instructions. Now there is even an animation editor included! It is still a beta version so there are still some bugs, but I hope it will work. If you get any problems, please tell me. If wadmerger crashes, please send me the wadmerger.log file so I can take a look at it.



Settings

When you start WADMerger for the first time, the settings window will show. It's showed here on the left. This only shows the first time, but you can get it by selecting Options in the main window.
Folders
You can set the locations of your WAD folders. If you have a seperated folder with original WADs, you can select it, else take the normal WAD folder.
WADMerger can export objects. Here you can select the default location.
There are 3 things in red. These need to be set in order to make WADMerger work:
Samples folder
When saving objects from other TR games, the samples must be saved too. This must point to TRLE\sound\samples (where TRLE is the place where you installed the level editor).
The TR2 and TR3 sound file must point to the main.sfx file. If you want to use TR3 wads a lot, you must set this. If you load levels from the cd, you can point it to the cd too. When you click 'browse' a dialog will show that needs to load main.sfx. It will be opened when saving TR2/3 levels. This file can be found in the data folder.
Example:
If you have the CD-ROM drive as D and you run TR2/3 from cd, insert the cd and chose the browse button after the filename. Go to the cd and open data\main.sfx. When you load a level, make sure the cd is in the drive so it can be loaded. After loading you can remove the cd safely.

Skins
Here you can select how the window looks like. You can use the old window layout by selecting Original. This is a skin that looks like the original window so you can change it if you want. Or you can chose the new style using the default skin (2nd option) or another skin (3rd option) There are a few skins included. Selecting this will display a dialog to load the ini file for the skin.
NOTE: If you download skins you must place all files in the skins folder in the folder where WADMerger is, else you will get errors.

Animation Editor
Inside the animation editor is an undo function. Here you can set the size of the buffer. By default it's 10. The higher the number is, the slower the animation editor is and the more memory is needed. Set this to a lower number if the animation editor is slow.


The WADMerger window

The window as you have seen in the last versions has been the same for long. Since WADMerger 1.7 there is a skin available. Because the old design was making some problems, I had to remove it. But there is a skin available that makes it looks like the original design. You can chose 'Original' in the settings field to get that skin.




The main window

It doesn't matter what skin you use (It's possible to use your own, see later in this document), the buttons are at the same place.
First, the menubar is gone. I did that cause most options were 2 times in the program.
Toolbar
The toolbar is totaly changed. I removed the load and save buttons since these are below the object lists. There are some new options that were first in the menu. They are listed in order (from left to right)
Options
display options screen. You can setup the folders from TRLE and change skins in it. 
Use Smartcopy
It it's checked SmartCopy is used. If it's unchecked, SmartCopy it ignored.
Moveable
Display the moveables in the list
Static
Display static meshes in the list
Sprites
Display sprites in the list.
About
Display the about dialog. It contains the names from the people working on WADMerger (including the skins and documentation).
Frames
The rest of the window is the same, only the background is differend. There are still the 3 frames WADEdit, ObjectEdit and Included Editors. Their function is explained below.


3D Preview window

The new WADMerger has a 3D preview window. It's a small window at the bottom of the window that displays the selected object (It works for both lists) with the first animation. If you double click it the animation editor, which has a larger 3d window, will show up.


Building new skins

WADMerger has support for building your own skins. Look in the \skins folder and find a file called 'Default.bmp'. It contains the default skin. The red boxes can't be changed.
You can change the script as you want and save it back (under another filename) as a BMP file.
Then make a .ini file for your skin. It must include the following lines. The filenames must include jpg or bmp at the end.
Version=190
Needed to tell WADMerger for which version the skin is.
Name=
Name of the skin. Use Original to get small text on the title bar.
Preview=
Filename from the small preview (166x200) to be displayd in the setup box.
Main=name,R,G,B
Filename from the main window skin.(580x650) and the color of the title
Button=
Filename for the button background. Same for all buttons
SwitchManeger=
Filename for the background of the switchmaneger window (310x240)
SwitchManegerButton=
Filename for the buttons in the switchmaneger window.
About=
Skin for about dialog (550x270)
AIEdit=
Skin for AI Editor window (480x330)



WAD Edit frame

This is the main window of WADMerger. There are 2 lists of objects. One is the one that you are editing (the left one) and one for objects you want to copy (right one). Between these frames are some buttons to edit the WAD. For both lists you can click an item to view it in the preview window. It will be rendered in 3D using OpenGL.

The left list
On the left is the wad you are editing. You can use the Load WAD and Save WAD buttons below it to load/save this wad. If you don't load a wad you can also add/remove objects to start an empty WAD. You only see the objects from the type you selected in the toolbar (moveable, sprite, static mesh)

The right list
In the right list you can load wads/levels and copy objects from it to the wad you edit. Use the Load WAD button to load a WAD file and Load TR to load a level (TR1-5). If you double click on this list, it has the same function as the Copy button except that you can't use the key combinations that are available when using the button. All object types are displayd in the list (moveables, sprites and static meshes). If you add an object the object mode will change.
After loading the wad there you will only see the filename. Click the + before it to expand the list. This type of list will be usefull in the next versions where there will be support for loading more then 1 wad file as source.

The buttons
Here is a small description of the buttons between the frames:
Delete
Delete the selected moveable in the WAD you are editing
Copy
Copy the moveable, mesh or sprite you selected on the right to the left list.
There are some key combinations to change the way it's copied (only for moveables and sprites)
SHIFT: Show a dialog to select the new name of the object. SmartCopy won't be used to select the new name
CTRL: Replace the object selected on the left
ALT: Replace the meshes from the moveable on the left. Only works if they have the same number of meshes.
If none of these keys is pressed, the normal copy is done. For WAD files, it keeps the same name. If it's already exist you will be asked to replace it. If the object has SmartCopy data and SmartCopy is enabled, it will be used. For TR levels, it will look in the convert list. If no new name if found, the dialog will show up.
Import
Will show a dialog to load a moveable and add it.
Export
Will show a dialog to save the selected moveable to a file.
Add Texture
Will show a dialog to load a image file and add it to the texture data. You can use it in your own objects (with Strpix).
Empty
Will make this moveable or static empty. It will be invisible in the game. You must use this on SKIN_JOINTS when using TR1-3 outfits else TR will crash.

 


SmartCopy

Since WADMerger 1.7 there is a new feature: SmartCopy. It makes it easier to build new WADs. The current version isn't fully completed, but it will be in the next version. SmartCopy will help you when you copy objects that can use more then 1 slot (like DOOR_TYPE1, DOOR_TYPE2).
Doors, Switches, Animatings
With smartcopy enabled doors, switches, animatings, trapdoors, pushables and quest items are not copied to the edit wad with the same ObjectID. SmartCopy looks in the edit wad if there are any DOOR_TYPEx slots free. It will copy the object to the first free slot. If no slots are free, a message will warn you. This makes it easier to build a WAD with doors and switches from many other wads since mostly DOOR_TYPE1 is the first one and you will always get messages if you want to replace it.
Puzzles, keys & pickups
This feature will be available in the next version. If you copy a puzzle object and SmartCopy is enabled, the holes and parts of the puzzle/keys will be copied too. This makes it must faster to build your WADs since you only need to copy it once.

 

Object edit 

The object edit frame is for changing objects. You can set the collesion and clear meshes. There is a 3D window in it to view the object or mesh you are editing.
Collesion buttons
If you select a moveable on the left, you can use the Object Edit frame. There are 2 buttons to enable and disable the collesion. If it's disabled, Lara can walk trough it (works on both static/moveable). If you enable collesion from a moveable, it will be calculated. For meshes, there is a flag. To calculate the collesion (for when you inserted a new mesh or the collesion is wrong), hold SHIFT while clicking this button.
Mesh list
There is also a list of meshes. There are 3 types of meshes: normal, DUMMY and NULL. For dummy and null meshes the type is after the mesh number. DUMMY meshes are meshes that will be replaced with Lara's skin and are only used on Lara moveables. They look like het legs or hands.
NULL meshes are the black triangle meshes. They are used on some effects that are not in the WAD (like fire, steam), AI items to control enemies and some more like the Trigger Triggerer. These are not rendered in the game so it has no use of editing it.
If you select a mesh it will turn red in the 3d window.
Mesh buttons
There is one button on the right of the meshes: clear. It works the same as the Empty button from the moveables, only this one only clears the selected mesh and not the whole moveable.


Included editors

WADMerger is more then just a program to copy WAD files. In the Included Editors frame (at the right-bottom) there are more editors included. Each button will pop-up another window to edit other things in the WAD file.

 


Animation Editor


The animation editor has a seperate window. The options are hidden in the toolbar, but you can do a lot with the mouse.

Menu
On top of the window is a small menu with a few options. There are also hotkeys for them. The functions are listed below:

File  
-Quit Leave the animation editor (a dialog will ask if you want to save the changes). (Ctrl+Q)
Edit  
-Copy Copy the current frame. (Ctrl+C)
-Paste (replace) Replace the current animation by the one you copied. (Crtl+V)
-Paste (insert) Insert the copied animation after the current one. (Ctrl+I)
-Undo Undo the last event. (Ctrl+Z)
View  
-Frame Calculating Allow the editor to do calculations to display animations smoothly.



Toolbar
Below the menu is a toolbar with some commands for making the animations. The buttons are listed below:

Move selected mesh
Rotate selected mesh
Auto rotate on/off
Auto animate on/off
Reset the camera to the default position
Start the Animation Wizard to add new frames.
Add 1 new frame after the current one (the rotations will be copied from the current one)
Delete current frame (you will hear a beep sound if you try to delete the last frame)

Move/rotate/zoom
You can change the camera to view the mesh from all sides.You can always use the right mouse button to change the view.
Right mouse button: Rotate around X and Y axis
Right mouse button + control: Rotate around Z axis
Right mouse button + shift: Move object in X and Y direction
Right mouse button + alt: Zoom in/out to object

Animations
Below the animation editor window is a list of all animations. Select no animation if you want to change the meshes, or an animation number to edit the animations. For more information about the setttings in this window, see Animation Settings.

Meshes
Next to the animation box is a box with the meshes. You can select a mesh from the list to see it.

Frames
Below the animation number you can select the current frame (Auto Animate must be disabled). You can add new frames using the Add Frame button in the toolbar. This will copy the current frame and place it after the current one. You can also use the Animation Wizard to add more frames at once.
To delete frames, click Delete Frame to delete the current frame.
Normaly the animation will reset after the last frame. However, if you check Chain, when animation that follows this one (can be set in the NextAnimation box) will play. Always the next one is will be played so you will see the whole animtion until the one that repeats itself. You can replay the whole animation with the Replay button. This will reset the whole animation back to the one you selected.

Selecting
Right click a mesh to select it. The mesh will turn red. Now you can rotate or move this mesh

 

Rotating
In the toolbar is a rotate button. Click it and and a window will show up. In the 3D window there will be 3 axis with the same color as the X Y Z title in the rotate window. You can click the coloured spheres with the left mouse button to rotate or use enter the numbers in the rotate window. They must be in the range of 0 to 359. However, inside the wad file they are stored in the range of 0-1023 so they maybe will be a bit differend after changing it.
Inside the rotate window are 2 buttons 'Rel' and 'Abs'. These mean Relative and Absolute. If absolute is checked you can enter the real angles from the mesh, if relative is checked you can enter a value which will be added to the rotation. 
Moving
Tomb Raider doesn't support moving the meshes to a differend position in a single frame. All meshes stay on the same place in all animation. You can only move the whole object at once. To do that, select the move button in the toolbar. The whole object will be selected. Now you can move it using the 3 spheres or the move window (see rotating).
To move single meshes relative to each other, select 'No Animation' from the animation menu. Select a mesh (you can't move the first mesh) and move it.

Animation Wizard
If you want to animate an object in more then 2 frames, you can use the animation wizard. You just make the first and last animation and all frames between them are calculated. To do this, click the animation wizard button. A window will show up. Click next to start. Use the normal 3d window to create the first frame and click next. Then make the ending frame and click next again. In the last window enter the number of frames and the first frame. The frame number is the start of the animation so enter 0 if you want it to start in the first frame. If you want to add it at the end, enter the number of the last frame + 1 in it. Click next again and the animation is added.

Anim Commands
The frames are importent for the animtion, but without AnimCommands you can't make an animation. AnimCommands are commands with many functions. You can move objects with it, play sounds, play earthquakes and more. Click the animcommand button to open a window. All commands from the current animation are listed. Select one and it will show up in the list below. You can click delete to remove the current command. From the fields below the list you can change the commands and click Change to replace that command with the selected one or add to add it as a new one. The commands are explained below:

Set Position Set the new position from this object after this animation. The 3 text fields are the X Y and Z value.
NOTE: One block is 1024 in here and Y is inverted (*-1)
Set grab position Don't know what it does, never tried it. Seems to be used to make an object grap a ledge.
Command 3 I don't know. Never tried it
Die Mark object as dead. Used in enemy die animations, maybe also for making objects useless (like a pushable block that can't be pushed anymore)?
Play Sound Play a sound. First field is frame number, second one is sound number. To get the sound number, open the sound maneger and look for the sample. The ID is shown after the name. If the name is not checked in the list, you can't use that sound. See the sound maneger section for information how to add it.
Play Effect Play an effect on this frame. First field is frame number, the effents are in the dropdown menu.

Animation Settings

In the frame with the animation and frame number you can set some options for the animations.
FrameRate
You can set the FrameRate. It's the speed of the animation. A higher number means a slower animation. Normaly only values between 1 and 4 are used. 2 means the animation is 2 times slower. You can't set values like 1,5 or 2,5.
StateID
The StateID is used to identify the current animation to the engine. The TR engine doesn't know that animation 0 is running, it only knows the stateid of running. With the stateid the engine knows what animtion is playing. It also checks if this is the correct one. For example, if lara is running and you press the walk key, the stateid changes and is not the same as the one from the current animation. Then the engine knows it's wrong and looks for a way to change the animation. That is done using state changes.
NextAnimation & NextFrame
Other options that order the engine what to do are NextAnimation and NextFrame. These 2 order the game what to do after the animation is finished. In the nextanimation box you put the animation id that will play after this one and in nextframe you put the frame id that will play. The animation number can be found in the animation menu (like Animation 2, then the id is 2) and the frame id is the number that can be found before the current frame slider.
Speed
Some animations will move objects. You can move objects with animcommands, but then the object is moved at the end of an animation. To move an object trough the whole animation, set the speed. The speed value (something like 15 for walking and 82 for sprinting) will effect the whole animation. In the 3D window the object will stay on it's place the whole animation. You can't use this for vehiles, their speed is hardcoded.
AccelLo & AccelHi
There is also an box where you can set acceleration. It's used to speed up objects. The real meaning is unknown, cause AccelLo sometimes has strange values. But it seems AccelHi is used like speed, only it makes object go faster trough the animation. For example, when lara goes from walking to running, her speed needs to get bigger. Then the speed increes every frame. But I don't have details about this. 

 

Sound Maneger

This editor let's you add and remove sounds from your SFX and SAM files. It's not fully finished, but you can add sounds!
Because the add sounds feature was created 2 hours before the release (and was never updated), it doesn't work like it should do. But you can use it if you keep the following rules:
Save your wad before AND after using the sound maneger. If you don't do this, there might be sounds missing or to much sounds in the list. If you keep that rule, you should be able to add sounds and you don't have to use the sounds.txt file anymore (using the sounds.txt file will delete all sounds from tr1,2,3,5 objects!)




AI Editor

AI Editor is a small program to fix enemies. It's hard to use, but there is a script function included so you can download scripts and convert enemies. There are also a few scripts files that come with WADMerger.

 

Building new enemies
AI Editor is much easier to use then the 1 I created as external before. If you open the window all available animations will show on the left. Click one and chose 'Add >>' to copy it to the right. If no key is pressed it will be added after the last one. To add it on a differend position, hold SHIFT. Then it will be added BEFORE the selected animation on the right. Or hold ALT to replace the one selected on the right.
The right list will show what animations are in the object after editing. You can view the animations in 3D using the animation editor. Write down all animations and what they are. Do the same for the moveable you want to convert this one to (for example a SAS). For these ones also write down StateID. Compare the lists and chose which animation to add first.
When you click an animation on the right you can use 'Del >>' to remove it or you can change the StateID by typing something else in the box. It's also possible to load/save the animation by using Export and Import.
You can add all animations at once by holding CTRL when clicking 'Add >>'. This is usefull is you only want to make a small change in it.
Using scripts
If you have a script for a moveable, open AI Editor and click 'Load Script'. Browse for the script file from this moveable (like MP_Gun Friend.txt) and open it. Now all animations are moved to the right in the correct order and all what's left is pressing 'Save'.
Building AI Scripts
You can build your own AI Scripts if you know in which order the animations are. To do it, make an empty text file. When the script is readed, empty lines and lines starting with a ; are ignored. You can put comments after the ;.
First start with the number of animations. Then, for each animation, the original ID (from the old moveable) and the stateID each on another line. So 2 lines are used for each animation. If you put -1 as animation ID, it will be empty. Be carefull with empty animations, I haven't checked if it worked right in TR.
NOTE: You can't put comments after a line.
But before you can start a script, you need to have an object slot that you use. Here below is a small list of slots you can try:
Fly enemies
HARPY
Swim enemies
HAMMERHEAR
Swim & walk enemies
CROCODILE
Feet animals
DOG
Laser enemies
DEMIGODx
SETH
Gun enemies
SAS
BADDYx
First delete the sword object and animation
Friendly characters
VON_CROY
GUIDE
TROOPS
DEMIGODx
Demigod is a very good slot for everything. You can make it non attacking very easy.
All land animals
DEMIGODx
Demigod is always worth a try. I checked it with many enemies and mostly they could move. Most types of enemies (laser enemies, butler, animals) can be demigod.



Switch Maneger

Tomb Raider IV had only 3 OCB codes for switches available: big lever switch, big push switch and the reach-in-hole switch. With the switch maneger you can use more type of switches. If you open the switch maneger window you will see the window on the left. The bold text tells you what objects can be used with it. The animations will be stored in the LARA moveable so you don't need to do this again if you add new switches.
SWITCH_TYPE1 - SWITCH_TYPE6
These are the normal switches from TR4. There are 3 differend versions that you can use. There is an OCB number listed before the dropdown menu. That is the number you must put in the OCB from the switch when you place it in your level. Next to the ocb code is a dropdown menu with the animations you can put in that ocb number. It's the animation lara will play whtn you use the switch with that code.
SACROPHAGUS
This object was used in the cleopatra's palaces level. You can hide items in it and Lara will open the Sacrophagus to get it out. In tr5 you also had objects where you could get items out: the cupboards and the suitcase. If you place these objects in your level (as SACROPHAGUS of course) you can select the animation here.

 

Sprite Editor

Flames, ropes, smoke and frames are created using sprites. Most of these are stored in the DEFAULT_SPRITES object. However, there are also 2 other sprite objects 'MISC_SPRITES' and 'SKY_GRAPHICS'. These objects are a list of textures. If you select a sprite, you see them in the 3D window. You can edit them by double clicking the 3D window or clicking 'Sprite Editor'. You must select a sprite before you can do this.
A new window will show. It has a list of all textures available. You can use the Add and Remove buttons to add/delete textures to this sprite. But remeber that removing textures from the default_sprites or sku_graphics can make strange look in game (for example, the rope looks like steam). Unless I found a way to use the remove and add funtions they are disabled.
To edit a sprite, select a texture number. The sprite will show up in the window. You can load and save it to a bitmap. If you import a bitmap it doesn't have to be the same size, but the maximum size is 256x256.

Many sprited are stored in DEFAULT_SPRITES. For example, the rope textures are texture 16. Also flames and steam are stored here, but they will look differend cause the color and shape is created by the engine and can't be edited in the SpriteEditor.


Object settings

Here is a list of objects settings (OCB) from a few objects. NOTE: This section isn't completed yet. I'm searching for more codes that are not listed in the TRLE manual.

TWOBLOCK_PLATFORM
Place the lift from opera.tr2 in this slot. You can control the speed/height with the OCB:
Height: number of clicks it must raise multiplied by 16. 
Speed: value from 1 to 15 (1 is very slow, 15 is fast). Add to the height.
Place a DUMMY trigger from 2x2 sectors on the floor below it (so if there is a door below it, go to the lowest room). Note: if you rotate the lift, the trigger must be placed not directly below it. You should try this out a few times (or make sure you don't rotate the lift).


Importent Notes

To avoid getting problems, read this section. It contains some 'rules' to avoid problems

Outfits from TR1-3 levels
If you copy an outfit from a tr1,2 or 3 level, you must select skin_joints and click the clear button in the wad. If you don't clear the joints, the game will crash.

Custom objects
If you made any custom objects and want to use wadmerger to add textures, please add the textures before you add the object. If you have an untextures object in your wad, you will get errors and the object will get strange textures on it.

All TR1,2,3,5 objects
If you have an object from TR1,2,3 or 5 in your wad that has sounds (and you want to keep these sounds), don't try to use the level sfx creator or trwest. The level sfx creator (the program that came with trle to make sounds) and trwest don't support these sounds and they might get corrupted. It's possible that butler sounds like a door, or lara like the butler.

Many objects
Don't put to many objects in your wad. WADMerger has a code installed to make the wad as small as possible, but you still can't make a wad with all static, animatings, doors, switches and enemy slots filled. If the level convertor crashed when building your level, the change it big that the wad is to large. Delete some objects that are not really needed (very detailed objects take more space then a not detailed one).

No sprites
If you have a level without sprites on it, you can get problems in the game. The game might crash or you won't see flames and smoke. To fix that, copy the DEFAULT_SPRITES from one of the original wads.


Problems with WADMerger

This section is about errors and warnings you can get and the solution. If you still can't solve your problem, go to the folder where you installed WADMerger. There will be a file called WADMerger.log in it. Send it to trwad@hotmail.com. Also include a small description of what you were doing. The errors you can get mostly contain some information just for me, like the function that caused the error. Just send the full error(s) to me and I try to fix it.

Unable to find skin!
WADMerger couldn't load the skin you selected. Just restart WADMerger and the old design will be loaded. Then you can go to the options and select a new skin.

ReadSwitches: Unknown version! & ReadSwitches: This is not an switches.dat file
When you load WADMerger it tries to load switches.dat. This file is needed for the switch maneger. If it's not found or if it's broken, one of these messages will show. You can't use the switch maneger. Please check if you have this file. It comes with the WADMerger zip file.

TR Errors

ReadTR -> Error reading level
You tried to load a TR level and that couldn't be loaded. Maybe you are trying a corrupted level. You can't use this level.When you click ok, another message will show. If you are sure this level is not broken, mail me at trwad@hotmail.com or post a message at http://trwad.community.everyone.net/. Don't forget to tell which level this is and what the second error was.

BuildMoveTR -> Error building moveable x1
Current action: x2
Error code: x3
There was an error when reading moveable x1 from the level. x2 is what the function wad currently doing. Please give me all this information including the level name.

ReadSourceTR -> Error reading level!
Current action: x1
Error code: x2
There was an error when reading the level you opened. x1 is what the function wad currently doing and x2 is the error number.. Please give me all this information including the level name.

WAD Errors

ReadWAD -> error code xxx
There was an error while reading a WAD file. Mostly this is because the WAD is broken or empty.

GetSounds -> Bad sound found! Delete it?
When reading in the moveables there was a play sound command found that points to a SoundID higher them 370, which is the maximum number of sounds in TR4. Just click yes and the sound will be deleted from this moveable. This problem is mostly caused by using TR5 WADs exracted by TR2Wad. You better don't use it and directly load it from the TR5 level.

BuildMove -> Error building moveable xxxx
The object xxxx couldn't be extracted from the wad. Maybe this object is bad or wadmerger can't read it. If you always get this error on a level, tell me which level and which object it is.

SFX Errors

ReadSFX -> Can't read SFX
The SFX file couldn't be loaded. It's maybe currupted.

WriteSFX -> Can't write SFX
The SFX file couldn't be saved. It's maybe already opened or set to read-only.

WARNING! SFX file is empty!
No sounds were found in the SFX file. This won't be a problem, but if you copy objects from this WAD there are no sounds.

SWD Errors

ReadSWD -> Can't read SWD
The SWD file that contains the sprites couldn't be loaded. Maybe it's broken.