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

Bridge management #158

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Bridge management #158

wants to merge 1 commit into from

Conversation

werbfred
Copy link
Contributor

I've tested all except sprite and flags...

The code to edit a bridge becomes 👍

item(FEAT_BRIDGES, item_wooden_bridge, 0x00 ) {
    property {
        avail_year: 1800;
        cost_factor: 40;
        speed_limit: 40 km/h;
        min_length: 0;
        max_length: 12;
    }
}

name, description_rail_bridge and description_road_bridge have also been tested and working fine.

@werbfred werbfred changed the title - Add : Bridge management in NML of OpenTTD Bridge management Jun 17, 2020
@werbfred werbfred mentioned this pull request Jun 17, 2020
@LordAro
Copy link
Member

LordAro commented Jun 17, 2020

Probably needs documenting somewhere (newgrf-wiki?) and ideally it should be tested as well...

'max_length' : { 'num': 0x0A, 'size': 1 },
# 0x0B - cost factor (old way)
'speed_limit' : { 'num': 0x0C, 'size': 2, 'unit_type': 'speed', 'unit_conversion': (5000, 1397), 'adjust_value': lambda val, unit: ottd_display_speed(val, 1, unit)},
'sprite' : { 'num': 0x0D, 'size': 2 },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems wrong, based on my reading of the specs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... I did it based on https://newgrf-specs.tt-wiki.net/wiki/Action0/Bridges

What is wrong according to you?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prop 0D is not a simple 2 bytes value, it's more complex. See the example at the bottom of the page.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sprites are clearly wrong... Need to find some to generate output, will be able to share full version then.

@PeterN PeterN marked this pull request as draft November 30, 2024 14:20
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.

3 participants