Creation of pak-files
- see also
- Creating graphics
Creating dat-files
Pak-files - what is their use?
Pak-files (naming convention: object.name.pak) are a special file type that is used by Simutrans to store different kinds of objects as for instance user made graphics and content. The pak-files store data and graphics for visible objects.
Creating pak-files
Pak-files are created with the help of the program MakeObject. Needless to say that you need yourgraphics and parameter files describing your object.
The program MakeObject (Windows makeobj.exe; Linux/BeOS makeobj) can be found at the
Simutrans forum Forum.
MakeObject command line arguments
- makeobj CAPABILITIES
- lists supported object types
- makeobj PAK <pak file> <dat file(s)>
- creates a pak64-file with the object taken from the assigned dat-files
- makeobj PAK
- reads all dat-files in the current directory and creates pak64-files for all objects in the directory
- makeobj PAK128 <pak file> <dat file(s)>
- creates a pak128-file with the object taken from the assigned dat-files
- makeobj PAK128
- reads all dat-files in the current directory and creates pak128-files for all objects in the directory
Instead of PAK128 one can use different formats. Sizes form PAK16 up to PAK255 are supported. However,
only the sizes PAK32, 64, 96, 128 are tested and in current use.
- makeobj LIST <pak file(s)>
- lists the objects contained in the pak-files
- makeobj MERGE <pak file> <pak files>
- merges all the pak-files into a new (larger) pak-file
- makeobj DUMP <pak file> <pak file(s)>
- testing of the pak-files (version 0.40 or newer)
- makeobj EXTRACT <pak file archive>
- extracts file created by the MERGE command
You can append ' >error.txt' to the command line. Then MakeObject writes all occuring errors into the file 'error.txt' for further debugging purposes.
Examples
It is recommended to use the following directory structure:
Windows Copy to clipboard
|
Linux / BeOS Copy to clipboard
|
Development folder: Windows 1.24 Mb - Linux 365.63 kb
Windows: You can write the necessary commands in the batch file "pak.bat". This file can be created and edited using Notepad. To save as '.bat'-file you have to choose file type: all files (*.*) in the save-dialog.
Double-clicking in the explorer on the file starts it. You can reuse this file: copy it into new object directories. It will work as long as the standard command line written in the file.
Linux: You can create a shell script file (called "pak" in the example). The first line has to be #! /bin/sh (not by Suse Linux). Moreover, the file must be executable by the user. The command chmod +x pak marks the file "pak" executable if launched in the directory, where the file resides.
The standard command line for the directory structure above is
Windows
|
Linux / BeOS
|
If you use these command lines the file name of the new pak-file is created from the parameters "obj" and "name" in the dat-file
- object.name.pak
For each object a new pak-file is created. This happens also if more than one object entry is found in the processed dat-file.
You can chance this behaviour by changing the command line of makeobj appropriately:
Copy to clipboard
..\makeobj PAK vehicle.train.pak ./train_front.dat ./train_middle.dat ./train_back.dat
There is also the possibility to merge the pak-files after creation:
Copy to clipboard
..\makeobj MERGE vehicle.train.pak ./vehicle.train_*.pak
The wildcard * has to be used such that the new file (here: vehicle.train.pak) does not match.
Top
Last wiki comments