Skip to content

Conversation

@Rito13
Copy link
Contributor

@Rito13 Rito13 commented Sep 1, 2025

Allows to use bridges over stations feature for rail stations.
Do not contain necessary additions to allow same feature for road stops and other station types.
Remains compatible with OpenTTD 14.0 and older.

@PeterN
Copy link
Member

PeterN commented Sep 1, 2025

No love for road stops and blocked pillar flags for both?

@Rito13
Copy link
Contributor Author

Rito13 commented Sep 1, 2025

I do not need road stops and do not have source code of NewGRF that could provide them.
If you can supply me one I would love to extend this pull request.

@PeterN
Copy link
Member

PeterN commented Sep 1, 2025

It's exactly the same as for rail stations, just a different property number (0x13 for minimum height)

@glx22
Copy link
Contributor

glx22 commented Sep 1, 2025

There's simpler solution than duplicating flag function, which most likely won't work.

Edit: I may be wrong (didn't check the spec yet)

@Rito13 Rito13 force-pushed the bridges_over_stations branch 2 times, most recently from b6c9d49 to b2c3f95 Compare September 1, 2025 13:37
@LordAro
Copy link
Member

LordAro commented Sep 1, 2025

Don't think a class is the way to go - how about a function generator? (also, classes aren't named like that)

@Rito13 Rito13 force-pushed the bridges_over_stations branch from b2c3f95 to f6fb09a Compare September 1, 2025 14:02
@Rito13 Rito13 force-pushed the bridges_over_stations branch 7 times, most recently from 05ef859 to e9381a2 Compare September 1, 2025 15:13
Comment on lines 824 to 825
if isinstance(value, ConstantNumeric):
value = Array([value, invert_function(value)] * prefered_size, value.pos)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not a good idea to me.
All tiles having the same pillar placement limitation is probably quite rare.
And always defining 20 tile types feels wasteful.

Comment on lines +835 to +861
def invert_bridge_pillars_flags(value):
out = ConstantNumeric(0, value.pos)
for i_flag, o_flag in [
(global_constant_numbers["BRIDGE_PILLAR_CORNER_W"], global_constant_numbers["BRIDGE_PILLAR_CORNER_S"]),
(global_constant_numbers["BRIDGE_PILLAR_CORNER_S"], global_constant_numbers["BRIDGE_PILLAR_CORNER_W"]),
(global_constant_numbers["BRIDGE_PILLAR_CORNER_N"], global_constant_numbers["BRIDGE_PILLAR_CORNER_E"]),
(global_constant_numbers["BRIDGE_PILLAR_CORNER_E"], global_constant_numbers["BRIDGE_PILLAR_CORNER_N"]),
(global_constant_numbers["BRIDGE_PILLAR_EDGE_NE"], global_constant_numbers["BRIDGE_PILLAR_EDGE_NE"]),
(global_constant_numbers["BRIDGE_PILLAR_EDGE_SE"], global_constant_numbers["BRIDGE_PILLAR_EDGE_SW"]),
(global_constant_numbers["BRIDGE_PILLAR_EDGE_SW"], global_constant_numbers["BRIDGE_PILLAR_EDGE_SE"]),
(global_constant_numbers["BRIDGE_PILLAR_EDGE_NW"], global_constant_numbers["BRIDGE_PILLAR_EDGE_NW"]),
]:
if value.value & (1 << i_flag):
out.value += 1 << o_flag
return out
Copy link
Member

Choose a reason for hiding this comment

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

This logic should not be here, it's a bad idea to assume that the flags can be flipped.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why not?
It is based on how station's sprite should be inverted.
Zrzut ekranu z 2025-09-01 19-29-19

Copy link
Member

Choose a reason for hiding this comment

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

Because NML shouldn't be assuming anything. There's no rule that says sprites should be "inverted".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here picture clearly says that other values are invertible.
Station_var45

@Rito13 Rito13 force-pushed the bridges_over_stations branch from e9381a2 to f02ccc8 Compare September 1, 2025 16:07
@Rito13 Rito13 changed the title Add: action0 prop 20 for rail stations Add: necessary properties in action0 in order to support bridges over station feature from OpenTTD 15.0-beta3 Sep 1, 2025
@Rito13 Rito13 force-pushed the bridges_over_stations branch from 56caed4 to cb611e3 Compare September 1, 2025 17:43
…lars_flags so invert feature can be used for all tiles
@Rito13
Copy link
Contributor Author

Rito13 commented Sep 1, 2025

superseded by #388

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