6.TDU Modding Tools : Patch Editor
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:
- This tool is to be used by people with a good knowledge of TDU, or modders
- Created patch is in fact a ".pch" file, which can be distributed with a mod
- End-users will have the choice either to manually install the mod they've downloaded or running provided patch with a tool called "ModAndPlay" - that is also provided.
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:
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:
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:
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).
- 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.
... 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.
-
Fail on error: if checked, indicates the current patch will fail and stop if this instruction encounters an issue.
You should check it when current instruction is critical for the patch to pass.
-
Enabled: if UNchecked, this instruction will be ignored; so next instruction will be processed.
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:
-
Thrash button or 'Edit>Delete instruction' menu: do you guess it ?
-
Up Arrow button or 'Edit>Move instruction up': to ensure current instruction will be executed 1 step earlier
-
Down Arrow button or 'Edit>Move instruction down': to ensure current instruction will be executed 1 step later.
Test it!
Prepare your patch for a release
Running prepared patch with ModAndPlay!
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:
- once launched, TDU install path will show TDU's current location on your hard disk. If for any reason this path is wrong, you may always browse...
for another location
- select your game language
- finally click on Green arrow to start executing the patch.
Remarks:
-
For a flawless running, ModAndPlay! must be in the same directory as following contents:
- install.pch: this is patch to run !
- DjeFramework1.dll and TDUModdingLibrary.dll: system files
- TduNames.xml: mandatory file to change car names.
-
If patch fails for an unclear reason, please let me know about it, providing TDUModAndPlay.log file which will appear (located next to ModAndPlay! executable).
Instruction reference
Index