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

Fix: Allow access to towns (feature 0x12) as parent object #26

Closed
wants to merge 1 commit into from

Conversation

@planetmaker
Copy link
Contributor

planetmaker commented Apr 2, 2019

No description provided.

@frosch123

This comment has been minimized.

Copy link
Member

frosch123 commented Apr 2, 2019

What is this supposed to do?
Towns have no feature number.
NML and OTTD append a pseudo-feature at the end of all features for internal reasons, but there is no feature 0x12.

@planetmaker

This comment has been minimized.

Copy link
Contributor Author

planetmaker commented Apr 5, 2019

What is this supposed to do?
Towns have no feature number.
NML and OTTD append a pseudo-feature at the end of all features for internal reasons, but there is no feature 0x12.

There's a bug report in the forums: https://www.tt-forums.net/viewtopic.php?p=1220012#p1220012
That is you cannot write persistant town storage as parent from objects/industries. The easy fix seems to define an actual feature number for it....

@PeterN

This comment has been minimized.

Copy link
Member

PeterN commented Apr 5, 2019

0x12 should not be exposed as a usable feature, as far as I know it is virtual to work around some limitation.

@planetmaker

This comment has been minimized.

Copy link
Contributor Author

planetmaker commented Apr 5, 2019

So, how do I correctly access a town's persistant storage?

EDIT: All through the NewGRF wiki, towns are referred to as 'feature 0x12'. The patch presented here, attaches the feature number to towns so that the towns can be referred to as the related object (nml internally has a list of object -> related object, based on feature IDs). It doesn't make towns as feature any more usable than it was before as you cannot define an item 'town'.

@PeterN

This comment has been minimized.

Copy link
Member

PeterN commented Apr 5, 2019

Where in the NewGRF specs? https://newgrf-specs.tt-wiki.net/wiki/Features says "N/A" for Towns

@planetmaker

This comment has been minimized.

Copy link
Contributor Author

planetmaker commented Apr 5, 2019

@PeterN

This comment has been minimized.

Copy link
Member

PeterN commented Apr 5, 2019

Thanks. That's rather one page, not "all through". And it's wrong.

Town persistent storage is accessed by using parent scope from one of the other features. I don't know how that is represented in NML.

@frosch123

This comment has been minimized.

Copy link
Member

frosch123 commented Apr 9, 2019

I fixed the wiki.

@frosch123 frosch123 closed this Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.