News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Having some difficulties creating assets

Started by jamespetts, December 23, 2008, 03:39:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jamespetts

I am in the process of experimenting with creating assets for Pak128/PakBritain using makeobj, but I am having some difficulty in getting it to work. I managed to find an excellent .dat file template on the old forum for pak128, and I have looked at the Wiki pages, but whenever I try to create a .pak file using Makeobj and PakHelper, I end up with a rather useless 69byte file with the correct name that does not come up with a vehicle in the game. PakHelper does not produce any error messages (I can find none in the logs), so I am somewhat confused as to whether the problem is the .dat file or the .png file. I cannot find detailed information on exactly how to interact with the image files. I have not created my own image file, but am trying to use a generic image file just to test the various properties of the .dat files. So far, I have tried using one of the Czech trolleybuses, and the "vehicle-template.png" files, without any success on either occasion.

My testing .dat file is as follows:


# Generic 'bus template
# For testing purposes.
#
#
obj=vehicle
name = Generic_Bus
copyright = jamespetts
waytype = road
engine_type=diesel
freight = Passagiere
payload = 24
speed = 50
power = 100
gear = 100
weight = 4
cost = 10000
runningcost = 65
intro_year = 1750
intro_month = 1
retire_year = 1940
retire_month = 6
constraint[next][0] = none
constraint[next][1] = none
constraint[prev][0] = none
emptyimage[w]=Czech_trolleybus.0.1
emptyimage[nw]=Czech_trolleybus.0.2
emptyimage[n]=Czech_trolleybus.0.3
emptyimage[ne]=Czech_trolleybus.0.4
emptyimage[e]=Czech_trolleybus.0.5
emptyimage[se]=Czech_trolleybus.0.6
emptyimage[s]=Czech_trolleybus.0.7
emptyimage[sw]=Czech_trolleybus.0.8


Can anyone render any assistance? I should be most grateful.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Frank

retire_month = 6
constraint[next][0] = none
constraint[next][1] = none
constraint[prev][0] = none


under Linux filename case sensitiv

the extension of image file must .png not .PNG

jamespetts

Frank,

thank you for your reply. I deleted the line as suggested, and changed the entire image filename to lowercase (and reflected that change in the .dat file), but I still get the 69 byte file.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

TommPa9

#3
maybe
name = Generic_Bus
name=Generic_Bus

don't use break


obj=vehicle
cost=560000
payload=72
speed=46
weight=7
good=Passagiere
runningcost=39
name=skoda 1 tr
intro_year=1930
intro_month=1
retire_year=1938
retire_month=1
waytype=road
freight=Passagiere
engine_type=electric
power=66
copyright=TommPa9
Constraint[Prev][0]=none
Constraint[Next][0]=none

emptyimage[w]=tr.0.1
emptyimage[nw]=tr.0.2
emptyimage[n]=tr.0.3
emptyimage[ne]=tr.0.4
emptyimage[e]=tr.0.5
emptyimage[se]=tr.0.6
emptyimage[s]=tr.0.7
emptyimage[sw]=tr.0.8


jamespetts

TommPA9 - thank you for the suggestion. I tried that, with, I am afraid, the same 69 byte result...
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Frank


DirrrtyDirk

The images need to go from 0.0 to 0.7 - not from 0.1 to 0.8
  
***** PAK128 Dev Team - semi-retired*****

TommPa9

#7
Quote from: jamespetts on December 23, 2008, 03:59:23 PM
TommPA9 - thank you for the suggestion. I tried that, with, I am afraid, the same 69 byte result...

is size of your .png correct?
Quote from: DirrrtyDirk on December 23, 2008, 04:01:44 PM
The images need to go from 0.0 to 0.7 - not from 0.1 to 0.8

yes and no too!

i have the 0.0 not fuel.

DirrrtyDirk

Ah ok, when you left a blank space in the graphic, then it's correct.
  
***** PAK128 Dev Team - semi-retired*****

TommPa9

#9
Quote from: DirrrtyDirk on December 23, 2008, 04:06:34 PM
Ah ok, when you left a blank space in the graphic, then it's correct.

I know it.
Im sorry but I don't have picture of posited trolleybus yet, is't czech fire truck Škoda 706 RTHP

DirrrtyDirk

I just tried this
# Generic 'bus template
# For testing purposes.
#
#
obj=vehicle
name=Generic_Bus
copyright=jamespetts
waytype=road
engine_type=diesel
freight=Passagiere
payload=24
speed=50
power=100
gear=100
weight=4
cost=10000
runningcost=65
intro_year=1750
intro_month=1
retire_year=1940
retire_month=6
constraint[next][0]=none
Constraint[prev][0]=none
emptyimage[w]=Czech_trolleybus.0.1
emptyimage[nw]=Czech_trolleybus.0.2
emptyimage[n]=Czech_trolleybus.0.3
emptyimage[ne]=Czech_trolleybus.0.4
emptyimage[e]=Czech_trolleybus.0.5
emptyimage[se]=Czech_trolleybus.0.6
emptyimage[s]=Czech_trolleybus.0.7
emptyimage[sw]=Czech_trolleybus.0.8


Together with the .png from TommPa9's post above (of course renamed to Czech_trolleybus.png) and it worked (file size 10kb). So the .dat seems correct. That leaves either the picture or makeobj (which version do you use, by the way?)... or  pakhelper (which I've never used) as the problem...
  
***** PAK128 Dev Team - semi-retired*****

jamespetts

I am still having trouble, I am afraid. I have downloaded MakeObj 49. I have downloaded the image very helpfully supplied by TommPa9, and renamed it "generic_vehicle.png". I have set makeobj to run from the commandline with the command: makeobj pak128 generic_bus.dat generic_bus.pak, and it still produces a 69 byte generic_bus.pak file. DirrrtyDirk - how did you get it to work?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

DirrrtyDirk

Quote from: jamespetts on December 23, 2008, 04:54:05 PM
makeobj pak128 generic_bus.dat generic_bus.pak

Try
makeobj pak128 generic_bus.pak generic_bus.dat

First .pak then .dat(s)!
  
***** PAK128 Dev Team - semi-retired*****

Frank

Quote from: DirrrtyDirk on December 23, 2008, 05:05:12 PM
Try
makeobj pak128 generic_bus.pak generic_bus.dat

First .pak then .dat(s)!

or simple

makeobj pak128



VS

Ummmmm... you do use makeobj version from release, not a home-baked latest trunk?

Are both files (png and dat) in the same folder?

What does makeobj say - does it output anything at all?

Can you try just "makeobj pak128" ?

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

jamespetts

I think that I've managed to make it work - the problem might have been that I had saved the text file as unicode. Thank you all for your help!
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.