-
Notifications
You must be signed in to change notification settings - Fork 37
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
Request: Add variable for xy coordinates of industries #218
Comments
General warning: The linked page is TTDPatch specific, and not everything on it applies to OpenTTD. On top of that: the For testing you can use this:
|
Thank you for pointing me in the right direction. The test code you gave me works great! |
I have a case where it would be helpful to have a UUID for industry instances. I am not aware of an actual UUID that is grf-readable (maybe in 80+?). xy is unique, so if there was a way to parse the returned value for uniqueness, it would work for my case. Maybe evaluating x and y separately would work fine. |
This issue could be closed IMHO :) |
I disagree. It would be nice to have an easy variable to read (and put in the docs) rather than forcing the user to perform the above calculation, even if it does work. |
Industries and industrytiles currently have no way of knowing their location on the map, unlike houses which have
x_coordinate
andy_coordinate
variables. I would like to request similar variables for industries.My desired use case is generating Import/Export industries only near the edge of the map. Another case would be separating the map into quadrant "regions" with different primary resources (coal, iron, etc) available in each.
On Discord, @andythenorth informs me that "80+ var 00" contains the xy coordinates of the industry's northernmost tile, per this page.
I am not knowledgeable enough to know how to use this, and the depreciated syntax page of the docs suggested opening a feature request to formally implement this in NML.
The text was updated successfully, but these errors were encountered: