Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable 10: Pick sprites *and recoloring* for different GUI windows? #6518

Closed
DorpsGek opened this issue Nov 1, 2016 · 8 comments
Closed
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Nov 1, 2016

Snail_ opened the ticket and wrote:

Hi there,

An OTTD feature I'm using is Variable 10, to display different sprites in the GUI and on the map. This feature is explained here:

http://www.ttdpatch.de/grfspecs/VarAction2Vehicles.html

However, I noticed this feature only allows to display different sprites, but not a different recoloring.

I would like to kindly ask you to extend, if possible, this feature to recoloring as well.
The reason for this is that, in my set, I make heavy use of the push-pull feature. One of the consists supporting push-pull is a passenger train, that will allow coaches of different shapes and colors in the consist. When reversing, I'm swapping both the sprite and the recoloring across the vehicles in the consist; however, I don't do this in the vehicle GUI, where I want to keep the original, non-reversed order (to match the capacity info with the correct coach).

In the current OTTD, the resulting effect is a vehicle GUI with a correct placement of the sprites, but an incorrect placement of the recoloring.
Please see the two attached pictures:

  1. The first one depicts a consist with the engine pulling the train, followed by a "white-red" coach with doors in the middle, then two "white-black" coaches with doors at the edges, and finally the driving trailer. Both the train in the map, and in the GUI, are correctly drawn.

  2. The second one shows the same train, after reversing. As you can see, push-pull works well in the map, with the driving trailer now heading the train, then two "white-black" coaches with doors at the edges, then one "white-red" coach with doors in the middle, and finally the engine pulling. However, the GUI is not right: as you can see, the sprites themselves are correct (there is a coach with doors in the middle right after the engine), but the recoloring is wrong (the coach right after the engine is colored white-black, while the last-but-one is white-red).

My set makes a heavy use of recoloring, for different reasons; it's not practical for me to avoid it. Unfortunately, until Variable 10 doesn't support recoloring, the effect will always be suboptimal.

Could you please add this feature?

Thanks in advance

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/6518
@DorpsGek
Copy link
Member Author

DorpsGek commented Nov 1, 2016

Snail_ wrote:

EDIT: I'm not sure if the pictures are displaying correctly. If not, you can find them at https://www.tt-forums.net/viewtopic.php?f=32&t=75406 .


This comment was imported from FlySpray: https://bugs.openttd.org/task/6518#comment14284

@DorpsGek
Copy link
Member Author

DorpsGek commented Nov 1, 2016

frosch wrote:

I think this is already possible with the recently added "stacked vehicle sprites" feature.
See here:
NFO: https://newgrf-specs.tt-wiki.net/wiki/Action2/Vehicles# Composing_vehicles_from_multiple_sprites
NML: https://newgrf-specs.tt-wiki.net/wiki/NML:Vehicles# Composing_vehicles_from_multiple_sprites


This comment was imported from FlySpray: https://bugs.openttd.org/task/6518#comment14285

@DorpsGek
Copy link
Member Author

DorpsGek commented Nov 2, 2016

Snail_ wrote:

Thanks. This might be a solution, but it would add complexity to the set, and I'm afraid it might seem a bit counter-intuitive (effectively, we'd be solving a limitation of var10 by using a different feature such as stacked sprites).

I think a more direct solution would be to have var10 accept different recoloring, in addition to sprites. It would allow me to keep my code leaner (so easier to read and debug). Would that be possible?


This comment was imported from FlySpray: https://bugs.openttd.org/task/6518#comment14286

@DorpsGek
Copy link
Member Author

DorpsGek commented Nov 2, 2016

frosch wrote:

I do not understand what you mean with "var 10 accepts recoloring". Var 10 is a input variable, no output.

Anyway, the "stacked sprites" feature allows to return sprites and recoloring together via the same varaction2. IMHO it cannot be simpler than that.
That is, I think your code should become easier than it is now.

You do not need to actually stack any sprites. Stacking 1 sprite is the same as no stacking.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6518#comment14288

@DorpsGek
Copy link
Member Author

DorpsGek commented Nov 2, 2016

Snail_ wrote:

What I meant was, I would suggest allowing var10 to display different recoloring, in addition to different sprites.

Although sprite stacking could be the solution to my specific case, IMO allowing var10 to display different sprites, but not different recoloring, limits the scope of it. It's like having something potentially very useful, but actually not quite useful, because of its limitations.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6518#comment14289

@DorpsGek
Copy link
Member Author

DorpsGek commented Nov 3, 2016

mb wrote:

Anyway, the "stacked sprites" feature allows to return sprites and recoloring together
via the same varaction2. IMHO it cannot be simpler than that.
That is, I think your code should become easier than it is now.

Problem is that he can´t give a reference to an allocated recolour map, rather than the number of a (static) TTD recolour sprite.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6518#comment14290

@DorpsGek
Copy link
Member Author

DorpsGek commented Nov 3, 2016

frosch wrote:

That assumption is incorrect. Of course both works.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6518#comment14291

@DorpsGek
Copy link
Member Author

DorpsGek commented Nov 6, 2016

frosch closed the ticket.

Reason for closing: Out of date


This comment was imported from FlySpray: https://bugs.openttd.org/task/6518

@DorpsGek DorpsGek closed this as completed Nov 6, 2016
@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant