The International Simutrans Forum

PakSets and Customization => Pak128 => Topic started by: Celery_Rhubarb on March 30, 2015, 02:04:21 PM

Title: Alignment of vehicle problem
Post by: Celery_Rhubarb on March 30, 2015, 02:04:21 PM
It's great that my vehicle is now working in the game. I made the vehicle using Blender and then I exported it to png format.

But the problem is the vehicle is either in the middle of the road or on the pavement/sidewalk. It isn't even on the correct alignment of the road.

Now I'm unsure as to what I can do. Do I align the vehicle correctly in Blender? If so then what are the alignments?

Any help would be appreciated, thanks.
Title: Re: Alignment of vehicle problem
Post by: pumuckl999 on March 30, 2015, 02:52:12 PM
I think, it´s better to align in your fotoeditor. But not sure, if this the current template (develope myself for pak128.german):

http://graphics.simutrans.com/displayimage.php?album=9&pid=23#top_display_media

In your dat you can furthermore use offsets for the grafics:

EmptyImage[W]=test.0.0,-x1,y1
EmptyImage[NW]=test.0.1,-x2,y2
.
.
.
.
With x,y you can define the displacement of your vehicle for every view in Pixels.

OK seen yet, you can get also the sources of pak128 on github. With an existing vehicle should not be a problem to get the right alignment: https://github.com/simutrans/pak128
Title: Re: Alignment of vehicle problem
Post by: Celery_Rhubarb on March 30, 2015, 03:13:44 PM
Forgive me for saying. But please could you be more specific?

Because I've noticed that you've mentioned the offsets for WEST and NORTHWEST.

However you've not mentioned the offsets for

NORTHEAST
NORTH
EAST
SOUTH
SOUTHEAST
SOUTHWEST

I've looked on the github. But can't see any offsets such as the -X and Y that you've mentioned for some of the vehicles I've looked at.
Title: Re: Alignment of vehicle problem
Post by: gauthier on March 30, 2015, 04:13:22 PM
Of course offsets are usable to all the eight views of vehicles.

There are patterns here (http://simutrans.fr/doku.php?id=en:tutovehicle#png_and_dat_pattern) for pak128. I did not test all of them, please tell me if you get any problem with them. Using of these patterns is explained on the page.
Title: Re: Alignment of vehicle problem
Post by: pumuckl999 on March 30, 2015, 04:18:20 PM
Hard to say it in english, school is out since thirty years :)...

The both rows were only examples. You can define a seperate offset for each(!) direction... if you need.
Here a complete examle (for a boeing707 for pak128.german):


..
EmptyImage[W]=b707.0.0
EmptyImage[NW]=b707.0.1
EmptyImage[N]=b707.0.2,-5,0
EmptyImage[NE]=b707.0.3,-22,0
EmptyImage[E]=b707.0.4,-1,0
EmptyImage[SE]=b707.0.5
EmptyImage[S]=b707.0.6
EmptyImage[SW]=b707.0.7


In this example views N, NE and E have offsets. Negative values you can see means, that the grafics will move to the left (here only defined x-valus, y-values are zero). You can also see, if views dont need an offset, you can left this values.

On github you can download also graphics: If you place in your photoeditor your own graphics exactly on the existing, and the old graphics dont need an offset, your own graphics also dont need the offset and your vehicle should placed ingame accurate.
Title: Re: Alignment of vehicle problem
Post by: Celery_Rhubarb on March 30, 2015, 07:33:11 PM
Thanks, you are both being most helpful.  :)

But I don't need the offsets for a Boeing because it's a bus for the road I'm making. Any suggestions as to what offsets I can use for a road vehicle?
Title: Re: Alignment of vehicle problem
Post by: pumuckl999 on March 30, 2015, 08:50:20 PM
Nobody can make suggestions: The offset depends NOT from the kind of vehicle, it depends from the placement of your object in the specific graphic.
Best way i think, copy the template, linked by gauthier, in your photoeditor, place your object for each view exactly on the grey squares and then delete or hide the template.
First try is the hardest, i know :)...

----------

Reason for the offset for my boeing: First plane i made was a little Albatros L58. All later planes i aligned on this first plane. With the greater planes i got a problem: Aligned on the Albatros-Template they were to big, the rear of planes was in the next graphic. So i moved in photoeditor the planes complete with rear in their own view with value x. This value is the offset, you need ingame to show the object on right position. See image, shows the problem with an airship (yes, the graphics are greater than 128x128 for the planes). Btw - for the first plane, the albatros, i used as template from an existing plane, something from japanese simutrans site.

edit: sry its lz129, not lz128
Title: Re: Alignment of vehicle problem
Post by: Celery_Rhubarb on March 30, 2015, 10:44:51 PM
Thanks very much.

I really appreciate the advice.
Title: Re: Alignment of vehicle problem
Post by: gauthier on March 31, 2015, 04:01:52 PM
I advise you to use offset only when necessary, otherwise you should rather align your object correctly in the source image. Using offsets when not necessary can make things very confusing.
Title: Re: Alignment of vehicle problem
Post by: Celery_Rhubarb on March 31, 2015, 04:23:02 PM
Great news. I've sorted out the alignments. Thanks.