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

Callback to populate vehicle purchase list #5467

Closed
DorpsGek opened this issue Feb 9, 2013 · 5 comments
Closed

Callback to populate vehicle purchase list #5467

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

DorpsGek commented Feb 9, 2013

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 uses for this callback would include:

a) hiding "confusing" vehicles from an AI player.
b) hiding "AI Only" vehicles from a human player (for example, street traffic cars).
c) giving players exclusive vehicles in multiplayer games (for example, player 1 gets German trains and player 2 gets French trains).
d) enabling vehicles as "rewards", in cooperation with a game script.

Callback returns 0 to allow and 1 to hide vehicle from buy list. Perhaps 2 to display vehicle but not allow construction?

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/5467
@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 9, 2013

juanjo wrote:

This task is related with #5292 - Add filters to the build vehicle GUI.
The filter for vehicles solve b).
As for c) and d), I don't think a newGRF/GameScript callback is the right solution. It would be better to introduce a new engine/company bit: "Has this company rights to use this engine?". With that you can:
c) At the start of the game, set which set of engines each company will be allowed to use without paying any additional cost.
d) Enable vehicles as rewards controlled by GS.
e) When the company isn't allowed to use an engine, it can pay a (high) amount of money to use it.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5467#comment11991

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 9, 2013

Pikka wrote:

I think you've missed the point, Juanjo. "Filters" are all very well, but they require far too much cooperation and knowledge from the player for what I'm trying to achieve here.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5467#comment11992

@DorpsGek
Copy link
Member Author

Pikka wrote:

It additionally occurs to me that, if implented, this callback should also have the ability to auto-reject new vehicle prototypes. Otherwis players will be offered prototypes of vehicles they're not going to be able to build.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5467#comment11998

@DorpsGek
Copy link
Member Author

Alberth closed the ticket.

Reason for closing: Won't implement

Second attempt in #4571


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

@DorpsGek
Copy link
Member Author

Alberth wrote:

And of course that number was wrong, the new bug is #5471


This comment was imported from FlySpray: https://bugs.openttd.org/task/5467#comment12001

@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