News:

Simutrans Chat Room
Where cool people of Simutrans can meet up.

Creating Pak Files: DAT file & PNG image corralation

Started by odst23, September 03, 2011, 08:47:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

odst23

My question is how do I tell the DAT file what parts of the PNG image are which, and how to merge the two together. I looked in your wiki manuals for PNG image creation, they ether weren't links or the pages were blank. I am kinda new to the development of pak files, but I've cached on with a few things. I've got the DAT file down, I think, here it is:

obj=vehicle
name=(don't want my name stolen lol)
copywrite=FV_inc.
intro_month=5
intro_year=2200
runningcost=850
cost=650160
weight=9
gear=1
power=6582
speed=385
payload=0
freight=none
vehicle=8
waytype=rail
engine_type=hydrogen


Unfortunately, I also don't know how to post my PNG picture on here, but I will use an example PNG image from the simutrans wiki manual (DAT file creation) as a representation:



My PNG image is kinda like that, only that every angle of my vehicle is in a single row, if it makes any difference, and that I want mine in pak128 format.

Here's the example image's example DAT file:

obj=vehicle
name=Güterwagen_1850
waytype=track
freight=Kohle
payload=5
speed=45
cost=25000
weight=4
RunningCost=1
intro_year=1850
intro_month=1
retire_year=1875
retire_month=7
EmptyImage(S)=wg.0.0 ##
EmptyImage(W)=wg.0.1 ##
EmptyImage(SE)=wg.0.2 ##
EmptyImage(SW)=wg.0.3 ##
FreightImage(S)=wg.1.0
FreightImage(W)=wg.1.1
FreightImage(SE)=wg.1.2
FreightImage(SW)=wg.1.3


I'm curious as to what unit of measurement the ## lines are using. I have the following programs you guys said I need to have:

-Gimp
-Pakmaker
-Makeobj
-Pakhelper

I learn quickly, so If anyone can briefly explain how to correlate the PNG image to the DAT file, and also use Pakhelper to 'pak' it all together, that'll be awesome!

vilvoh

The layout is the following:



The measure unit depends on the pakset, so if you are developing objects for pak128, the game engine will take squares of 128x128 pixels. In your case, the lines you mention are refering to the four views (squares) of the first top row of the image.

Check this tutorial about how to create an addon... http://www.simutrans-france.fr.nf/doku.php?id=fr:creation_daddons

Escala Real...a blog about Simutrans in Spanish...

odst23

#2
Thanks a bunch, that helped me a little and I fixed my PNG file accordingly, but I don't know how to use PakHelper to combine the PNG image and the Dat file into one Pak file, If you could help me in that aspect I'll basically be finished with my vehicle!

vilvoh


Escala Real...a blog about Simutrans in Spanish...

odst23

Where do you put the PNG image once the pak is done, because I couldn't see anything in pakhelper to combine the PNG image and DAT file, did I do something wrong or miss something? I put the pak file in simutrans, but it was like it didn't register it's existence.

vilvoh

Where exactly did you put the pak file? it must be inside the pakset folder. The pak file contains all the data from the source files, so once you have created it, you don't need the png or dat files. What size does de pak file have?

Escala Real...a blog about Simutrans in Spanish...

odst23

answer to question #1: directly in the pakset folder along with the default Pak files

answer to question #2: 175 bytes

An_dz

175 bytes. I can say with 100% sure this pak file is broken. There's nothing inside it. A pak file easily gets 3kb.

I know what wrong, your dat have:
EmptyImage(S)=wg.0.0 - While the right is:
EmptyImage[S]=wg.0.0

Also the png file loaded will be wg.png

This site should give more explanation.

odst23

Where do I put the PNG file in order for it to be registered as something I want packed? I put it in the folder PakHelper was in, is that right?

An_dz

It must be in the same folder the dat is. After compiling it's not needed anymore.

odst23

I think I got it! pak file size: 3.63 kb. But, I put it in the simutrans pak folder, and played simutrans several times, correct year and month intro date, and it wasn't there

An_dz

It must be dropped inside the pak*** folder. Not on Simutrans root folder. Have you ever downloaded any addon?
If not, you better do this:
Go to Documents/Simutrans. Create a folder with the exact name of the folder of the pakset. Paste addons there. When you run the game you'll see a button with Load with addons, clicking it will open the pakset with all addons in the folder you created.

sharon123