[OTTD]DWE SET (Station Tiles/NewObjects)

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

Dante123
Chief Executive
Chief Executive
Posts: 671
Joined: 11 Aug 2009 16:10
Location: The Nederlands
Contact:

Re: [OTTD](V0.2)Station/NewObject tiles - Fences

Post by Dante123 »

got it =)

and yet 1 more question for now: how i i set a year at when certain entries get available ?
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Re: [OTTD](V0.2)Station/NewObject tiles - Fences

Post by Lakie »

OK, you'll have to bare with me, as it been a long time since I looked at station specific things.

From what I gather you'll need to specify that you'll be handling cb13, bit 0 of property 0B.

Next in your Action2 chain, you'll need to insert a callback sorter and filter for cb13.
Using various information (I'm presuming either action2 var 00/01 or 23/24), return either zero (disallow), or non-szero (allow).

An example of how it could look...

Code: Select all

# Disclaimer, I usually don't comment my action2's very much...

#Normal action2 (sprites above, etc)
0 * 0      02 04 00
             00
             01
               00 00

# Specific start stop dates (not used)
# - Available from 1/1/1950 to 31/12/2050
0 * 0      02 04 10
             89 # dword sized variable
               23 # Current date (dword)
                 00  FF FF FF FF # No bit shift or mask
                   01 # One result
                     \wx8001    \d1950-1-1  \d2050-12-31 # Year-Month-Day
                     \wx8000

# Just using years
#  - Unavailable from 0AD to 1949.
0 * 0      02 04 11
             89
               24 # Current Year (dword?)
                 00  FF FF FF FF
                   01
                     \wx8000    \d0  \d1949
                     \wx8001

# Callback sorter
0 * 0      02 04 20
             85 # Word value size
               0C # Current Callback
                 00  FF FF
                   01
                     11 00    \wx13  \wx13 # cb13 filter (chains to the one above)
                     00 00 # Graphics to use

# Action3
0 * 0      03 04
             01 00
               00
                 20 00 # leads to the callback sorter above
I'm unsure if this will produce what you after, (as I've not dealt with it before or tested it), but hope it helps anyway,
~ 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
DJ Nekkid
Tycoon
Tycoon
Posts: 2141
Joined: 30 Nov 2006 20:33

Re: [OTTD](V0.2)Station/NewObject tiles - Fences

Post by DJ Nekkid »

@Lakie:
Would not variable 23 be better if he is gonna sort it by date? 24 is year since 0, and 23 is date/day from year 0.
Member of the
ImageImage
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Re: [OTTD](V0.2)Station/NewObject tiles - Fences

Post by Lakie »

That's why I mentioned both, one for dates (A10) and one for (generic) years (A11). :)
It was meant more to show him how its structured and how to use them, than a copy 'n' paste example.

~ Lakio
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."
Dante123
Chief Executive
Chief Executive
Posts: 671
Joined: 11 Aug 2009 16:10
Location: The Nederlands
Contact:

Re: [OTTD](V0.2)Station/NewObject tiles - Fences

Post by Dante123 »

ok just checking:

in this example:

Code: Select all

   215 * 18	 00 04 07 01 30 08 "FENC" 11 00 14 FF 15 FF 0A 00
   216 * 4	 01 04 01 02
   217 C:\TTD\sprites\Fences.pcx 525 240 09 33 64 -15 +6
   218 C:\TTD\sprites\Fences.pcx 600 240 09 32 63 -47 +7
   219 * 7	 02 04 00 00 01 00 00
   220 * 7	 03 04 01 30 00 00 00
   221 * 31	 04 04 9F 01 30 "ÅFence SIDE-Wall Tracks 2" 00
i need to add this line (after 216) to make it available in year 1949:

Code: Select all

217 * 4	 02 04 11 89 24 00 FF FF FF FF 01 \wx8000 \d0 \d1949 \wx8001
or am i just plain stupid now? :lol:
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Re: [OTTD](V0.2)Station/NewObject tiles - Fences

Post by Lakie »

