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

Extended control over vehicle smoke #4263

Closed
DorpsGek opened this issue Nov 24, 2010 · 4 comments
Closed

Extended control over vehicle smoke #4263

DorpsGek opened this issue Nov 24, 2010 · 4 comments
Labels
component: NewGRF This issue is related to NewGRFs flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

andythenorth opened the ticket and wrote:

r21240 added support for visual effects (smoke etc) for RVs and ships, which is awesome

For ships, the current method of specifying a z offset for one effect vehicle is insufficient. Ships may have:
- n funnels (n<6 in a sane world)
- funnels offset laterally (at sides of ships)
- end of funnel may be somewhat higher than default z index for smoke (currently 10)
- ships should be able to produce diesel smoke constantly, not just when accelerating

Having discussed with frosch, a solution might be...

frosch123: i mean, call the callback everytime a smoke cloud needs to be created, and the cb returns the amount of clouds and their positions. all at once in one cb

--

*newgrf spec*
modify CB10 to be called more often (for visual effects only)

return the number of effects in the higher bits of cb10 result

maybe return the positions in register 100, 101, ... (tempoary result registers, no persistent storage)

positions need to encode xyz positions

*vehicle.cpp*
loop n times (number of vehicles to draw)
int x = _vehicle_smoke_pos[v->direction] * effect_offset_along + _vehicle_smoke_pos[(v->direction + 2) % 8] * effect_offset_lateral;
int y = _vehicle_smoke_pos[v->direction] * -effect_offset_lateral + _vehicle_smoke_pos[(v->direction + 2) % 8] * effect_offset_along;
^ I tested this in a hacky patch, appears to work for providing lateral offsets.

z position is allowed for already in code to add effect vehicle. It's hard-coded for 10 and would need to use a variable instead.

Attachments

Reported version: Version?
Operating system: All


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

DorpsGek commented Apr 3, 2012

andythenorth wrote:

Eddi|zuHause: or call the callback multiple times, var10 being the number of times it has already run. return coords, or "no further vehicle"


This comment was imported from FlySpray: https://bugs.openttd.org/task/4263#comment11063

@DorpsGek
Copy link
Member Author

michi_cc wrote:

I need:
- n effect vehicles
- arbitrary x / y / z positions
- ideally I would have animation control to control smoke timing per vehicle, but not essential
- ideally I would be able to use animation control to specify smoke generation, independent of current acceleration algorithm used
I don't need:
- the ability to create new effect vehicles
- the ability to control what happens within the effect vehicle
(i.e. they're fire and forget as far as I'm concerned)
the two points above about animation control collapse to the same point I think


This comment was imported from FlySpray: https://bugs.openttd.org/task/4263#comment11298

@DorpsGek
Copy link
Member Author

andythenorth wrote:

Supported in newgrf some while ago.


This comment was imported from FlySpray: https://bugs.openttd.org/task/4263#comment14377

@DorpsGek
Copy link
Member Author

andythenorth closed the ticket.

Reason for closing: Implemented


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

@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) component: NewGRF This issue is related to NewGRFs enhancement labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: NewGRF This issue is related to NewGRFs flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant