Author Topic: makeobj warnings & errors?  (Read 2993 times)

0 Members and 1 Guest are viewing this topic.

Offline seeker

makeobj warnings & errors?
« on: April 13, 2011, 09:16:17 AM »
Hi all, a newbie here...

The answer is probably staring right back at me, but I can't see it.

Using makeobj on bulk-carriage.dat with the following original lines compiles perfectly:

Code: [Select]
EmptyImage[S]=bulk-carriage.0.0
EmptyImage[N]=bulk-carriage.0.1
EmptyImage[E]=bulk-carriage.0.2
EmptyImage[W]=bulk-carriage.0.3
EmptyImage[SE]=bulk-carriage.0.4
EmptyImage[NW]=bulk-carriage.0.5
EmptyImage[NE]=bulk-carriage.0.6
EmptyImage[SW]=bulk-carriage.0.7
freightimagetype[0]=Sand
FreightImage[0][S]=bulk-carriage.3.0
FreightImage[0][N]=bulk-carriage.3.1
FreightImage[0][E]=bulk-carriage.3.2
FreightImage[0][W]=bulk-carriage.3.3
FreightImage[0][SE]=bulk-carriage.3.4
FreightImage[0][NW]=bulk-carriage.3.5
FreightImage[0][NE]=bulk-carriage.3.6
FreightImage[0][SW]=bulk-carriage.3.7
freightimagetype[1]=Eisenerz
FreightImage[1][S]=bulk-carriage.2.0
FreightImage[1][N]=bulk-carriage.2.1
FreightImage[1][E]=bulk-carriage.2.2
FreightImage[1][W]=bulk-carriage.2.3
FreightImage[1][SE]=bulk-carriage.2.4
FreightImage[1][NW]=bulk-carriage.2.5
FreightImage[1][NE]=bulk-carriage.2.6
FreightImage[1][SW]=bulk-carriage.2.7
freightimagetype[2]=Kohle
FreightImage[2][S]=bulk-carriage.1.0
FreightImage[2][N]=bulk-carriage.1.1
FreightImage[2][E]=bulk-carriage.1.2
FreightImage[2][W]=bulk-carriage.1.3
FreightImage[2][SE]=bulk-carriage.1.4
FreightImage[2][NW]=bulk-carriage.1.5
FreightImage[2][NE]=bulk-carriage.1.6
FreightImage[2][SW]=bulk-carriage.1.7
freightimagetype[3]=Stone
FreightImage[3][S]=bulk-carriage.4.0
FreightImage[3][N]=bulk-carriage.4.1
FreightImage[3][E]=bulk-carriage.4.2
FreightImage[3][W]=bulk-carriage.4.3
FreightImage[3][SE]=bulk-carriage.4.4
FreightImage[3][NW]=bulk-carriage.4.5
FreightImage[3][NE]=bulk-carriage.4.6
FreightImage[3][SW]=bulk-carriage.4.7

Using makobj on this lumber wagon returns a warning message:
"WARNING: More freightimagetype (0) than freight_images (0)!"

The .dat compiles, and the pak seems to work correctly.

Code: [Select]
EmptyImage[S]=veh-wood-new.0.0
EmptyImage[N]=veh-wood-new.0.1
EmptyImage[E]=veh-wood-new.0.2
EmptyImage[W]=veh-wood-new.0.3
EmptyImage[SE]=veh-wood-new.0.4
EmptyImage[NW]=veh-wood-new.0.5
EmptyImage[NE]=veh-wood-new.0.6
EmptyImage[SW]=veh-wood-new.0.7
freightimagetype[0]=Holz
FreightImage[S]=veh-wood-new.1.0
FreightImage[N]=veh-wood-new.1.1
FreightImage[E]=veh-wood-new.1.2
FreightImage[W]=veh-wood-new.1.3
FreightImage[SE]=veh-wood-new.1.4
FreightImage[NW]=veh-wood-new.1.5
FreightImage[NE]=veh-wood-new.1.6
FreightImage[SW]=veh-wood-new.1.7
freightimagetype[1]=Bretter
FreightImage[S]=veh-wood-new.2.0
FreightImage[N]=veh-wood-new.2.1
FreightImage[E]=veh-wood-new.2.2
FreightImage[W]=veh-wood-new.2.3
FreightImage[SE]=veh-wood-new.2.4
FreightImage[NW]=veh-wood-new.2.5
FreightImage[NE]=veh-wood-new.2.6
FreightImage[SW]=veh-wood-new.2.7

This warning occurs with both the original pak64 SVN 'horses.dat' and my slightly modified shown above. I have looked at this closely, and cannot spot any inconsistency.

1) Can anyone spot an error in the wood wagon image data list?
2) Can anyone tell me what the warning is telling me?
3) Is there any documentation available on makeobj error messages?

Thanks in advance for any help forthcoming.




Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8823
  • Total likes: 323
  • Helpful: 229
  • Languages: De,EN,JP
Re: makeobj warnings & errors?
« Reply #1 on: April 13, 2011, 09:29:01 AM »
This code of pak64 here is wrong. The [1] freightimage will be ignored ...

There is no list of error messages; there can be even error messages from libpng printed in between.

Offline seeker

Re: makeobj warnings & errors?
« Reply #2 on: April 13, 2011, 09:41:08 AM »
Sorry, prissi, I don't understand. Why does one compile without a warning and the other with? And what would be the correct syntax?

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4849
  • Total likes: 25
  • Helpful: 63
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: makeobj warnings & errors?
« Reply #3 on: April 13, 2011, 09:48:34 AM »
The first has FreightImageType[n] and FreightImage[n][?] both set for all n=0..3.

The second says FreightImageType[0] and FreightImageType[1], but has FreightImage[?] - twice without the first index, which implies [ 0]. So you end up one set of cargo images short. Additionally, the images are set twice, each time to different values. Not sure which is actually used, but that doesn't matter much.

You probably copy-pasted the FreightImage lines from a vehicle that does not specify more than one cargo graphic. In that case, the first index is omitted (defaults to 0 as already said) and FreightImageType too, since the 0-th one is implicitly assumed to be the same as what is set in freight=?
« Last Edit: April 13, 2011, 10:01:07 AM by VS »

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!

Offline seeker

Re: makeobj warnings & errors?
« Reply #4 on: April 13, 2011, 09:59:57 AM »
Thank you VS, I see it now...

FreightImage( )(S)=veh-wood-new.1.0
                 \
                  Missing index!

I am getting old...

Actually, prissi is correct, the (incorrect) lines are from the 'horses.dat' file in the current SVN. I only changed to a newly modified .png.

VS, I think we are even. I recently re-introduced you to hex editors, you've re-introduced me to dimensioning arrays.
« Last Edit: April 13, 2011, 10:26:12 AM by seeker »

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4849
  • Total likes: 25
  • Helpful: 63
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: makeobj warnings & errors?
« Reply #5 on: April 16, 2011, 08:58:08 AM »
Just think of all the awesome concepts we could explore! :P

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!