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

Unable distinguish player built/randomly generated industries in scenario editor #4096

Closed
DorpsGek opened this issue Aug 29, 2010 · 9 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

foobar opened the ticket and wrote:

Industry variable A7 (http://wiki.ttdpatch.net/tiki-index.php?page=VarAction2Industries# Industry_founder_information_A7_) returns 10h for "many random industries" as well as for manually placed industries.

The documentation states that "10h [is returned] if the industry was generated randomly". However, this is also returned for manually constructed industries in the scenario editor. It would be appreciated if manually constructed industries could return something else than 10h (possibly 00).

Background: for FIRS we would like to differentiate between randomly placed industries and manually placed industries. That way we can force industries to have a 1-tile buffer between them if randomly constructed, but allow users to manually build industries without a buffer. Currently this works fine in normal game, but not in the scen editor.

Note: this can also be considered a feature request, but I thought of it as a bug, as the documentation description does not match behaviour. It is fine if you fix this bug by fixing the documentation, but then I'm required to file this anew as a feature request :D

Reported version: trunk
Operating system: All


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

Rubidium wrote:

Can you actually read A7 during the construction of an industry?


This comment was imported from FlySpray: https://bugs.openttd.org/task/4096#comment8694

@DorpsGek
Copy link
Member Author

foobar wrote:

Yes, that is newly added in r19901, see http://www.tt-forums.net/viewtopic.php?f=68&t=48643


This comment was imported from FlySpray: https://bugs.openttd.org/task/4096#comment8695

@DorpsGek
Copy link
Member Author

frosch wrote:

IMO A7 is the wrong var for that check, and especially a value of 00.

Callback 22 has some information in var 18 though. Similiar thing could be added to CB 28 and 2F.

OTOH using the founder information (e.g. using 0x10, 0x0F or 0xFF) would allow to distinguish the industries throughout the game, which would allow to e.g. reduce the closing chance for manually placed industries. But I am not sure whether that is a good idea (it is fairly intransparent to the user).


This comment was imported from FlySpray: https://bugs.openttd.org/task/4096#comment8696

@DorpsGek
Copy link
Member Author

foobar wrote:

Extra information for CB 2F (and 28) would be a perfectly acceptable solution for this particular case. As I don't think that will break any older grf (what changing the behaviour of A7 could do), it looks like the better solution as well.

Reducing closure chance is only interesting for manually placed industries from within the game, not from the scenario editor. Outside the scen editor, var A7 already differentiates between random and user-built industries, so reducing closure chance of user-built industries is already possible.


This comment was imported from FlySpray: https://bugs.openttd.org/task/4096#comment8697

@DorpsGek
Copy link
Member Author

Rubidium wrote:

The attached file might do the trick. Not sure what "callback_param1" actually maps to in NFO though.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/4096#comment8900

@DorpsGek
Copy link
Member Author

frosch wrote:

"Not sure what "callback_param1" actually maps to in NFO though." -> var 10.

Note that cb 22 has already some similiar information:
0 TTD is generating a map and needs to know if your type can appear.
1 TTD decided to build a new random industry during regular gameplay and needs to know if it can choose your type.
2 The user tries to build/prospect for your industry via the new industry window. TTD needs to know if the player is allowed to do this.

Are these values applicable/extensible to cb 2F?


This comment was imported from FlySpray: https://bugs.openttd.org/task/4096#comment8902

@DorpsGek
Copy link
Member Author

Rubidium wrote:

I guess those values can be passed to both 2F and 28 as well. Something to really look into later.


This comment was imported from FlySpray: https://bugs.openttd.org/task/4096#comment8903

@DorpsGek
Copy link
Member Author

Rubidium wrote:

New version. Passes the cb22 values to var18 of cb2F/28, but passes 3 for prospecting. Furthermore for cb28 it's shifted by 8 as it's lowest byte is already used.

Please test and tell me whether it works so it can be committed.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/4096#comment8907

@DorpsGek
Copy link
Member Author

Rubidium closed the ticket.

Reason for closing: Fixed

In r20942


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

@DorpsGek DorpsGek added NewIndustries 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