-
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
Change: add vehicle 'refit' callback (cb 0x163) and cargo class filter prop (0x28 for trains etc) #344
base: master
Are you sure you want to change the base?
Conversation
And the props ? |
OpenTTD PR might be split, so I thought two nml PRs maybe? :) |
13090 is merged including props and cb. I'll do the nml as a single PR. |
User Summary: Add OpenTTD/nml#344 for CB 163
Added glx22@411fe82 |
Have tested the static prop, appears to work. Iron Horse nfo output from nmlc appears correct. Train nml:
Action 0 prop output:
|
nml/global_constants.py
Outdated
"CC_POTABLE" : 13, | ||
"CC_NON_POTABLE" : 14, |
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.
I think these don't belong in this PR?
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.
No, I failed to branch something correctly, will adjust now.
3c66104
to
0a80d93
Compare
nml docs for the callback can be adapted from the nfo docs: https://newgrf-specs.tt-wiki.net/wiki/Callbacks#Custom_refit_.28163.29 |
nml/actions/action0properties.py
Outdated
@@ -605,7 +628,7 @@ def prop23_test(value): | |||
"retire_early": {"size": 1, "num": 0x16}, | |||
"misc_flags": {"size": 1, "num": 0x17}, | |||
"refittable_cargo_classes": [{"size": 2, "num": 0x18}, zero_refit_mask(0x11)], | |||
"non_refittable_cargo_classes": [{"size": 2, "num": 0x19}, zero_refit_mask(0x11)], | |||
"non_refittable_cargo_classes": refittable_cargo_classes(0x19, 0x25, 0x11), |
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.
Should this be on refittable_cargo_classes
instead of non_refittable_cargo_classes
?
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.
Is it a method call now refittable_cargo_classes()
?
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.
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.
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.
Okay, so in the case of ships, the refittable_cargo_classes()
function is used for the non_refittable_cargo_classes
property.
For trains, road vehicles and aircraft, the refittable_cargo_classes()
function is used for the refittable_cargo_classes
property.
Maybe ships are special.
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.
Most likely my mistake (it's my code)
nml/actions/action0properties.py
Outdated
@@ -605,7 +628,7 @@ def prop23_test(value): | |||
"retire_early": {"size": 1, "num": 0x16}, | |||
"misc_flags": {"size": 1, "num": 0x17}, | |||
"refittable_cargo_classes": [{"size": 2, "num": 0x18}, zero_refit_mask(0x11)], |
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.
"refittable_cargo_classes": [{"size": 2, "num": 0x18}, zero_refit_mask(0x11)], | |
"refittable_cargo_classes": refittable_cargo_classes(0x18, 0x25, 0x11), | |
"non_refittable_cargo_classes": [{"size": 2, "num": 0x19}, zero_refit_mask(0x11)], |
0a80d93
to
3dbdb88
Compare
3dbdb88
to
deeaef5
Compare
4f1a607
to
a57beaf
Compare
See OpenTTD/OpenTTD#13090