[OTTD]DWE SET (Station Tiles/NewObjects)
Moderator: Graphics Moderators
Re: [OTTD](V0.2)Station/NewObject tiles - Fences
got it =)
and yet 1 more question for now: how i i set a year at when certain entries get available ?
and yet 1 more question for now: how i i set a year at when certain entries get available ?
Re: [OTTD](V0.2)Station/NewObject tiles - Fences
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...
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
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
~ 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."
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."
Re: [OTTD](V0.2)Station/NewObject tiles - Fences
@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.
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.
Re: [OTTD](V0.2)Station/NewObject tiles - Fences
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
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."
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."
Re: [OTTD](V0.2)Station/NewObject tiles - Fences
ok just checking:
in this example:
i need to add this line (after 216) to make it available in year 1949:
or am i just plain stupid now?
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
Code: Select all
217 * 4 02 04 11 89 24 00 FF FF FF FF 01 \wx8000 \d0 \d1949 \wx8001
Re: [OTTD](V0.2)Station/NewObject tiles - Fences
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.
[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
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
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."
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."
Re: [OTTD](V0.2)Station/NewObject tiles - Fences
ok i think i get it, i will give it a go.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.[edit]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
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
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
Re: [OTTD](V0.2)Station/NewObject tiles - Fences
the years work like a charm thank lakie!
Re: [OTTD](V0.3)Station/NewObject tiles - Fences
check out the first post of this topic for the new 0.3 release!!
http://www.tt-forums.net/viewtopic.php?p=911187#p911187
http://www.tt-forums.net/viewtopic.php?p=911187#p911187
Re: [OTTD](V1.0)Station/NewObject tiles - Fences
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
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
- Dwight_K._Schrute
- Traffic Manager
- Posts: 209
- Joined: 01 Sep 2010 11:29
Re: [OTTD](V1.0)Station/NewObject tiles - Fences
Very nice! I like them a lot
Re: [OTTD](V1.0)Station/NewObject tiles - Fences
thanks great to hear thats where i do it for (this motivates me to start on a second grf )Dwight_K._Schrute wrote:Very nice! I like them a lot
Re: [OTTD]DWE - Station/NewObject tiles Set
started work on the first station terrain tiles.
here the first experiment: 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 ?
here the first experiment: 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 ?
-
- Tycoon
- Posts: 1283
- Joined: 23 Oct 2009 19:35
- Location: Here and there, sometime or another
Re: [OTTD]DWE - Station/NewObject tiles Set
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. ---
--- 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. ---
- zero.eight
- Traffic Manager
- Posts: 128
- Joined: 15 Jun 2007 01:14
Re: [OTTD]DWE - Station/NewObject tiles Set
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.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 ?
OpenTTD: VAST - station tiles and objects | MICS - urban monorail graphical conversion | Universal Rail Type - easier train replacement
Re: [OTTD]DWE - Station/NewObject tiles Set
i was using this wiki page: http://wiki.ttdpatch.net/tiki-index.php ... n0Stationszero.eight wrote: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.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 ?
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
Re: [OTTD]DWE - Station/NewObject tiles Set
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
...
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."
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."
Re: [OTTD]DWE - Station/NewObject tiles Set
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.
Re: [OTTD]DWE - Station/NewObject tiles Set
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)
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)
again i just dont see a rail, only empty normal ground
Re: [OTTD]DWE - Station/NewObject tiles Set
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
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."
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."
Who is online
Users browsing this forum: No registered users and 27 guests