News:

SimuTranslator
Make Simutrans speak your language.

How to build a pak128 road addon.

Started by Commander Noddy, June 23, 2020, 12:50:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Commander Noddy

After 5 years, I am finally back to play simutrans. Other than playing it, I would like to make contribution to society.
I would like to make Hong Kong style road. Indeed, I don't know how to start with it. The tutorials are outdated, and I can't find suitable information about it.
So I have some questions.
1. What software should I download to start creating addons?
2. Can I have some sample so I can take reference?
Thanks:)

May The Force Be With You Always!

Vladki

Dat file reference, and sample graphics for pak64 can be found here: https://simutrans-germany.com/wiki/wiki/en_WayDef
For real objects you can learn from - look at pak sets with open source: https://sourceforge.net/p/simutrans/code/HEAD/tree/
Templates and other useful stuff is also here: https://graphics.simutrans.com/index.php
Especially this one: https://graphics.simutrans.com/displayimage.php?album=9&pid=292

Software - to create the graphics, use whatever you like, or already know how to use. E.g. gimp for pixel art, or blender for rendered graphics, notepad to write the dat file.
The use makeobj (command line !) to combine dat + png to pak.

Commander Noddy

Thanks for the info! Btw, is there any ways that can open the png and dat files inside the pak file?

May The Force Be With You Always!

Vladki

No. It is so on purpose to protect paks that are not open-source.

Commander Noddy

I have drawn a testing road with png file. What step should I do next? I have tried the read the steps of SNFOs but I dont understand.

May The Force Be With You Always!

Ves

You also need the .dat file, which will hold all the information about the object, the road in this case. Go to the sources Vladki linked to and find a road. Locate the corresponding .dat file to the specific road, and open it. It will hold a bunch of parameters, and in general, you will need all those parameters in your own datfile, but the information should be switched out to match the road you are creating. Most important here are the image definitions, where you need to specify the name of the png you have created.
If you look into the various datfiles in the sources Vladki linked to, you will find that they all link to different png's (although the filename will be specified without ".png" in the dat file).

So the task you have to do is to create a new datfile (just create a new textfile, and rename the ending to ".dat" instead of ".txt"), copy an entire road object from an existing datfile in the sources linked into your new file, give it a new name and adjust all the parameters, and lastly, replace the existing filenames in the dat file with the filename to your png.

If the directions of the road in your png matches the directions in the png to which the original datfile refers to, you dont have to switch the image positions around, otherwise there are a few methods to do so.

After that you need to compile it using the makeobj.exe. If you run on Windows, an easy way to use the makeobj is to create a new textfile, name it "compile.bat" (pay attention to the ".bat" ending instead of .txt!), rightclick on it and press edit, copy the following line into the now open text editor:

makeobj pak

When done, you double click the compile.bat file, and it will in turn run the makeobj.exe, and that will hopefully pak your road!
Note that all files need to be in the same folder for this to work.

If you end up with a pakfile with more than 1kb, it should succesfully have packed the pakfile!

Vladki