Approaches for setting xrel and yrel values

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

Post Reply
User avatar
Prebral
Traffic Manager
Traffic Manager
Posts: 141
Joined: 20 May 2005 13:22
Location: Prague
Contact:

Approaches for setting xrel and yrel values

Post by Prebral »

I have recently tried to set xrel and yrel values for a new ship. However, using this wiki page guide...
http://wiki.ttdpatch.net/tiki-index.php ... oordinates
...did not help. I set xrel and yrel to negative half sizes of the vehicle as described, but it is still far off it's desired position. The ship is quite small and is obviously located too far from tile edge if it has to be in it's centre and thus "jumps" while turning, runs on land etc.
I tried to use grf creator helper in newgrf window, but because it shows only the sprite itself and not it's location on a background tile (and determining this is hard on sea, because there are no tile boundaries), I found it quite time-consuming.
Am I missing something? Is there a convenient way to determine these coordinates for a custom grf vehicle if you do not have a background (rails, road...) to check it against it?
User avatar
Purno
Tycoon
Tycoon
Posts: 16659
Joined: 30 Mar 2004 12:30
Location: Almere, The Netherlands

Post by Purno »

I've once tried coding a signal grf manually, but indeed, finding xrel and yrel is a huge amount of work. After that I tried GRF Maker which actually knows default xrel and yrel values (or sth), so that took quite less time. All I had to do is move all sprites 6 pixels upwards, but that was done with a few clicks.

Dunno about other tools there are for this problem, but GRF Maker might be worth trying out (PM Szappy for it).
Contributor to the The 2cc Set and Dutch Trainset. Inventor of the Metro concept. Retired Graphics Artist.
Image Image
Download TT | Latest TTDPatch | OpenTTD | OpenTTDCoop | BaNaNaS: OpenTTD content system | 2048² OTTD scenario of the Netherlands
GRF Codec | GRF Crawler | GRF Maker | Usefull graphics & tools sites | NML Documentation Wiki | NFO Documentation Wiki
All my graphics are licensed under GPL. "Always remember you're unique, just like everyone else."
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

As long as you avoid its numerous crash and tight-loop bugs, NFOEditor is pretty good for editing xrel and yrel. The GRFAuthorHelperWindow is also useful, and less likely to crash too, but probably a little more work when you're adjusting lots of sprites.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
eis_os
TTDPatch Developer
TTDPatch Developer
Posts: 3603
Joined: 07 Mar 2003 13:10
Location: Germany
Contact:

Post by eis_os »

Start a train/ship/whatever, then open the grf helper window and you see your work in realtime how it looks ingame :-) You don't use the gray window to do the xrel,yrel but your actually game! About your tile problem, simple put your ship onto a canals tile....
TTDPatch dev in retirement ... Search a grf, try Grf Crawler 0.9 - now with even faster details view and new features...
Image
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Ahrefs [Bot] and 14 guests