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. 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; it will contain 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 instruction, that is: copyFile. So the second grid will have its contents updated 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 (we'll call them parameters).
For example, just double-click on fileName line to give corresponding parameter a new value (that is which file to copy, basically).

fileName parameter

- In this case, you've just told instruction to copy F599_I.BNK file which is situated in the same folder as this patch. For example, if your patch is situated in C:\Desktop, instruction is expecting to find file: C:\Desktop\F599_I.BNK.
- 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 !
One important thing is, you can't guess in which folder the end-user has his TDU installed - location where he's got your mod unzipped as well. 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#. For example, there is the bnkPath variable, that you will use each time you want to point out ...\Test Drive Unlimited\Euro\Bnk folder; patchPath variable will point current patch location.  In addition, there are many others...

Variable in parameter value

... and patch will automatically recognize appropriated folder into any PC .
To know exactly what all variables are and the way they work, please refer to Instruction reference paragraph, later in this guide.


Great ! 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



Close