Lade...
 

Creating Simutrans objects



Creation of pak-fileslink

see also
Creating graphics
Creating dat-files


Pak-files - what is their use?link


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-fileslink

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 Forumlink-external.


MakeObject command line argumentslink

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.


Exampleslink

It is recommended to use the following directory structure:

Windows

Copy to clipboard
simutrans_src makeobj.exe haus_01 haus_01.dat haus_01.png pak.bat auto_03 auto_03.dat auto_03.png pak.bat triebzug_01 triebzug_vorn.dat triebzug_mitte.dat triebzug_hinten.dat triebzug_01.png pak.bat

Linux / BeOS

Copy to clipboard
simutrans_src makeobj haus_01 haus_01.dat haus_01.png pak auto_03 auto_03.dat auto_03.png pak triebzug_01 triebzug_v.dat triebzug_m.dat triebzug_h.dat triebzug_01.png pak



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
pak48
Copy to clipboard
..\makeobj PAK48 >error.txt

pak64
Copy to clipboard
..\makeobj PAK >error.txt

pak96
Copy to clipboard
..\makeobj PAK96 >error.txt

pak128
Copy to clipboard
..\makeobj PAK128 >error.txt

pak192
Copy to clipboard
..\makeobj PAK192 >error.txt

Linux / BeOS
pak48
Copy to clipboard
../makeobj PAK48 >error.txt

pak64
Copy to clipboard
../makeobj PAK >error.txt

pak96
Copy to clipboard
../makeobj PAK96 >error.txt

pak128
Copy to clipboard
../makeobj PAK128 >error.txt

pak192
Copy to clipboard
../makeobj PAK192 >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:

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

Seite bewerten

Zu dieser Seite haben beigesteuert: Frank , IgorEliezer und system .
Seite zuletzt geändert: am Dienstag November 12, 2019 23:25:16 GMT-0000 von Frank.

Page discussion

There are no discussions currently on this page Start discussion

Online Benutzer

17 Benutzer (alle) online

Neueste Forenbeiträge