Not quite, you need a callback sorter which chains to that sprite. (Also it'd be available from 1950, not 1949).
The ranges of the Action2var are inclusive.

Code: Select all

   # Need to indicate we'll be handling callback 13 (0B 01)
   215 * 20    00 04 06 01 30 08 "FENC" 11 00 14 FF 15 FF 0A 00 0B 01
   216 * 4    01 04 01 02
   217 C:\TTD\sprites\Fences.pcx 525 240 09 33 64 -15 +6
   218 C:\TTD\sprites\Fences.pcx 600 240 09 32 63 -47 +7
   219 * 7    02 04 00 00 01 00 00

   # this handles which value to return to OpenTTD / TTDPatch
   220 * 23   02 04 10 89 24 00 FF FF FF FF 01 \wx8000 \d0 \d1949 \wx8001

   # This filters off callback 13
   221 * 17   02 04 20 85 0C 00 FF FF 01  10 00  \wx13 \wx13  00 00

   # This points to the callback sorter
   222 * 7    03 04 01 30 00 20 00
   223 * 31    04 04 9F 01 30 "ÅFence SIDE-Wall Tracks 2" 00
[edit]
Are you decompiling the grf to regenerate the source?
As this looks quite a lot like decoded nfo, there is no need to do so.
Also using whitespace and comments (as I've shown above) can improve readability.

~ 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."
Dante123
Chief Executive
Chief Executive
Posts: 671
Joined: 11 Aug 2009 16:10
Location: The Nederlands
Contact:

Re: [OTTD](V0.2)Station/NewObject tiles - Fences

Post by Dante123 »

Lakie wrote:Not quite, you need a callback sorter which chains to that sprite. (Also it'd be available from 1950, not 1949).
The ranges of the Action2var are inclusive.

Code: Select all

   # Need to indicate we'll be handling callback 13 (0B 01)
   215 * 20    00 04 06 01 30 08 "FENC" 11 00 14 FF 15 FF 0A 00 0B 01
   216 * 4    01 04 01 02
   217 C:\TTD\sprites\Fences.pcx 525 240 09 33 64 -15 +6
   218 C:\TTD\sprites\Fences.pcx 600 240 09 32 63 -47 +7
   219 * 7    02 04 00 00 01 00 00

   # this handles which value to return to OpenTTD / TTDPatch
   220 * 23   02 04 10 89 24 00 FF FF FF FF 01 \wx8000 \d0 \d1949 \wx8001

   # This filters off callback 13
   221 * 17   02 04 20 85 0C 00 FF FF 01  10 00  \wx13 \wx13  00 00

   # This points to the callback sorter
   222 * 7    03 04 01 30 00 20 00
   223 * 31    04 04 9F 01 30 "ÅFence SIDE-Wall Tracks 2" 00
[edit]
Are you decompiling the grf to regenerate the source?
As this looks quite a lot like decoded nfo, there is no need to do so.
Also using whitespace and comments (as I've shown above) can improve readability.

~ Lakie
ok i think i get it, i will give it a go.
as far as i know im not using a decoded version. Conroy made the first setup for me (approx the first 50 lines), and once i started to see some sense in it together with the wiki i started to add more and more and i still keep PMing conroy too :P
Dante123
Chief Executive
Chief Executive
Posts: 671
Joined: 11 Aug 2009 16:10
Location: The Nederlands
Contact:

Re: [OTTD](V0.2)Station/NewObject tiles - Fences

Post by Dante123 »

the years work like a charm :D thank lakie! :bow:
Dante123
Chief Executive
Chief Executive
Posts: 671
Joined: 11 Aug 2009 16:10
Location: The Nederlands
Contact:

Re: [OTTD](V0.3)Station/NewObject tiles - Fences

Post by Dante123 »

check out the first post of this topic for the new 0.3 release!!

http://www.tt-forums.net/viewtopic.php?p=911187#p911187
Dante123
Chief Executive
Chief Executive
Posts: 671
Joined: 11 Aug 2009 16:10
Location: The Nederlands
Contact:

Re: [OTTD](V1.0)Station/NewObject tiles - Fences

Post by Dante123 »

check out the first post of this topic for the new 1.0 release!!

http://www.tt-forums.net/viewtopic.php?p=911187#p911187


and also another question.
when i have a sprite drawn, how on earth do i get a tile with the rail on it where i put the sprite on ?
i just cant seem to find what bits to set for that :?
User avatar
Dwight_K._Schrute
Traffic Manager
Traffic Manager
Posts: 209
Joined: 01 Sep 2010 11:29

Re: [OTTD](V1.0)Station/NewObject tiles - Fences

Post by Dwight_K._Schrute »

Very nice! I like them a lot :)
Dante123
Chief Executive
Chief Executive
Posts: 671
Joined: 11 Aug 2009 16:10
Location: The Nederlands
Contact:

Re: [OTTD](V1.0)Station/NewObject tiles - Fences

Post by Dante123 »

Dwight_K._Schrute wrote:Very nice! I like them a lot :)
thanks :) great to hear :D thats where i do it for (this motivates me to start on a second grf :tongue: )
Dante123
Chief Executive
Chief Executive
Posts: 671
Joined: 11 Aug 2009 16:10
Location: The Nederlands
Contact:

Re: [OTTD]DWE - Station/NewObject tiles Set

Post by Dante123 »

started work on the first station terrain tiles.
here the first experiment:
1.PNG
1.PNG (3.41 KiB) Viewed 4312 times
Question:
whatever i try, i cant get it working to have a rail in my tile getting displayed so i can put over my sprite as overlay.
anyone can help me out on that one ?
oberhümer
Tycoon
Tycoon
Posts: 1283
Joined: 23 Oct 2009 19:35
Location: Here and there, sometime or another

Re: [OTTD]DWE - Station/NewObject tiles Set

Post by oberhümer »

Suggestion: make the posts of the fences less dark. Easy and would make them look a lot better.
--- Licenses: GNU LGPL, version 2 or newer, code and graphics. CC-By-SA, graphics, alternatively. If you're using any, I'd like to hear about it --- Call them "track types" ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---

--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
User avatar
zero.eight
Traffic Manager
Traffic Manager
Posts: 128
Joined: 15 Jun 2007 01:14

Re: [OTTD]DWE - Station/NewObject tiles Set

Post by zero.eight »

Dante123 wrote:Question:
whatever i try, i cant get it working to have a rail in my tile getting displayed so i can put over my sprite as overlay.
anyone can help me out on that one ?
What have you tried? You need to define at least two sprites in each layout to get this to work, one of which is the rail sprite.
OpenTTD: VAST - station tiles and objects | MICS - urban monorail graphical conversion | Universal Rail Type - easier train replacement
Dante123
Chief Executive
Chief Executive
Posts: 671
Joined: 11 Aug 2009 16:10
Location: The Nederlands
Contact:

Re: [OTTD]DWE - Station/NewObject tiles Set

Post by Dante123 »

zero.eight wrote:
Dante123 wrote:Question:
whatever i try, i cant get it working to have a rail in my tile getting displayed so i can put over my sprite as overlay.
anyone can help me out on that one ?
What have you tried? You need to define at least two sprites in each layout to get this to work, one of which is the rail sprite.
i was using this wiki page: http://wiki.ttdpatch.net/tiki-index.php ... n0Stations
but i just dont know what bits to set and how to put it ?(


i already have this example code from some decompiled grf

Code: Select all

   
17 * 114    00 04 08 01 $$ 08 44 53 53 03 0B 02 0C FE 0D FD 11 00 14 FF 15 FF 09 06 F4 03 00 00 00 00 00 10
    10 10 2D 04 00 00 80 F3 03 00 00 00 00 00 10 10 10 2F 04 00 00 80 F4 03 00 00 00 00 00 10 10 10
    31 04 00 00 80 F3 03 00 00 00 00 00 10 10 10 32 04 00 00 80 F4 03 00 00 00 00 00 10 10 10 2E 04
    00 00 80 F3 03 00 00 00 00 00 10 10 10 30 04 00 00 80
now i already know and understand that on the place of the $$ should be a sprite number :) but all the rest....
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Re: [OTTD]DWE - Station/NewObject tiles Set

Post by Lakie »

Code: Select all

17 * 114    00 04 08 01 $$
              ...
              09
                06
                  F4 03 00 00 # <-- Ground sprite, usually tracks. (1012, should be adjusted by TTD automatically, iirc)
                    00 00 00   10 10 10   2D 04 00 00 # <-- Extra sprites to draw on top (this one has a bounding box)
                    80 # <-- Marks the end of extra sprite list
                  ...
Actually the $$ is the station number (grf specific, iirc).
I suggest you break down the code into the various parts, it makes it a lot easier to read and understand.

~ 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."
Dante123
Chief Executive
Chief Executive
Posts: 671
Joined: 11 Aug 2009 16:10
Location: The Nederlands
Contact:

Re: [OTTD]DWE - Station/NewObject tiles Set

Post by Dante123 »

yea i was already trying to break it down, but because i only have decompiled examples, all is in huge spaghetti looking strings. at some points i just cant find at what point to break it down again, and some stuff i just cant find back on the wiki.
Dante123
Chief Executive
Chief Executive
Posts: 671
Joined: 11 Aug 2009 16:10
Location: The Nederlands
Contact:

Re: [OTTD]DWE - Station/NewObject tiles Set

Post by Dante123 »

Code: Select all

00 00 00   10 10 10   2D 04 00 00 # <-- Extra sprites to draw on top (this one has a bounding box)
this i cant find back on the wiki =( but how/where does this define what sprite is getting drawn ?

edit:
seems to have something working..
only this part:

Code: Select all

F4 03 00 00 # <-- Ground sprite, usually tracks. (1012, should be adjusted by TTD automatically, iirc)
this seems to be de empty ground sprite. but how do i define the rail sprite in here ? (and does this also cover the monorail/normal/(newgrf metro rail))

again i just dont see a rail, only empty normal ground
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Re: [OTTD]DWE - Station/NewObject tiles Set

Post by Lakie »

I suggest you read all of the property 09 information, including the sub heading "Number of tiles supported" stuff.
The second block is actually described 3rd and 4th tables, the literally 80 marks the end of the sprite list.

~ 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."
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 27 guests