Request: Add variable for xy coordinates of industries

Open
#218 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
28/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
compilers

Research direction

No source file or test is identified. Start by comparing the existing house x_coordinate and y_coordinate variables with industry and industrytile handling, then consult the linked industry-array coordinate reference and deprecated-syntax documentation. Done means NML exposes equivalent industry coordinates for the requested map-region and edge-of-map use cases.

Written by the indexing model from the issue text.

Description

Industries and industrytiles currently have no way of knowing their location on the map, unlike houses which have x_coordinate and y_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.

Dominant language
Python
Stars
61
Forks
47
Avg merge
8d 14h
Merged PRs (30d)
3

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenTTD/nml

All issues in OpenTTD/nml

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.