| Development Index -> Overview of creating Addons -> Create pak files | |||
|
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 your graphics and parameter files describing your object.
The program MakeObject (Windows makeobj.exe; Linux/BeOS makeobj) can be found at the
Simutrans forum Forum
.
- For Windows-users there are two graphical interface programs for MakeObject.
- PakHelper
PakBuilder
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
- 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 | Linux / BeOS
|
simutrans_src
makeobj.exe
house_01
house_01.dat
house_01.png
pak.bat
car_03
car_03.dat
car_03.png
pak.bat
train_01
train_front.dat
train_middle.dat
train_back.dat
train_01.png
pak.bat | simutrans_src
makeobj
house_01
house_01.dat
house_01.png
pak
car_03
car_03.dat
car_03.png
pak
train_01
train_front.dat
train_middle.dat
train_back.dat
train_01.png
pak |
Development folder: Windows 340.62 kb - Linux 191.35 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
|
pak64: ..\makeobj PAK >error.txtpak128: ..\makeobj PAK128 >error.txt | pak64: ../makeobj PAK 2>error.txtpak128: ../makeobj PAK128 2>error.txt |
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:
..\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:
..\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.
Contributors to this page: Susanna
.
Page last modified on Tuesday 15 September 2009 09:58:33 CEST by Susanna
.
Post new comment