Import Protection Models

iNsane   Modding, Rider No Comments                    

Quick tutorial on how to import protection models. Once you understand the logic of MXB, you will be able to mod everything. Trust me, it's the same procedure all the time.

You need:

PiBoso Mod Tools (Track Tools, tt.zip)

Optional Example file (in case you need it. Trust me, you won't.)

Table of contents:

Preparing Files and Folders
Preparing CFG and HRC (LODs)
Preparing Model
Converting
Aligning

Location Explanation

Preparing Files and Folders

Create a new folder in modsriderprotections and call it whatever you want

Get the stock neckbrace files (just so you have it all in one place)

Rename rider.pkz to rider.zip

Go to rider\protections\neckbrace and move the content into your new folder you just made

and rename the neckbrace.ini to the same name as your folder (in that case MyCoolProtection.ini)

Rename the rider.zip back to rider.pkz

Edit MyCoolProtection.ini and change the name =  entry to the display name of your mod (in that case My Cool Protection)

Your files are prepared, start the game and you will see a new entry in the protections tab.

Preparing CFG and HRC (LODs)

No, we're not talking about the Honda Racing Team nor the rockwell hardness of materials. .HRC files are the files which PiBoSo games need to know which model should be taken when, that said: it controls the visualization of a model, switches to a different model on distance (LODs) for performance saving.

The CFG files are general configuration files, in that case it's GFX.cfg which "only" tells the game which graphical configuration the item needs.

Both files can be opened with notepad (double click and select Notepad, or right click - open with - Notepad).

The GFX.cfg tells the game which quality model it should take. Since we have the possibility to use HRC files for LOD controlling, we stick to it.

The neckbrace.hrc has a bit more content. Level0 - Level2 is the Level of Detail and the switch = tells the game when it should switch from LOD0 to LOD1 or LOD2. That said, our best quality model switches at 0, so when close up we see the highest quality option of our model, whereas level1 and level2 switch at 20 or 80 and visualize a lower quality model in order to save performance and the need of unecessary calculations of details, which you can't see in distance anyways.

For this tutorial we're not going to use LODs and we will rename the HRC and change contents of both.

Rename the neckbrace.hrc to protection.hrc (this is not necessary but I feel comfier that way, since sometimes you won't do neckbraces but full chest guards or similiar).

Remove the level1 and level2 stuff

Change neckbrace.edf to protection.edf (where the EDF comes from explained shortly)

Open the GFX.cfg and change neckbrace.hrc to protection.hrc

Preparing the model

I use Blender for this but it should work with any 3d modeling tool you know.

First I start by creating an empty with plain axes (it doesn't matter) at 0 0 0.

I use an empty as parent in order to keep things better organized, do how you like.

Since I don't have a proper model, I simply create a Torus to show you how things work.

I resize it to something that's obviously a bit smaller than the default Torus.

Rename the Empty to protection and parent the Mesh (shift + left mouse drag) to the Empty.

Prepare your model and assign materials to it and for a first test, simply hit File - Export - FBX and change the Path Mode to Absolute. This works more often and with less errors for me than Copy. Sometimes I use Copy first to store all my textures into one folder, but afterwards I replace the textures with the ones of the .fbm folder and export it in Absolute Mode again.

Save it in your source folder.

Converting with export script

Now we need to open FBX2EDF

There we click on Load and select our exported protection.FBX model

Then we need to create a new text file and rename it to export.ini and paste the code into it.

Don't worry I got you, download it here. (or take a look into the example zip on top of the tutorial)

or copy that:

[Hierarchy]
split = 1
rotation = 180 90 0

protection = FullPathToSourceFolderOrTheItemsFolderToSaveSomeCopyPaste\protection.edf

Then we have to paste the full path to the export.ini into the Script: textbox

We have nothing to recalculate but keep that in mind: always use recalculate

Hit convert

Wait for the Ending Log message

Et voilá, your FBX has been converted to EDF and is now usable in the game. Move the .EDF into your protection's folder and replace it.

While making screenshots I've used the source folder at first, but I changed the path in the ini to use the MyCoolProtection folder instead, so I don't have to copy paste it everytime. You will convert it some times more. Many times more.

Aligning

So this obviously looks wrong. The default rotation in the export.ini is not correct, as Blender and MX Bikes have some axis flipped (Blender Z is MX Bikes Y most of the time).

We're going to change the rotation values in the export.ini to these, leaving the blender source untouched:

Save the export.ini

Bingo. Now we need to find the correct Z in Blender. Only move the mesh, not the parent! MX Bikes will decide where the parent protection will go to, because we said in the export.ini that protection = the thing to move. Since the mesh is parented to the empty protection, it will automatically be moved with it. That said, your empty will always get moved to the rider's initial protection coordinate which is somewhere in his stomach.

So close.

Rescale the mesh, move the mesh and we should be good to go.

That looks fine.

I've used a Z location of , that should to the trick so far. And I've also rotated the mesh by 25° in Y, but this depends on the initial model.

Location Explanation

Ignore the blue and green arrows, they should only help to understand we're talking in 3d coordinates.

The red arrow is the actual Z of blender, moving the mesh 0.2m into Z+, we're somewhere at the rider's neck, exactly where we wanted to be.

Finding the perfect spot is a hit and miss and you have to test it step by step, rescale the mesh, move the mesh, export, convert, reload the protection in game (simply switch protections, there's no need for a reboot of the game!) and move on.

This is basically how importing a simple model into MX Bikes works. The same system is being re-used for boots, helmets, cameras, bikes ect., sometimes there's more dependencies needed, but all in all this is the first steps.

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *