[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

Post Reply
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 »

mmm that is not really a solution more a workaround.

anyone know how to fix this please ?


Quoting because of new page :)
something super crap i just saw:
1.PNG
1.PNG (88.37 KiB) Viewed 5029 times
when it is normal or electric track all works fine.
upgrading to monorail will get some crapy part of the factory and the maglev some building ground sprite...

this is the code i used for the instances:

Code: Select all

   24 * 18	 00 04 07 01 03 08 "FENA" 11 00 14 FF 15 FF 0A 00
   25 * 4	 01 04 01 02
   26 C:\TTD\sprites\Fences.pcx 2 88 09 33 64 -31 -2
   27 C:\TTD\sprites\Fences.pcx 82 88 09 32 64 -31 -1
   28 * 7	 02 04 00 00 01 00 00
   29 * 7	 03 04 01 03 00 00 00
   30 * 25	 04 04 9F 01 03 "ÅFence MID-T-Wall 1" 00
could anyone help me out in this crappy error ?
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 »

have been going trough the whole code, i cant find the error :/
anyone get some clues ?
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 988
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

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

Post by frosch »

Where is your Action 0 sprite layout?
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
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 »

that is it for that layout. because it is just a plain tile there is no need to copy a base sprite isn't there ? ?(
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 »

ahaa, i guess this is the reason why there is no other set that has non-track tiles with underlaying sprite layout.
even the generic buffer stops get the green tiles from the drawn sprite.

so there is no set that i can decompile and look at the code that has this same thing. :(
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 »

Looks like a manifestation of the "automatically change the ground sprite for monorail and maglev" feature, but I can't be sure without seeing the Prop 09 code. I assume that your ground sprite for those full-tile fence tiles is the grass one (3981). In that case, see what I wrote above about sprites automatically changing: http://www.tt-forums.net/viewtopic.php?f=26&t=50808&p=913049. A solution is to use the rail sprite as your ground sprite then draw the grass one over it. EDIT: And use multiple layouts and callbacks, see below.

grass tile from VAST:

Code: Select all

    \dx000003F4                                               // rail sprite. Game will change me in monorail and maglev. 
    00 00 80		00 00 00		\dx80000F8D                   // grass sprite. EDIT2: I DO change when the rail type changes. And I change to match the climate. 
    00 00 00		0F 0F 00		\dx0000042D		80           // some Action 1 overlay. Mud probably. 
    \dx000003F3                                               // rail sprite in the other direction
    00 00 80		00 00 00		\dx80000F8D
    00 00 00		0F 0F 00		\dx0000042D		80
If that isn't the cause then I don't know what it could be.
Last edited by zero.eight on 22 Nov 2010 18:06, edited 3 times in total.
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 »

code is like this now:

Code: Select all

   102 * 78	 00 04 05 01 14 08 "FENB" 11 00 14 FF 15 FF 09 04 
	    8D 0F    00 00 00    
	 00 00 10    05 01 2D    84 00 00 
	 80    
	    8D 0F    00 00 00  
	 00 00 05    10 0F 2E    84 00 00 
	 80    
	    8D 0F    00 00 00   
	 00 00 10    05 01 2D    84 00 00 
	 80 
	    8D 0F    00 00 00    
	 00 00 05    10 0F 2E    84 00 00 
	 80
   103 * 4	 01 04 01 02
   104 C:\TTD\sprites\Fences.pcx 225 240 09 33 64 -47 -10
   105 C:\TTD\sprites\Fences.pcx 293 240 09 32 63 -14 -9
   106 * 7	 02 04 00 00 01 00 00
   107 * 7	 03 04 01 14 00 00 00
   108 * 29	 04 04 9F 01 14 "ÅFence SIDE-Wall Gate 1" 00

@ zero.eight
but in that case, wouldn't the snow landscape be also showing the grass ?
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 »

I would change the layout to

Code: Select all

F4 03 00 00                             // rail sprite
00 00 80	00 00 00	8D 0F 00 80       // grass sprite
00 00 00	10 05 01	2D 84 00 00       // Action 1 sprite #1
80                                          // end layout
F3 03 00 00                             // rail sprite
00 00 80	00 00 00	8D 0F 00 80       // grass sprite
00 00 00	10 05 01	2E 84 00 00       // Action 1 sprite #2
80                                          // end layout
Dante123 wrote:but in that case, wouldn't the snow landscape be also showing the grass ?
Yes.
The "grass" tile changes in different climates, but in all cases it is the tile that looks like it is grass of some colour. The "alternative" tile is the snow/desert tile. That is a different tile which (I think) can be selected by using the number of the snow sprite (4550) and it will change in Subtropical to the desert tle. In theory that would give you a snow tile in Temperate and Arctic, a desert tile in Subtropical and some other thing in Toyland.

You could create two tiles: one that uses grass and one that uses snow, and let players place them wherever they want. Or you could create a single tile with a VarAction 2 that changes the graphics based on the tile it is on (grass/snow/desert etc). Never done that; can't guarantee it works.
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 »

using the code you suggested:

new result will be:
1.PNG
1.PNG (43.68 KiB) Viewed 4895 times

so i guess i just have to make overdraw the grass, or people just shouldn't use the mono/maglev.

but im still open for new solutions :/
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 988
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

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

Post by frosch »

Ok, I think now I understood what you are trying to do :)

