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
Add: support for stations #244
base: master
Are you sure you want to change the base?
Conversation
|
nml/actions/action3_callbacks.py
Outdated
'default' : {'type': 'cargo', 'num': None}, | ||
'availability' : {'type': 'cb', 'num': 0x13, 'flag_bit': 0}, | ||
'select_sprite_layout' : {'type': 'cb', 'num': 0x14, 'flag_bit': 1}, | ||
'custom_station_layout' : {'type': 'cb', 'num': 0x24, 'purchase': 2}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about the name here.
The result indexes into the properties "draw_pylon_tiles", "hide_wire_tiles" and "non_traversable_tiles".
So maybe "select_tile_index", "select_tile_type" or just "select_tille"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah naming is hard.
"STAT_FLAG_CUSTOM_FOUNDATIONS" : 3, | ||
"STAT_FLAG_EXTENDED_FOUNDATIONS" : 4, | ||
|
||
# station tile types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If property 0E is not supported/needed, I don't think these constants are useful either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only use I can see would be in bitmask()
for hide_wire_tiles
or non_traversable_tiles
, so yeah probably useless.
CHIPS port in progress to test this: https://github.com/andythenorth/chips/tree/nml-port |
I did some test trying to port CHIPS 'magic' stations.
|
Fixed the 2 issues I noticed (and reworked some part for the third time) |
Purchase/non-purchase splitting for callbacks may not be enough. Originally CHIPS defines 3 different chains for |
Applied #246. |
It's finally possible to create stations newgrf with NML.
I implemented most props, but I'm not sure about their naming or simplicity of use. Maybe more global constants are needed.
I think I correctly implemented sprite layout for stations (was the hardest part).
I added a
SPRITESET()
function existing only for stations, used to refer to active spriteset (the one selected with basic action2).Custom foundations are also implemented.
I tested many things locally and it works for me.
As an example, I converted CHIPS Cow pens station (and yes there are blinking cows🐮 🤣 ).
Regression test also produces a working grf.