Skip to content

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Any progress on this in last 5 years? @werbfred you seem inactive since 2021.

Copy link
Contributor Author

@werbfred werbfred Dec 17, 2025

Choose a reason for hiding this comment

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

Sorry. Had been looking at this 5 years ago. In the meanwhile many personal things occured... Anyway, did not deep dive into this during that period. If I remember the 2 bytes part was to link the bridge with different pictures depending on the orientation of it. So much more complictaed than what I saw...

@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.

4 participants