6.TDU Modding Tools : Patch Editor

Patch Editor Window

New! With this tool, you'll be able to create scripts (patchs) to execute long and repetitive tasks on your TDU Files.
Moreover it will also permit users of your mods to install them easily.
Philosophy is the following:


Create your own patch

This paragraph will show you how to begin this patch.
But what's a patch in fact ? It's basically a little file, whose name finishing by 'pch' (also called extension); it's up to you to create it, save it, open it next time, and so on ... Also in one word, you are responsible for what it can do :)

To start, just go to File>New patch... menu (or via CTRL+N shortcut). First step, you'll have to tell Modding Tools where this patch will be located, and what its name will be (you can obviously be creative). Then, a dialog box will appear:

Patch properties

I advise you to take the time to clearly give requested information, because this will be shown later to users of your patch ;)
Please take note that you'll always be able to change it later, by going to menu: File>Properties.

Now, let's go to the point. In front of you there's an empty grid; in this grid will be instuctions you want your patch to execute.
Basically, you could say in natural language "first clean radial.cdb, secondly make backup of a particular file, thirdly replace a file into a BNK ....". Patch Editor allows you to record that, and even more.
To add an instruction to the grid, click on the Plus button (from the left-hand toolbar). And a default backupFile instruction will be added; that might not be what you wanna do, so you're going to change it.

Editing selected instruction is very simple, you've just to ensure it's selected in the main grid. Then, have a look at the bottom part of the window:

Editing current instruction

Right to Instruction type drop-list, you can choose what current instruction should do.
To know exactly what all possibilities are and the way they work, please refer to Instruction reference paragraph, later in this guide.

In this guide, you'll pick another type, that is: copyFile. So the second grid will have its contents changed and look like this:

copyFile parameters

What's that grid for ? In fact its goal is to tell copyFile instruction which things it must manipulate (by using parameters).
For example, just double-click on fileName line to give corresponding parameter a new value (=which file to copy).

fileName parameter

- In this case, you've just told instruction to copy F599_I.BNK file which is situated in MyMod sub-folder. For example, if your patch is situated in C:\Desktop, instruction is expecting to find file in C:\Desktop\MyMod\ folder.
- Next you're going to give value for destination parameter. It's the folder you want to your file to be copied to.
- Last, createFolder parameter indicates if the name of folder you've given must be created if it does not exist. Simply enter true as value for it.

Using variables in parameter values !
Unconvenient thing you'll notice, is you can't predict in which folder the user of your mod has his TDU installed. But it's no more a problem by using variables in your parameter values.
A variable is a kind of keyword, that looks like this: #name# where name is related to each variable. For example, there is the bnkPath variable, that you will use each time you want to point out the ...\Test Drive Unlimited\Euro\Bnk folder.

Variable in parameter value

... and patch will automatically recognize appropriated folder into any PC (obviously, TDU must be installed onto that machine :) ).
To know exactly what all variables are and the way they work, please refer to Instruction reference paragraph, later in this guide.

Good ! Now you've correctly set all parameters for your instruction, you can tell its behaviour.

Instruction behaviour

Basical instruction creation is now over; don't miss the Floppy button to save current instruction, and it's up to you to practice now!

...oooops I forgot, some additional functions will help you too. They are:



Test it!



Prepare your patch for a release



Running prepared patch with ModAndPlay!

ModAndPlay! main window

ModAndPlay! (formally TDU Mod And Play!.exe) is a tiny app whose goal is just running patch you've created and deployed during previous steps.
That enables people to quickly use patches, without needing full Modding Tools package on their own PC :)

It's rather simple:


Remarks:



Instruction reference



Index