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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bridges management #157

Closed
werbfred opened this issue Jun 17, 2020 · 2 comments
Closed

Bridges management #157

werbfred opened this issue Jun 17, 2020 · 2 comments

Comments

@werbfred
Copy link
Contributor

Hello,

First of all : Great Job 馃

I've been playing around with Bridges. I updated file nml/actions/action0properties.py by adding following code:

#
# Feature 0x06 (Bridges)
#
properties[0x06] = {
聽聽聽聽# 0x08 - year availability (old way)
聽聽聽聽'min_length' : { 'num': 0x09, 'size': 1 },
聽聽聽聽'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 },
聽聽聽聽'flags' : { 'num': 0x0E, 'size': 1 },
聽聽聽聽'avail_year' : { 'num': 0x0F, 'size': 4 },
聽聽聽聽'name' : { 'num': 0x10, 'size': 2, 'string': 0xDC },
聽聽聽聽'description_rail_bridge' : { 'num': 0x11, 'size': 2, 'string': 0xDC },
聽聽聽聽'description_road_bridge' : { 'num': 0x12, 'size': 2, 'string': 0xDC },
聽聽聽聽'cost_factor' : { 'num': 0x13, 'size': 2 },
}

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.

@glx22
Copy link
Contributor

glx22 commented Jun 17, 2020

Please open a PR

@werbfred
Copy link
Contributor Author

Created PR : Bridge management #158

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

No branches or pull requests

2 participants