Some Requests (Help Needed)

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

User avatar
RL Conroy
Transport Coordinator
Transport Coordinator
Posts: 273
Joined: 04 Sep 2010 12:28
Location: Nijmegen, Holland

Re: Some Requests (Help Needed)[Please Answer!]

Post by RL Conroy »

The Nightly works! Image Thanks!

But now: I see that i Only can Edit the X-offsets and Y-offsets from Sprites from trg1r. What must i do to let it Display the Sprites from a GRF i wanna Edit?
<I Found it; it was so Simple... Image >

And some more Questions...

Scroll down to the Questions with a :arrow: before it
:wink: Can i Code the Tiles so that the Ground will be Displayed Different? I wanna have Other Ground Tiles than Grass
<Fixed>

:wink: Can i Code a Mix of Graphics and Setting Bit 31? That would be Handy for Later...
Like this:
Combining Bit 31 & Selfmade Sprites.png
Combining Bit 31 & Selfmade Sprites.png (2.82 KiB) Viewed 3642 times
<Also Fixed>

:wink:

Code: Select all

...
10 * 50	 00 04 07 01 30 08 "TEST" 11 00 14 FF 15 00 0A 00 09 04
11 * 4	 01 04 01 02
12 sprites/fences.pcx 402 456 09 33 64 -15 6
13 sprites/fences.pcx 482 456 09 32 63 -47 7
14 * 7	 02 04 00 00 01 00 00
15 * 7	 03 04 01 30 00 00 00
16 * 31	 04 04 9F 01 "Å TEST Track" 00
17 * 24	 04 04 9F 01 "Ä TEST Track" 00
I putted some Walls on the Station Tiles with a Gap just big enough for a Train.
When i Tested it in OpenTTD No Tracks are Visible but the Train can drive over the Station Tiles.
How do i put in Tracks so that the Trains are driving over Rails, not Grass?

Any Station GRF maker should know that?
<I found how it works>

:wink: What is Happening here? ?( Why does it Display Perfectly on the Nightly but Scrambled on the Stable Version? (Attachment)
Did i do Something Wrong?
(I Think it has Something to do with Bounding Boxes...) <Solved, it was! :)>
I am Testing this
I am Testing this
Stable and Nightly.png (27.76 KiB) Viewed 3642 times
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
:arrow: How to Animate Station Tiles?
I wanna Create something with a Flashing Light with only 2 Sprites Continually Flashing.
Is that Hard to do?
EDIT: I readed that Animating Station Tiles is not Possible but what about "Industrial Station Renewal"?
They are having Animated Tiles!

:arrow: When that is possible (Animating Station Tiles) can i Code the Stations so that Sprites Used with Bit 31 are Animated?

:arrow: How must i Edit these Values? (Look at http://www.tt-forums.net/viewtopic.php?p=910072#p910072 to see what i'm Talking about)

Code: Select all

-16 -33 00     50 58 00      DD 07 00 80
<Offsets>     <Sizes>
I'm having This now.
If i'm Coding it with GRFCodec then it says this: "Error: Encountered invalid character looking for literal byte. While Reading Sprite: 2 " :(
But Strange enough it can only Code this

Code: Select all

16 33 00     50 58 00      DD 07 00 80
<Offsets>     <Sizes>
But that is not what i want. What am i doing Wrong? ?(

:arrow: The "Sizes" from the Code above is doing this:
Sizes.png
Sizes.png (16.9 KiB) Viewed 3090 times
What to do to Fix it?

EDIT: Please i wanna Code Station Tiles that are more "Advanced". :wink: I know the Basics of Coding Station Tiles already.

EDIT: Can anyone Answer me? You can help me A LOT when i know this Info. :wink:

EDIT: Nobody Interested with Helping me? :(
Conroy: This is Rebel Leader to base. Rebel Transport 2001 has been destroyed and parts for Teleport Device have been lost. We need those Parts! Conroy out.
Erik: What the... What was that all about?
Baleog: I don't know. But he did mention the words "Teleport Device" and "Parts". Quote from the Game "Lost Vikings 2"
4f 70 65 6e 54 54 44 20 52 6f 63 6b 73 21 Hex Code
Find out what the Hex Code means! | Dec/Hex/Oct/Bin Table | Screenshots! | Topic TrafficLight Junction | TTDPatch Wiki | My Website! |
User avatar
zero.eight
Traffic Manager
Traffic Manager
Posts: 128
Joined: 15 Jun 2007 01:14

Re: Some Requests (Help Needed)[Please Answer!]

Post by zero.eight »

RL Conroy wrote:

Code: Select all

16 33 00     50 58 00      DD 07 00 80
<Offsets>     <Sizes>
But that is not what i want. What am i doing Wrong? ?(

What to do to Fix it?
Sizes are too big. That code says the bounding box measures 80px in the x direction and 88 in y. Usually those dimensions should never be more than 15 each (0F) otherwise you get glitchy graphics. If you want a station to cover more than one tile (I assume that's what you want because of the large bounding box), rather than using large sprites you can use Variational Action 2s to change the graphics based on the position of the tile. You need to know how to use VarAction 2 before attempting callback-based animation. Don't think there are many examples around so I will dig up some code.

But if you just want a flashing pixel, you can use one of the colours in the cycled colours in the palette (block, fire, yellow, red, water). Just use one of those colours in the sprite and the game will automatically cycle it if animation is enabled. See http://wiki.ttdpatch.net/tiki-index.php?page=PalettesAndCoordinates.

Are you running code through NFORenum? It will help to locate coding errors.
OpenTTD: VAST - station tiles and objects | MICS - urban monorail graphical conversion | Universal Rail Type - easier train replacement
User avatar
RL Conroy
Transport Coordinator
Transport Coordinator
Posts: 273
Joined: 04 Sep 2010 12:28
Location: Nijmegen, Holland

Re: Some Requests (Help Needed)[Please Answer!]

Post by RL Conroy »

zero.eight wrote:Sizes are too big. That code says the bounding box measures 80px in the x direction and 88 in y. Usually those dimensions should never be more than 15 each (0F) otherwise you get glitchy graphics
You said this to me earlier:
zero.eight wrote:Measure the sprite and put the values into <sizes>
I did that (With the Bounding Boxes). How to do that Correctly? ?(
zero.eight wrote:(I assume that's what you want because of the large bounding box)
No that is not what i want. I only want to have Correct Offsets from the Stations i wanna Create. How to do that? :?:
Like this:
Bad Offsets.png
Bad Offsets.png (20.83 KiB) Viewed 2854 times
zero.eight wrote:You need to know how to use VarAction 2 before attempting callback-based animation.
Okay i'm going to Read it how it works. :wink:
zero.eight wrote:But if you just want a flashing pixel, you can use one of the colours in the cycled colours in the palette (block, fire, yellow, red, water).
Just use one of those colours in the sprite and the game will automatically cycle it if animation is enabled
No i don't wanna have that. I want this:
Animation Sprites.png
Animation Sprites.png (2.07 KiB) Viewed 2992 times
That is not Possible with Animated Palette Colours. :(
Can someone give me an Example of the Simplest Animation Tile you can Create?
zero.eight wrote:Are you running code through NFORenum? It will help to locate coding errors
I will try it out. :wink:
EDIT: Openttd.org says this:
openttd.org wrote:The grfcodec release is newer than the last nforenum release. Please use the grfcodec release
I am using GRFCodec.

Oh and how to use Bit 31 with Arctic/Tropic/Toyland Sprites?
I only know how to use Bit 31 with Temperate Sprites.
Conroy: This is Rebel Leader to base. Rebel Transport 2001 has been destroyed and parts for Teleport Device have been lost. We need those Parts! Conroy out.
Erik: What the... What was that all about?
Baleog: I don't know. But he did mention the words "Teleport Device" and "Parts". Quote from the Game "Lost Vikings 2"
4f 70 65 6e 54 54 44 20 52 6f 63 6b 73 21 Hex Code
Find out what the Hex Code means! | Dec/Hex/Oct/Bin Table | Screenshots! | Topic TrafficLight Junction | TTDPatch Wiki | My Website! |
User avatar
zero.eight
Traffic Manager
Traffic Manager
Posts: 128
Joined: 15 Jun 2007 01:14

Re: Some Requests (Help Needed)

Post by zero.eight »

If you want the correct offsets, you could look at the decompiled base set or use the sprite aligner or look at the OpenGFX public repository.

From trg1r.nfo:

Code: Select all

2013 sprites/trg1r.pcx 146 6440 09 50 58 -16 -33
From sprite aligner:
spritealigner.png
spritealigner.png (33.55 KiB) Viewed 2771 times
That gives you the offsets.

For the sizes, you could measure the bounding box of an existing sprite ingame. Maybe there's another way; I can't think of it right now.
spriteSizes2.png
spriteSizes2.png (14.83 KiB) Viewed 2771 times
EDIT: This image does not correspond to the game's three dimensional x,y and z axes. Halve the values to get closer to the game's measurements.
RL Conroy wrote:I am using GRFCodec.
The GRFCodec release now includes NFORenum, but the two are separate applications so GRFCodec != NFORenum.
RL Conroy wrote:Oh and how to use Bit 31 with Arctic/Tropic/Toyland Sprites?
I only know how to use Bit 31 with Temperate Sprites.
You may be able to use the sprite aligner to get the sprite number and use that in your station layout. Not sure if that works, never tried it.
Last edited by zero.eight on 22 Nov 2010 23:04, edited 1 time in total.
OpenTTD: VAST - station tiles and objects | MICS - urban monorail graphical conversion | Universal Rail Type - easier train replacement
User avatar
RL Conroy
Transport Coordinator
Transport Coordinator
Posts: 273
Joined: 04 Sep 2010 12:28
Location: Nijmegen, Holland

Re: Some Requests (Help Needed)

Post by RL Conroy »

zero.eight wrote:If you want the correct offsets, you could look at the decompiled base set or use the sprite aligner or look at the OpenGFX public repository.
From trg1r.nfo:
<Code>
From sprite aligner:
That gives you the offsets
It still doesn't work with Setting the Offsets. I followed your Instructions but Still it doesn't do what i want. :(
I don't get it.
zero.eight wrote:For the sizes, you could measure the bounding box of an existing sprite ingame. Maybe there's another way; I can't think of it right now
I used this Code

Code: Select all

2 * 72       00 04 07 01 00 08 "BITT" 0C FE 0D FE 11 00 14 FF 15 FF 09 02 E6 07 00 00 19 19 31 16 16 08 DD 07
00 80 00 00 00 0F 0F 00 2D 04 00 00 80 E6 07 00 00 19 19 31 16 16 08 E5 07 00 80 00 00 00 0F 0F 00
2E 04 00 00 80
3 * 4       01 04 01 02
4 sprites/Station_Tiles.pcx 82 8 01 50 58 -16 -31
5 sprites/Station_Tiles.pcx 162 8 01 43 36 -16 -31
6 * 7       02 04 00 00 01 00 00
7 * 7       03 04 01 00 00 00 00
8 * 21	04 04 9F 01 00 "ÅBit 31 Testing" 00
9 * 21	04 04 9F 01 00 "ÄBit 31 Testing" 00
But it Still doesn't work Correctly! Why? ?(
Please Help :bow:

This is Happening if i Use the Code above:
Complete Fail.png
Complete Fail.png (11.77 KiB) Viewed 2752 times
Offsets are not Working, Sizes are not Correct, It even Glitches! :evil:
Can you please say what i'm doing wrong?
zero.eight wrote:You may be able to use the sprite aligner to get the sprite number and use that in your station layout. Not sure if that works, never tried it
No not from the Baseset from "trg1r" but from other Basesets like Tropic, Arctic or Toyland.
The Other Basesets are from a Different File (tgcr, trghr, trgir, trgtr) so how is it possible to Use those Sprites?

And can you use Multiple Bit 31 Sprites in one Tile? Example like 3x Sprite "3191" in one Tile?
Conroy: This is Rebel Leader to base. Rebel Transport 2001 has been destroyed and parts for Teleport Device have been lost. We need those Parts! Conroy out.
Erik: What the... What was that all about?
Baleog: I don't know. But he did mention the words "Teleport Device" and "Parts". Quote from the Game "Lost Vikings 2"
4f 70 65 6e 54 54 44 20 52 6f 63 6b 73 21 Hex Code
Find out what the Hex Code means! | Dec/Hex/Oct/Bin Table | Screenshots! | Topic TrafficLight Junction | TTDPatch Wiki | My Website! |
User avatar
zero.eight
Traffic Manager
Traffic Manager
Posts: 128
Joined: 15 Jun 2007 01:14

Re: Some Requests (Help Needed)

Post by zero.eight »

RL Conroy wrote:It still doesn't work with Setting the Offsets. I followed your Instructions but Still it doesn't do what i want. :(
I don't get it.
Sizes and offsets need to be converted to hex first of all. That might solve it.
RL Conroy wrote:No not from the Baseset from "trg1r" but from other Basesets like Tropic, Arctic or Toyland.
The Other Basesets are from a Different File (tgcr, trghr, trgir, trgtr) so how is it possible to Use those Sprites?
Look up the sprite number in the decompiled base set and stick it into a converter: http://www.bytetransfer.de/projects/ttdpatch/docs/spriteidmapping.php?type=2&id=200. Then use the converted value as the sprite number. So 109d in Subtropical -> 1093d.
RL Conroy wrote:And can you use Multiple Bit 31 Sprites in one Tile? Example like 3x Sprite "3191" in one Tile?
Just add them into the layout definition and make sure they share the bounding box of the previous sprite:
wiki wrote:Since OpenTTD r18959 you can draw multiple ground sprites for a tile, which is useful if you want to use the usual rail/grass/concrete groundtile, but still need to add features to it without using a new bounding box. To do so use the syntax of sprites sharing the previous bounding box, but use it before the first bounding box definition. xpixeloffset and ypixeloffset refer to the usual spot of groundtiles. The same feature is also partially supported in TTDPatch since 2.6 r2312: TTDPatch ignores the xofs and yofs fields and always uses (0,0) for the offset. If you are developing a GRF that needs to be compatible with both OpenTTD and TTDPatch, you should always keep xofs and yofs zero to get the same effect in both games.
OpenTTD: VAST - station tiles and objects | MICS - urban monorail graphical conversion | Universal Rail Type - easier train replacement
User avatar
RL Conroy
Transport Coordinator
Transport Coordinator
Posts: 273
Joined: 04 Sep 2010 12:28
Location: Nijmegen, Holland

Re: Some Requests (Help Needed)

Post by RL Conroy »

zero.eight wrote:Sizes and offsets need to be converted to hex first of all. That might solve it
But how Exactly?
I Used the Code further down this Post but it doesn't work Correctly.
Must i Remove Something/Edit Something?
Can you Help me please so i can Experiment with other Bit 31 Sprites?
zero.eight wrote:Look up the sprite number in the decompiled base set and stick it into a converter: http://www.bytetransfer.de/projects/ttd ... e=2&id=200. Then use the converted value as the sprite number. So 109d in Subtropical -> 1093d
Okay Thanks :wink:
zero.eight wrote:Just add them into the layout definition and make sure they share the bounding box of the previous sprite
I Asked that because i wanna Experiment Later with Multiple Bit 31 Sprites together.

I'm Using this Code now:

Code: Select all

2 * 72       00 04 07 01 00 08 "BITT" 0C FE 0D FE 11 00 14 FF 15 FF 09 02
E6 07 00 00 13 13 1F 10 10 08 DD 07
00 80 00 00 00 0F 0F 00 2D 04 00 00 80 E6 07 00
00 13 13 1F 10 10 08 E5 07 00 80 00 00 00 0F 0F 00 2E 04 00 00 80
3 * 4       01 04 01 02
4 sprites/Station_Tiles.pcx 82 8 01 50 58 -16 -31
5 sprites/Station_Tiles.pcx 162 8 01 43 36 -16 -31
6 * 7       02 04 00 00 01 00 00
7 * 7       03 04 01 00 00 00 00
8 * 21	04 04 9F 01 00 "ÅBit 31 Testing" 00
9 * 21	04 04 9F 01 00 "ÄBit 31 Testing" 00
But how to Set it Correctly?
It just don't wanna Work good. :(
Fail.png
Fail.png (12.47 KiB) Viewed 2589 times
It is a Little better (Only the Bounding Boxes are Partially good) but i want them 100%. :wink:
Conroy: This is Rebel Leader to base. Rebel Transport 2001 has been destroyed and parts for Teleport Device have been lost. We need those Parts! Conroy out.
Erik: What the... What was that all about?
Baleog: I don't know. But he did mention the words "Teleport Device" and "Parts". Quote from the Game "Lost Vikings 2"
4f 70 65 6e 54 54 44 20 52 6f 63 6b 73 21 Hex Code
Find out what the Hex Code means! | Dec/Hex/Oct/Bin Table | Screenshots! | Topic TrafficLight Junction | TTDPatch Wiki | My Website! |
User avatar
zero.eight
Traffic Manager
Traffic Manager
Posts: 128
Joined: 15 Jun 2007 01:14

Re: Some Requests (Help Needed)

Post by zero.eight »

OK, a better method for getting sizes and offsets.

1. Start with the sizes. Measure x,y,z (3D) of the bounding box of an existing tile with an image editor/viewer as in my earlier post. Halve each value and use those for the x,y,z bounding box sizes.

2. Offsets. Use the sprite viewer to get the offsets (2D) for an existing tile. Take the positive of each offset (they will probably always be negative) and add the corresponding bounding box size. Since you can only get the x and y (2D) dimensions from the sprite viewer, use the 2D x-dimension for the 3D x- and y-dimensions, and 2D y-dimension for 3D z-dimension.

3. Use the sprite viewer to check the offsets and tweak as necessary.

Using 1&2&3 I have come up with the following:

Code: Select all

		09 02
				E6 07 00 00
				20 19 32	09 09 1F	DD 07 00 80
				00 00 00	0F 0F 00	2D 04 00 00
				80
				E6 07 00 00
				13 13 1E	09 09 1F	E5 07 00 80
				00 00 00	0F 0F 00	2E 04 00 00
				80
The method works for the second sprite (7E5). The other one (7DD) needs to move around a lot because the bounding box doesn't include the black cables, so you can't use that method accurately. That said, I have no idea if it works for any other sprites.

I'm not sure what the other glitchyness behind the coal mine buildings is caused by. Are they the Action 1 sprites?
OpenTTD: VAST - station tiles and objects | MICS - urban monorail graphical conversion | Universal Rail Type - easier train replacement
User avatar
RL Conroy
Transport Coordinator
Transport Coordinator
Posts: 273
Joined: 04 Sep 2010 12:28
Location: Nijmegen, Holland

Re: Some Requests (Help Needed)

Post by RL Conroy »

zero.eight wrote:EDIT: This image does not correspond to the game's three dimensional x,y and z axes. Halve the values to get closer to the game's measurements
That's the Reason the Bounding Boxes were so Large!
So if you have "X = 19, Y = 19, Z = 31" then it must be this: "X = 09, Y = 09, Z = 1F"? :?:

EDIT:
What about the "Z-Offset"? Must i do the same? :?:
I am Confused... ?(

:arrow: Could you Please Explain how it Exactly Works? So i can Learn from it. :wink:
And i can Continue with a Complete remake from a Earlier GRF from me.

EDIT: Please Explain how it Works! :bow: Then i can get further in Developing GRF's.
zero.eight wrote:The method works for the second sprite (7E5). The other one (7DD) needs to move around a lot because the bounding box doesn't include the black cables, so you can't use that method accurately. That said, I have no idea if it works for any other sprites
I'm going to Test it Later.
This Two Tiles are Complete so i can Continue with Other Tiles.
zero.eight wrote:I'm not sure what the other glitchyness behind the coal mine buildings is caused by
Ehm... This:

Code: Select all

4 sprites/Station_Tiles.pcx 82 8 01 50 58 -16 -31
5 sprites/Station_Tiles.pcx 162 8 01 43 36 -16 -31
I forgot to Change it into

Code: Select all

4 sprites/Station_Tiles.pcx 82 8 01 01 01 0 0
5 sprites/Station_Tiles.pcx 162 8 01 01 01 0 0
So Stupid... ImageThat was the Reason it Glitched so much!
Because 2 Different Offsets and Sizes were Working Against eachother and that caused the Glitchyness.

I Reedited that Code (And putted in the Code you gave me) and now it is this:
Perfect.png
Perfect.png (10.47 KiB) Viewed 2498 times
Perfect 2.png
Perfect 2.png (11.13 KiB) Viewed 2498 times
Just Perfect! :D
Thanks! :wink:

EDIT:
zero.eight wrote:Are they the Action 1 sprites?
No, only Pure Bit 31 Sprites
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
:arrow: Oh and a Question (If anyone Knows that): The Sprites from the Baseset "trg1r" (Old Graphics) and OpenGFX (New Graphics) are the same?
I mean the Sprite sizes, Sizes ingame and Offsets? I wanna know that.

:arrow: And can you Create a Station Tile (Or something else) that is making Sounds?

:arrow: And how to Switch between Sprites when a Station Tile is Built? Like this:
You want to have Markets in Januari, Februari, March and April but in the Rest of the Year there is no Market. How to do that?

Lost interest in Coding Stations/Signals...
Conroy: This is Rebel Leader to base. Rebel Transport 2001 has been destroyed and parts for Teleport Device have been lost. We need those Parts! Conroy out.
Erik: What the... What was that all about?
Baleog: I don't know. But he did mention the words "Teleport Device" and "Parts". Quote from the Game "Lost Vikings 2"
4f 70 65 6e 54 54 44 20 52 6f 63 6b 73 21 Hex Code
Find out what the Hex Code means! | Dec/Hex/Oct/Bin Table | Screenshots! | Topic TrafficLight Junction | TTDPatch Wiki | My Website! |
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 8 guests