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 [90% Ready!] (Help Needed with Station NFO

Post by RL Conroy »

I Completed Yesterday my Station GRF but now is the Question: Can i Release that?
They are the Graphics from the Original TTD Industries

And what is the Color "Magic Brown" (In Palette is it named "Block Cycles")? What does it do in Gameplay?

Oh and can we now Create a Station w/ Animation?
Attachments
Industrial Station Tiles 1.png
Industrial Station Tiles 1.png (127 KiB) Viewed 3867 times
Industries in Parts
Industries in Parts
Industrial Station Tiles 2.png (169 KiB) Viewed 3867 times
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
Ammler
President
President
Posts: 953
Joined: 18 Jun 2006 18:18
Location: Switzerland
Contact:

Re: Some Requests [90% Ready!] (Help Needed with Station NFO

Post by Ammler »

if you have included the graphics in your grf, you shouldn't.

You could reuse baseset graphics with grf, no need to copy those.
User avatar
RL Conroy
Transport Coordinator
Transport Coordinator
Posts: 273
Joined: 04 Sep 2010 12:28
Location: Nijmegen, Holland

Re: Some Requests [90% Ready!] (Help Needed with Station NFO

Post by RL Conroy »

Ammler wrote:if you have included the graphics in your grf, you shouldn't.
Oh Okay Thanks. All i want to know :wink:
Ammler wrote:You could reuse baseset graphics with grf, no need to copy those.
But ths GRF is a Station GRF not a Industry GRF with the TTD Graphics Reused to Create your Own Industry.
I Recoded a Other GRF and Reedited everything to get this Station GRF.
It was Fun to Recode! :)
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! |
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 991
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: Some Requests [90% Ready!] (Help Needed with Station NFO

Post by frosch »

RL Conroy wrote:And what is the Color "Magic Brown" (In Palette is it named "Block Cycles")? What does it do in Gameplay?
Advertisement. Everything recolour related can be figured out using http://dev.openttdcoop.org/projects/ttdviewer
In your case: The brown colour cycle is the fizzy-drinks colour cycle. I have no idea who and why called it "block cycle".

And what Ammler means: You do not have to include the graphics of a baseset into your grf to use them. You can reference them. That is, station spritelayouts can reference both sprites from action1 and from basesets.
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
User avatar
RL Conroy
Transport Coordinator
Transport Coordinator
Posts: 273
Joined: 04 Sep 2010 12:28
Location: Nijmegen, Holland

Re: Some Requests [90% Ready!] (Help Needed with Station NFO

Post by RL Conroy »

frosch wrote:In your case: The brown colour cycle is the fizzy-drinks colour cycle
Oh There is it Used for! Thanks frosch! :wink:
frosch wrote:You do not have to include the graphics of a baseset into your grf to use them
But i did it Simpler because doing that is hard. But i will give it a Try

And may i Release this then...
I reused some Sprites from the Avatar from user "pseudoprometheus" (Look beneath) and the Sign Layout from user "WRH" to create: OpenTTD Advertisement!
Attachments
OTTD Building 1.png
OTTD Building 1.png (7.64 KiB) Viewed 3811 times
OpenTTD Advertisement.png
OpenTTD Advertisement.png (14.77 KiB) Viewed 3811 times
Last edited by RL Conroy on 30 Sep 2010 17:28, edited 1 time in total.
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
RL Conroy
Transport Coordinator
Transport Coordinator
Posts: 273
Joined: 04 Sep 2010 12:28
Location: Nijmegen, Holland

Re: Some Requests [90% Ready!] (Help Needed with Station NFO

Post by RL Conroy »

But you can Create it to Advertise to OpenTTD on your TrainStation or Airport!
I wanna see that in Real Life... You are coming out of a Train very Late and then you see This Billboard that says:
"Do you hate it to get late? Just Try OpenTTD! Then You are the Manager!" :wink:

I'm also going to Create Traffic Signs and Other Stuff!
I also am Creating a Statue now with the SteamTrain "Chaney Jubilee" and a Statue with the Airplane "Yate Haugan"...
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
Ammler
President
President
Posts: 953
Joined: 18 Jun 2006 18:18
Location: Switzerland
Contact:

Re: Some Requests [90% Ready!] (Help Needed with Station NFO

Post by Ammler »

RL Conroy wrote: And may i Release this then...
I reused some Sprites from this Avatar (Look beneath) and the Sign Layout from user "WRH" to create: OpenTTD Advertisement!
If you need to ask, if you can release something, then the answer is simple: NO.

But simply look at the sources you copied it from and search for license, then check the license if it does allow derivates and under which circumstances. If you don't find a license, you aren't allowed.

In all cases, it might be easier to just ask the author of the sprites you reuse.
User avatar
RL Conroy
Transport Coordinator
Transport Coordinator
Posts: 273
Joined: 04 Sep 2010 12:28
Location: Nijmegen, Holland

Re: Some Requests [90% Ready!] (Help Needed with Station NFO

Post by RL Conroy »

Ammler wrote:If you need to ask, if you can release something, then the answer is simple: NO
Okay. That is Good. I Asked before i Do. But when you Completely Created it Yourself (The Graphics) can you Release it then?

Oh and i have a Problem: I Created a GRF to build Statues in Company Colours but when you Build it in OpenTTD it Show the Default Colors (Blue).
That is not what i want!
I want Company Colours! :x
Attachments
Look at That! This is Advertising for A Other Company!
Look at That! This is Advertising for A Other Company!
Statue Failure.png (29.47 KiB) Viewed 3756 times
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 [90% Ready!] (Help Needed with Station NFO

Post by zero.eight »

Nice idea with the statues :)
RL Conroy wrote:But when you Completely Created it Yourself (The Graphics) can you Release it then?
If you created the graphics and code, yes.
RL Conroy wrote:Oh and i have a Problem: I Created a GRF to build Statues in Company Colours but when you Build it in OpenTTD it Show the Default Colors (Blue).
That is not what i want!
I want Company Colours! :x
If you are using stations, you need to set bit 15 in the sprite number in the Action 00 Property 09 for the relevant station e.g. if the current sprite number is 0x0000042D, use 0x0000842D to draw the sprite using company colours.

You can avoid including a sprite in the GRF if it is part of the base set, which would allow you to release it (assuming you can't get permission to use someone else's work). So you could release the Yate Haugan statue if the code references the relevant sprite in the base set (assuming you haven't coded it like this already). To do so, use the sprite number of the Yate Haugan sprite and set bit 31.
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 [90% Ready!] (Help Needed with Station NFO

Post by RL Conroy »

zero.eight wrote:Nice idea with the statues
Thanks. I have More Ideas like that!
zero.eight wrote:If you created the graphics and code, yes
Okay thanks for Telling me that. :wink:

Code: Select all

2 * 82	 00 04 07 01 00 08 "IST1" 0C FE 0D FE 11 00 14 FF 15 FF 09 04 1D 08 00 00 00 00 00 10 05 01
	 2D 04 00 00 80 1D 08 00 00 00 00 00 05 10 0F 2E 04 00 00 80 1D 08 00 00 00 00 00 10 05 01 2D 04
	 00 00 80 1D 08 00 00 00 00 00 05 10 0F 2E 04 00 00 80
3 * 4	 01 04 01 02
4 sprites/Statues.pcx 82 8 09 52 64 -31 -21
5 sprites/Statues.pcx 162 8 09 56 64 -31 -25
6 * 7	 02 04 00 00 01 00 00
7 * 7	 03 04 01 00 00 00 00
8 * 17	 04 04 9F 01 00 "ÅAirplane 1" 00
(This is the Code for the Yate Haugan Statue)
Where must i add that Value? At 15 FF? Bcause it sound a Little bit Confusing... ?(

EDIT: Oh yes i Discovered something Strange: When i Reedited the GRFID and Tested it Together with "Industrial Station Tiles" & "Airplane/Train Statues" i Discover that "Industrial Station Tiles" & "Airplane/Train Statues" are Merged together! :?
What did i do Wrong?
This are the ID's:

Code: Select all

08 06 "ST" 83 07
Airplane/Train Statues

Code: Select all

08 06 "IS" 83 07
Industrial Station Tiles
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 [90% Ready!] (Help Needed with Station NFO

Post by zero.eight »

RL Conroy wrote: Where must i add that Value? At 15 FF?
Bit 15 of the sprite number. Your sprite numbers in (big endian) hex are 0000042D+X. You need to set bit 15 in the binary value of the sprite number, then convert it back to hex.

Short answer: Make your hex numbers 0000842D+X, or 2D 84 00 00 in little endian.

Long answer:

Code: Select all

0x0000042D (hex) = 00000000000000000000010000101101 (binary)  (=1069 decimal)

You need to set bit 15:
00000000000000000000010000101101 (binary)
^ bit 31        ^        bit 0 ^
                ^
              bit 15

which gives:
00000000000000001000010000101101

converted to hex:
0000842D
RL Conroy wrote: EDIT: Oh yes i Discovered something Strange: When i Reedited the GRFID and Tested it Together with "Industrial Station Tiles" & "Airplane/Train Statues" i Discover that "Industrial Station Tiles" & "Airplane/Train Statues" are Merged together! :?
What did i do Wrong?
This are the ID's:

Code: Select all

08 06 "ST" 83 07
Airplane/Train Statues

Code: Select all

08 06 "IS" 83 07
Industrial Station Tiles
If you want them in separate classes, they need to have different class IDs. But the ID's you posted don't look right. If the first 08 means property 08 then 06 "ST" 83 and 06 "IS" 83 are separate, valid IDs as far as I can tell, so they should put the station into different classes. In that case, the 07 on the end doesn't look like it should be there. Property 08 requires a doubleword (4bytes) but you have given it 5 bytes.
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 [90% Ready!] (Help Needed with Station NFO

Post by RL Conroy »

zero.eight wrote:Make your hex numbers 0000842D+X, or 2D 84 00 00 in little endian
I Really don't get it.
I'm Sorry :oops: but can you Post a Reedited Code so i can see what you Exactly mean?
zero.eight wrote:Property 08 requires a doubleword (4bytes) but you have given it 5 bytes
I Copied this Code from a GRF I Created Earlier. Do i must Remove the "07" then?

EDIT: When i Removed the "07" the GRF did not Appear in the "Add NewGRF's"!
It is getting Messed up when i Reedit a Value!
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 [90% Ready!] (Help Needed with Station NFO

Post by zero.eight »

RL Conroy wrote:
zero.eight wrote:Make your hex numbers 0000842D+X, or 2D 84 00 00 in little endian
I Really don't get it.
I'm Sorry :oops: but can you Post a Reedited Code so i can see what you Exactly mean?
This should work:

Code: Select all

2 * 82  00
            04 07 01
            00                  // ID
                08 "IST1"      // class
                0C FE 
                0D FE 
                11 00 
                14 FF 
                15 FF 
                09 04                       // layouts
                    1D 08 00 00                     // ground sprite
                    00 00 00        10 05 01        // offsets, sizes
                    2D 84 00 00         80          // draw sprite with 1CC <--- sprite number has been changed to use company colours
                    1D 08 00 00                     // ground sprite
                    00 00 00        05 10 0F        // offsets, sizes
                    2E 84 00 00         80          // draw sprite with 1CC
                    1D 08 00 00                     // ground sprite
                    00 00 00        10 05 01        // offsets, sizes
                    2D 84 00 00         80          // draw sprite with 1CC
                    1D 08 00 00                     // ground sprite
                    00 00 00        05 10 0F        // offsets, sizes
                    2E 84 00 00         80          // draw sprite with 1CC
3 * 4    01 04 01 02
4 sprites/Statues.pcx 82 8 09 52 64 -31 -21
5 sprites/Statues.pcx 162 8 09 56 64 -31 -25
6 * 7    02 04 00 00 01 00 00
7 * 7    03 04 01 00 00 00 00
8 * 17   04 04 9F 01 00 "Airplane 1" 00
RL Conroy wrote: I Copied this Code from a GRF I Created Earlier. Do i must Remove the "07" then?

EDIT: When i Removed the "07" the GRF did not Appear in the "Add NewGRF's"!
It is getting Messed up when i Reedit a Value!
Post the Action 00 for a station from each class and I will have a look :)
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 [90% Ready!] (Help Needed with Station NFO

Post by RL Conroy »

zero.eight wrote:This should work
I Reedited it but Still the Same Results

The Complete Code (Only Reedited the Values you said to me):

Code: Select all

0 * 4	 1E 00 00 00
1 * 49	 08 07 "ST" 83 08 "Airplane/Train Statues" 00
		 "Coded by: RL Conroy" 00
2 * 82	 00 04 07 01 00 08 "IST1" 0C FE 0D FE 11 00 14 FF 15 FF 09 04 1D 08 00 00 00 00 00 10 05 01
	 2D 84 00 00 80 1D 08 00 00 00 00 00 05 10 0F 2E 84 00 00 80 1D 08 00 00 00 00 00 10 05 01 2D 84
	 00 00 80 1D 08 00 00 00 00 00 05 10 0F 2E 84 00 00 80
3 * 4	 01 04 01 02
4 sprites/Statues.pcx 82 8 09 52 64 -31 -21
5 sprites/Statues.pcx 162 8 09 56 64 -31 -25
6 * 7	 02 04 00 00 01 00 00
7 * 7	 03 04 01 00 00 00 00
8 * 17	 04 04 9F 01 00 "ÅAirplane 1" 00
9 * 22	 00 04 07 01 01 08 "IST1" 0C FE 0D FE 11 00 14 FF 15 FF 0A 00
10 * 4	 01 04 01 02
11 sprites/Statues.pcx 322 8 09 56 64 -31 -25
12 sprites/Statues.pcx 402 8 09 52 64 -31 -21
13 * 7	 02 04 00 00 01 00 00
14 * 7	 03 04 01 01 00 00 00
15 * 17	 04 04 9F 01 01 "ÅAirplane 2" 00
16 * 22	 00 04 07 01 02 08 "IST1" 0C FE 0D FE 11 00 14 FF 15 FF 0A 00
17 * 4	 01 04 01 02
18 sprites/Statues.pcx 562 8 09 35 64 -31 -4
19 sprites/Statues.pcx 642 8 09 34 64 -31 -3
20 * 7	 02 04 00 00 01 00 00
21 * 7	 03 04 01 02 00 00 00
22 * 14	 04 04 9F 01 02 "ÅTrain 1" 00
23 * 22	 00 04 07 01 03 08 "IST1" 0C FE 0D FE 11 00 14 FF 15 FF 0A 00
24 * 4	 01 04 01 02
25 sprites/Statues.pcx 2 88 09 34 64 -31 -3
26 sprites/Statues.pcx 82 88 09 35 64 -31 -4
27 * 7	 02 04 00 00 01 00 00
28 * 7	 03 04 01 03 00 00 00
29 * 14	 04 04 9F 01 03 "ÅTrain 2" 00
30 * 29	 04 04 9F 01 00 "ÄTrain/Airplane Statues" 00
Last edited by RL Conroy on 07 Oct 2010 19:44, edited 1 time in total.
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
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 »

Ehm... I know what was Causing the Merging Problem!
The Station Classes from "Train/Airplane Statues" & "Industry Station Tiles" was the Same! Image
And the Company Colours Problem is also Fixed! Thanks for Your help zero.eight! :wink:

I also Planned to Create a Drive-In Movie! Only it must be Animated ofcourse...
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
:arrow: How do i Set Bit 31? I wanna Try out what zero.eight said to me Earlier.
Wiki wrote:With bit 31 set, this sprite will refer to a TTD sprite, not the action 1 sprite
Can someone tell me how it works so i can Learn more about Creating GRF's?
Because the Pages at TTDPatch Wiki are not so Understandable...

RRRR842D+X is 2D 48 RR RR, Right? (I hope...?()

EDIT: And a Question: How does Bit 31 Know which Sprites to Use?
Must you Add a Value to Allow to Use the Sprites from "trg1r"?

EDIT: Must i Add it after here:

Code: Select all

9 * 22	 00 04 07 01 01 08 "IST1" 0C FE 0D FE 11 00 14 FF 15 FF 0A 00 <- 2D 48 RR RR
EDIT: And if i want to Code a Industry Tile i must put in this Code: 2D 48 20 54 (Transformator from "trg1r") :?:

I hope you Understand what i Said here...
I think nobody is Interested with Helping me

EDIT: It will take a while before i get an Answer... Image
Attachments
It Works Perfectly now!
It Works Perfectly now!
Statue Company Colours.png (27.58 KiB) Viewed 1917 times
Drive-In Movie
Drive-In Movie
Drive-In Movie.png (3.74 KiB) Viewed 1917 times
(Note: The Coal Mine is NOT Real! They are Station Tiles!)
(Note: The Coal Mine is NOT Real! They are Station Tiles!)
Airport Lights.png (88.93 KiB) Viewed 1917 times
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
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Re: Some Requests (Help Needed)

Post by Lakie »

I'm not completely sure what you're having issues with, and I've not wrote any station grfs in a long time.

But from the wiki I gather that RRRR is actually the recolour map to use, which I doubt is what you want.
Similarly bit 15 is used to flag the sprite should be recoloured (0x8000), which again may not be what you want.

Setting bit 31 flags that the sprite should be taken from the base graphics and not the Action1 sprites you provide.
Bit 31 = 1 << 31 = 0x80000000, thus you'd add this number to the sprite you want to draw.

If you wanted to use a transmitter you'd add 2601 (transmitter sprite) with bit 31, thus get 0x80000A29 or "29 0A 00 80" in little endian.

I suggest you use the layout zero.eight showed for you action0, it'll make life easier for you.
Using that layout you would replace the first dword on the "//draw sprite with 1CC" lines, with the sprite you wish to draw.

~ Lakie
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
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 »

I want to Recreate my GRF which use the Original Graphics. (Look at the Top of Page 6)
I'm Trying to Understand how to Use Bit 31.
Lakie wrote:But from the wiki I gather that RRRR is actually the recolour map to use, which I doubt is what you want
No i only want to Replace the Graphics from my GRF into References (Bit 31) to Graphics fom trg1r.
Lakie wrote:Bit 31 = 1 << 31 = 0x80000000, thus you'd add this number to the sprite you want to draw
Lakie wrote:Using that layout you would replace the first dword on the "//draw sprite with 1CC" lines, with the sprite you wish to draw
Uhhhm... How do i do that with A LOT of References to Sprites? It is a Little Confusing right now... :oops: Or it is just Me
I tried to read the Wiki but it is Complicated... Image
Lakie wrote:I suggest you use the layout zero.eight showed for you action0
I only know how to use Company Colours with those Codes. Not how to put in Bit 31 :oops:
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 the wiki says something about setting a bit, it means that you need to set a bit in a binary number. However, NFO requires hex unless you use escapes that GRFCodec can handle, so you need to know how to convert binary to hex.

The procedure for setting bit 31 is almost the same as that for bit 15.

In general, to set a bit in a binary number, start from the right and count from zero until you reach the number of that bit, so for bit bit 31, count 32 places, for 15 count 16 etc.

Code: Select all

00000000000000000000000000000000 (binary)
^ bit 31                 bit 0 ^
set a bit by changing its value to 1. Setting bit 31 gives

Code: Select all

10000000000000000000000000000000
which isn't a nice number to read, so change it to hex.
To do this, split the number into groups of 4 bits (nibbles) and convert each nibble to hex.

Code: Select all

1000 0000 0000 0000 0000 0000 0000 0000   (bin)
 8    0    0    0    0    0    0    0     (hex)
This is where you need to know basic binary to hex. Or put the number into a converter.

This effectively gives you what Lakie said:
Lakie wrote:Bit 31 = 1 << 31 = 0x80000000

To use this for an Action 00 sprite layout (non-ground sprite), use the number for the sprite that you want from the base set and set bit 31 by following the above. That is, grab the sprite number, convert it to hex and set bit 31.

For example, take sprite 2190. The long method is:

Convert sprite number to hex: 2190(d) = 0x88E

We want to set bit 31, so convert 0x88E to binary:

Code: Select all

1000 1000 1110   (bin)
 8    8    E     (hex)
then set bit 31:

Code: Select all

1000 0000 0000 0000 0000 1000 1000 1110   (bin)
 8    0    0    0    0    8    8    E     (hex)
and use 0x8000088E as your sprite number.

An easy way to do this is to add "8" to the beginning of sprite numbers when written as doublewords, so the quick method is convert the sprite number to hex and add 0x80000000 (0x88E + 0x80000000. Much quicker than converting everything, but be careful when setting other bits).

You might want to try combining this and the procedure for bit 15 to draw sprite 4445 with company colours (its the office block that is built with a random colour) :)

Hope this is a little clearer,

- D
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 »

Wow... And i Thought that Coding Graphics was Hard to do... :shock:
zero.eight wrote:and use 0x8000088E as your sprite number
You mean Something like this? I'm Sorry if it is Wrong but i'm Trying to Understand it...

Code: Select all

2 * 82	 00 04 07 01 00 08 "IST1" 0C FE 0D FE 11 00 14 FF 15 FF 09 04 1D 08 00 00 00 00 00 10 05 01
	 2D 04 00 00 80 1D 08 00 00 00 00 00 05 10 0F 2E 04 00 00 80 1D 08 00 00 00 00 00 10 05 01 2D 04
	 00 00 80 1D 08 00 00 00 00 00 05 10 0F 2E 04 00 00 80 
    3 * 4	 01 04 01 02
    4 sprites/Station_Tiles.pcx 82 8 09 31 64 -31 0
    5 sprites/Station_Tiles.pcx 162 8 09 31 64 -31 0
    6 * 7	 02 04 00 00 01 00 00
    7 * 7	 03 04 01 00 00 00 00
    8 * 18	 04 04 9F 01 00 "ÅCoal Mine 1" 00
    9 * 22	 00 04 07 01 01 08 "IST1" 0C FE 0D FE 11 00 14 FF 15 FF 0A 00 <- 80 00 07 FF
   10 * 4	 01 04 01 02
   11 sprites/Station_Tiles.pcx 322 8 09 31 64 -31 0
   12 sprites/Station_Tiles.pcx 402 8 09 48 64 -31 -17
   13 * 7	 02 04 00 00 01 00 00
   14 * 7	 03 04 01 01 00 00 00
   15 * 18	 04 04 9F 01 01 "ÅCoal Mine 2" 00
   16 * 22	 00 04 07 01 02 08 "IST1" 0C FE 0D FE 11 00 14 FF 15 FF 0A 00 <- 80 00 08 02
   17 * 4	 01 04 01 02
   ...
And how do you Code this then: That they both have Different Sprites just like Basic Stations from maquinista.
Each Platform Creates a other thing instead of 2 the Same things. You know what i mean?
Attachments
Different Tiles.png
Different Tiles.png (7.63 KiB) Viewed 1651 times
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: Bing [Bot], Google [Bot] and 15 guests