Monday 21 June 2021

WIP: WAD2 Remapper

Version: 1.0

Status: Released

 

A program for the Tomb Raider Level Editor (TRLE) community.

The WadTool program included with Tomb Editor does not yet have a remap feature.

EDIT 23 July 2021: Remapping ability added to WadTool version 1.3.16. (Tools>Mesh Editor)

Remapping is where a vertex’s index number is changed so it is below a certain limit.

This is needed for vertices in the LARA_SKIN meshes that connect to LARA_JOINTS meshes.

WadTool uses a new file format, *.WAD2, which is incompatible with StrPix, the program used to remap vertices for the old wad format, so I wrote this program.

See GitHub for source code and release. [link]

If a 32 bit version of the program is needed please let me know in the comments or at the Level Editor forum at tombraiderforums.com.

Please do not ignore the warning about always having a backup copy of your WAD2 file.

This program may corrupt the file.

 

Usage:

Open your WAD2.

Expand a moveable in the treeview.

Select a mesh.

Swap vertices as required.

There are two ways to swap vertices.

  1. Left click a vertex to select it and then hold "Control" and left click on another vertex to swap them.

  2. Enter the two vertex numbers to swap in the boxes and click "Swap".

Save the WAD2. Do not save over your WAD2 unless it is a copy.

 

3D Viewport Controls:

Left mouse button - Select vertex

Right mouse button - Rotate view

Middle mouse button - Pan view

Mouse wheel - Zoom view

Note that sometimes you might click through a mesh and select the vertex hidden behind the mesh.

 

Screenshot

 

Built using free Delphi Community Edition 10.3.3.  (A Firemonkey 3D project)

Monday 31 August 2020

Delphi bug: Invalid Window Handle Error 1400

My program developed a bug where sometimes on exit an access violation error and invalid window handle error would appear.

invalidhandle

The bug wasn’t totally random but occurred when some sectors in a grid were selected but not when other sectors in the same grid were selected. The grid was an image.

The program uses several TMemo components to display information pertaining to the sector selected and the number of lines displayed in each TMemo varies for each sector.

By trial and error it was found that the bug was caused by appending strings to a TMemo which happened to be the seventh and last TMemo on the form.

I am not skilled enough to get to the bottom of the cause but it seems the bug was caused by the number of lines appended to the TMemo and the length of the lines. No exceptions were raised here though.

Fewer lines no problem. More lines no problem. Shorter lines no problem.

I don’t know why but a TMemo.Lines.Text length between 284 and 308 caused the error.

I fixed the error by ensuring the text length was not between these two values.

Using Delphi Community Edition 10.2.3 on Windows 10.

Friday 28 August 2020

Restore window border GOG Tomb Raider 4 & 5

The GOG versions of Tomb Raider 4 and Tomb Raider 5 include a fix to remove the window border when playing fullscreen on modern Windows versions.

This fix however also removes the window border when playing in windowed mode and leaves the user unable to move the window.

This post details how to undo the fix and restore the window border.

TR5noborder


Tuesday 21 July 2020

Building Wadmerger with Visual Basic 6

The Wadmerger source code was released recently [link]. Wadmerger is a program used in Tomb Raider Level Editor (TRLE) building.

Wadmerger was written in Visual basic 6 which is an old language and this post shows how to get it working on Windows 10 using a Windows XP virtual machine.

Tuesday 9 June 2020

Corrupt Open Live Writer draft fix

I use Open Live Writer to create posts for this blog.

Recently one of my draft posts became corrupted.

In a draft of about 100 lines and many pictures only the first few lines were selectable in the Edit view.

When I switched to Source view all the unselectable text and pictures disappeared destroying my post.

The problem was a stray </div> tag in the post that somehow appeared after inserted a split post.

Since most of the text disappeared when I switched to Source view I had trouble deleting the problematic </div>.

The solution was to close Open Live Writer and restart. But before loading my corrupt draft file, switch to Source view.

This way all the html source appeared and I was able to delete the unmatched </div> tag.

Sunday 31 May 2020

Building Tomb Raider III in Visual Studio 2019

This post will outline the steps involved in building the leaked Tomb Raider 3 code in Visual Studio 2019 Community Edition.


Friday 8 May 2020