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

No description provided.

@frosch123
Copy link
Member

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
Copy link
Contributor Author

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
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
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
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
Copy link
Contributor Author

https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2 uses consequently 0x12.

@PeterN
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
Copy link
Member

I fixed the wiki.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants