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

Vehicles: callback to populate vehicle purchase list #5471

Closed
DorpsGek opened this issue Feb 11, 2013 · 7 comments
Closed

Vehicles: callback to populate vehicle purchase list #5471

DorpsGek opened this issue Feb 11, 2013 · 7 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

Pikka opened the ticket and wrote:

It would be nice to have a callback to add/remove vehicles from the purchase list, so that different players could have different vehicles available (similar to the way, at the moment, one player can have access a prototype vehicle that other players do not).

The only use of this callback I can think of is:

c) giving players exclusive vehicles in multiplayer games (for example, player 1 gets German trains and player 2 gets French trains).

Callback returns 0 to allow and 1 to hide vehicle from buy list. Perhaps 2 to display vehicle but not allow construction? This callback (or some other callback) should also have the ability to auto-reject new vehicle prototypes. Otherwise players will be offered prototypes of vehicles they're not going to be able to build.

New variables which would be nice, but not essential, for this callback are:

a) availability of other vehicle (x). This would allow, for example, specialist wagons to be hidden before the locomotive which hauls them appears.
b) count of vehicle (this/x) (owned by this player/everyone). This would allow authors to limit the number of a particular vehicle, if they wanted to do that for some reason.

Reported version: trunk
Operating system: All


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

Alberth wrote:

Second attempt at the description, previous attempt was in #5467


This comment was imported from FlySpray: https://bugs.openttd.org/task/5471#comment11999

@DorpsGek
Copy link
Member Author

Eddi wrote:

Implementation details:
src/engine_base.h:Engine already has this member:
CompanyMask company_avail; ///< Bit for each company whether the engine is available for that company.

it just needs a NewGRF-y way to set the value.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5471#comment12000

@DorpsGek
Copy link
Member Author

Eddi wrote:

A possible use-case for this callback would be to force availability of vehicles circumventing the builtin randomisation.
E.g for EMU-Wagons to become available immediately when the matching EMU gets offered as a prototype/general availability.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5471#comment12002

@DorpsGek
Copy link
Member Author

Alberth wrote:

http://irclogs.qmsk.net/channels/openttd/link/1360588209# 1360588209 some random conversation in # openttd about this issue.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5471#comment12003

@DorpsGek
Copy link
Member Author

Pikka wrote:

http://www.tt-forums.net/viewtopic.php?f=68&t=59630&p=1065767# p1065767


This comment was imported from FlySpray: https://bugs.openttd.org/task/5471#comment12004

@DorpsGek
Copy link
Member Author

andythenorth wrote:

Not convinced that this is super-useful, but eh.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5471#comment14682

@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
@andythenorth
Copy link
Contributor

Not any more convinced that this is a (good) BAD FEATURE. Let's close it.

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

2 participants