Importing a TRNG level into TEN - Tomb-Raider-Level-Editor/Tutorials GitHub Wiki
Tutorial by JoeyQuint from TombEngine Discord Server
I am going to show how to import NateH96's Tomb Raider 2 Venice level into TombEngine, from his TRNG conversion: https://www.trsearch.org/item/4908
You have to keep in mind that this was a TRNG conversion, so there was already stuff that was incompatible from TR2 to TRNG and had to be converted, and for TombEngine we're gonna have to "rollback" these changes and have proper enemies and stuff working as they should.
This should give you the basics so you can start editing the level. I haven't explored the entire subject to make an entire 1:1 conversion (mainly about sounds, specific objects that might require using a TEN source as a base, etc).
1. Prepare your TIDE level
Let's assume you already have a TombIDE project, and you have already created a new level called "Venice".
We're not going to open this Venice level for now.
- Open Tomb Editor: we need to import the TRNG project first.
2. Import the .PRJ file into Tomb Editor as a TRNG .PRJ2
-
Open File > Import TRLE level.
This option is what we need to import an old .PRJ file (Winroomedit\NGLE) into Tomb Editor, but it converts the level into a TR4\TRNG format, since this is what .PRJ files were for. -
The file we're looking for, in Nate's package, is located in
Asset pack\maps\venice\venice.PRJ.
Next, Tomb Editor prompts you about some importing options: T4Larson's patch, UV correction, etc. If you were imported a custom TR4\TRNG level with flybys, you might have used that T4Larson patch in Winroomedit\NGLE, so tick the option if you used that patch, otherwise skip it.
In this case, the level is from TR2, so you can just ignore this and hit Ok.
- Next, save the project, for example "Venice-TRNG.prj2", in the same folder as the original .PRJ file.
Important: right now, there is a bug in Tomb Editor: if you save your freshly created .PRJ2 in a different folder than the original .PRJ file, the paths will be broken without you noticing. At first, everything will seem fine in the editor, because objects and textures are visible. But as soon as you re-open it, you will notice it doesn't know where to find the textures and objects anymore. This will cause the TombEngine conversion to be impossible, so we need to save in the original folder for now.
-
Now to fix some paths, open Tools > Level settings, and do as follows:
- Game tab:
- "Folder in which all runtime game components reside": select the
Playable buildfolder from the original TRNG folder. - "Path of TXT files for script (Optional)": select the
Asset pack\scriptfolder from the original TRNG folder.
- "Folder in which all runtime game components reside": select the
- Sounds sample paths:
- You can remove everything but the 1st folder, just to be safe (it might not even be necessary, but I haven't tried)
- Game tab:
-
Save the project.
3. Convert the TRNG .PRJ2 into a TEN .PRJ2
-
Open File > Convert level to TombEngine, and find that
Venice-TRNG.prj2that we created earlier. -
Then save the new project into your TombEngine game folder: File > Save As, then find your project's folder and overwrite
Levels\Venice\Venice.PRJ2(or whatever you had named it). -
Now let's check the paths again, open Tools > Level settings, and do as follows:
- Game tab:
- "Folder in which all runtime game components reside": here you should now select the
Enginefolder in your game's folder. - "Target folder and filename for level file": this should already be correct.
- "Folder in which all runtime game components reside": here you should now select the
- Game tab:
This should correspond to what's in the
levelFileentry in yourGameflow.luafile, for your Venice level. But notice that Tomb Editor has put$(LevelName)there: this is a special bit, that will automatically be replaced with your .PRJ2 file's name.
So if your .PRJ2 file name isVenice.PRJ2, the level file name in your script should beVenice.ten. So if you ever rename your .PRJ2 file, keep in mind that you should either change the script as well, or write a fixed name in this field rather than$(LevelFile). - "Path of Lua level script file": find yourEngine/Script/Levels/Venice.luafile, which should have been created automatically by TombIDE. - "Target executable that is started with the 'Build and Play' button": this is NOT Play.exe, butEngine\bin\x64\TombEngine.exe. You can completely ignore thex86folder. Only old computers require that now, but considering Tomb Editor is nowx64exclusively, and you managed to run it, then it's safe to assume your computer is recent enough.
-
Object files:
- We are going to come back here later.
But for now, the WAD is still located in NateH96's folder: you should move it to your game folder, underAssets\Wads, and update the path here by hitting Browse.
- We are going to come back here later.
-
Sound infos:
- Remove the
venice.sfxcatalog - Add the default TEN catalog, which is located in your Tomb Editor installation folder (usually
C:\Tomb Editor), underCatalogs\TEN Sound Catalogs\TEN_ALL_SOUNDS.xml. - Sound sample paths:
- Remove everything, and then add the samples folder that has automatically been created by TombIDE in your game folder:
Assets\Samples. You don't need to select one of the subfolders: Tomb Editor will automatically browse every subfolder just by selecting the parent one.
- Remove everything, and then add the samples folder that has automatically been created by TombIDE in your game folder:
- Sky & Font:
- You can just select the default options to get rid of the red lines.
Only the sky texture is used in TombEngine (if you have moving clouds enabled in the script), but if you're using a TR2 horizon it won't even be visible anyway because those are closed off at the top.
- You can just select the default options to get rid of the red lines.
- Remove the
Now, if you were doing this with a classic TR4 level, this would be it.
You can build and play, and happily re-discover your level.
BUT:
With a TRNG project such as NateH96's conversion, some extra TRNG-specific setups were required to get TR2-specific entities working. And in the case of Venice, you will quickly notice that enemies are not working in TEN, precisely because these TRNG specific setups aren't compatible. But they're also not needed in TEN.
Keep reading.
4. Re-import original objects from TR2
TombEngine natively supports most classic entities, including enemies. So we're going to have to replace those TRNG-specific conversions with ones that work in TombEngine.
By default, it's safe to assume that:
- If the entity is available on the TombEngine website, you should use this version instead, because it most probably has important internal differences that are required for the entity to work properly.
- Otherwise, you can just import the entities you want from an original .TR2 level into a TombEngine .WAD2, using WadTool.
4.1 Create a WAD2 with imported entities
Note: this part assumes that you have access to the original TR2 level files. You can grab them in your Tomb Raider 2 installation folder. Remasters also work (except for TR4 and TR5, which are incompatible).
- First, open WadTool.
The left part is where we're going to assemble a new custom .WAD2.
The right part is where we're going to load existing resources to import into our WAD2.
- In the top left, hit the New empty Wad2 button, and select TombEngine as the version.
- Click in the right pane, and find
venice.TR2from your Tomb Raider 2 installation. - Use Shift+Click to select the items you want to import - EXCEPT Lara-related stuff. You can grab enemies, traps, switches, keys, etc. Then click < Add object at the bottom: they should appear in the right pane.
- Save your Wad2, for example in your game's folder under
Assets\Wads, and name it for exampleTR2_import.wad2.
4.2 Download TEN-specific conversions from the TombEngine website
Open the TombEngine website, head to Resource downloads, and download the entities that are interesting.
For Venice, we have:
- Doberman
- Mercenary (Silenced pistols)
- Speedboat
Grab those .WAD2 files, and move them to your Assets\Wads folder (unless you prefer them somewhere else - it's your organization).
4.3 Import those new WAD2s into your level
You can open the Assets\Wads, and drag and drop, in this order:
- The
TR2_import.wad2 - All the downloaded wads from the TombEngine website
Why does the order matter?
If you open Tools > Level Settings > Object Files, you'll notice there is a specific order for the list of WAD2. It can actually be re-arranged here if you imported in another order.
Tomb Editor will read this list as follows: if it finds an entity in the 1st wad, it will use this version. If it doesn't, it will look for it in the next one. Etc, until it reaches the last WAD of the list.
Here, we want to make sure the entities used in priority are the ones from the TombEngine website, THEN use the TR2 direct imports for the rest, and THEN rely on the converted TRNG assets for everything that wasn't found in the first wads.
This way, we ensure we get the most compatible versions in our game.
5. Fix the switches
In TRNG, switches could use specific OCBs to use a specific set of animations. Those OCBs are different in TEN, and thus may be incompatible.
If you look at the first electric switch of the level, you'll see it has 12483 as its OCB. We need to clear that. Instead, if you check the "OCB and setup instructions" page on the TombEngine website, you'll find the OCB for electric switches like this one ("Small lever") is 1. So just put 1 instead.
6. Build and play
There might be other stuff that needs fixing, that wasn't adressed in this tutorial. The horizon being rotated by default, the sounds being different, would need additional steps to be fixed.
But now, you can build and play your level, and you already have a nice base to start building.