Station spritelayouts can reference sprites from Action1 and global sprites.
All global sprites get an offset depending on the railtype. So, yes, you cannot use the default grass tile in station layouts.
Either you have to draw your custom grass/snow/desert (which will look weird with other landscape sets), or you need to overpaint the track.

Alternatively you can create separate spritelayouts for the railtypes and adjust the spritenumbers in them so they result in the grass sprite after adding the offset (82 for monorail, 164 for maglev).
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
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 »

Fences updated to version 1.1

check: 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]DWE - Station/NewObject tiles Set

Post by Dante123 »

some of the new/updated sprites for the station terrain set im now working on:
1.PNG
1.PNG (4.62 KiB) Viewed 4826 times
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 »

i have yet another interesting question:

example i have drawn 5 sprites.
what i want to do is when someone builds 1 station tile, it will sort of random select one of those 5 tiles.
now i wonder, how do i define this ? how to put this in the code ? ?(
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 »

Sorry, what I wrote earlier was wrong. Fixed it now.

As frosch said, the base set sprites change in different rail types. You can get around this by defining 3*howeverManyLayoutsYouWant and offsetting the sprite number, then using callbacks to choose the layout depending on the rail type. See http://www.tt-forums.net/viewtopic.php?f=68&t=49078&p=889680#p889680.


For random layouts you can use Random Action 2. That will give you a random choice of n layouts where n is a power of two in the range 2 to probably 128. Works well for a single tile.
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 »

i will dive into this one, complex for a starting coder :roll:
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 »

trying to get my head around the coding.

so far i have the generic code working (thanx zero.eight) but now i want some stuff like a introduction year of the station elements.
but i cant get it in the code.
the post about it is here: http://www.tt-forums.net/viewtopic.php?p=915038#p915038
really hope some people can help me out in this one ?

once i have a bit of generic code working i can get back to the drawing board and draw some of the real awesome sprites (yea that fences was more of a test :wink: to get the hang on sprites and coding )
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 »

some small new sprites drawn:
1.PNG
1.PNG (9.25 KiB) Viewed 4600 times
2.PNG
2.PNG (7.64 KiB) Viewed 4600 times
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 »

darn, kind of stupid, but what did i had to add to the code to make company colors work ? i totally forgot how :oops:
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 »

Dante123 wrote:darn, kind of stupid, but what did i had to add to the code to make company colors work ? i totally forgot how :oops:
nvm, got it :D

will put down some sprites very soon again :)
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 »

update on new sprites:

first draftings:

Image

Image
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 62 guests