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

Revert "Add owner property to tile elements for scripting" #21715

Merged
merged 2 commits into from
Apr 12, 2024

Conversation

AaronVanGeffen
Copy link
Member

In #20853, the owner attribute was exposed though the scripting API. This allows plug-ins to write values to this field. However, these values are not restricted, and are likely to lead to conflicts when the field is eventually used to actually distinguish between different park companies.

We should hide the field now to prevent strange bugs or disappointment down the line.

This reverts commit b4376ab.

@Gymnasiast
Copy link
Member

Would like approval from @Basssiiie and @Sadret for this.

@Gymnasiast Gymnasiast added the plug-in Related to the plugin system of OpenRCT2. label Apr 3, 2024
@Basssiiie
Copy link
Member

Are we sure this is not yet used in any plugins?

Tagging @CorySanin as well ; you made some multiplayer plugins right? Have you used this specific property in any or would you know if any servers use it?

@Basssiiie
Copy link
Member

Basssiiie commented Apr 3, 2024

Also, what makes this property different from setting ride on a track element? That one can also accept values with few restrictions. 🙂

Note that as the setter can only be used in a mutable context, in multiplayer the plugin must be run on the server and must update it in a synchronized custom action for it to be able to update it.

@Gymnasiast
Copy link
Member

Also, what makes this property different from setting ride on a track element? That one can also accept values with few restrictions. 🙂

Note that as the setter can only be used in a mutable context, in multiplayer the plugin must be run on the server and must update it in a synchronized custom action for it to be able to update it.

The problem is that it can massively break things once OpenRCT2 starts actually doing stuff with ownership. And that we might want to use some bits for other purposes, for example. It’s basically something that should never have been exposed, and this PR is trying to get rid of it before it is too late to do so. (Obviously, the longer-term plan is to expose this data in some way, just not like this.)

@CorySanin
Copy link
Contributor

Thanks for the mention, I appreciate it. No, I never used this API in any of my plugins.

@Sadret
Copy link
Contributor

Sadret commented Apr 4, 2024

I agree with the reversion, and I haven't heard about any plugin that uses it.

@ZehMatt
Copy link
Member

ZehMatt commented Apr 4, 2024

You can probably leave the getter in there, if we ever get to have multiple companies then we probably want to have that anyway.

@AaronVanGeffen
Copy link
Member Author

Hmm, I'd get rid of the getter too tbh. When we do get multiple companies, you'd probably want it to return a ref to the company instead of the raw value, after all.

@Basssiiie
Copy link
Member

If we're sure no plugins are using it, I'm fine with removal.

Since it was added ages ago, it's removal should have a changelog entry though.

@AaronVanGeffen
Copy link
Member Author

Rebased to address the changelog.txt conflict. Is anything else needed for this PR?

@ltsSmitty
Copy link
Contributor

I think my requests let to the feature when I attempted to create a capture the flag multiplayer plugin with this feature. There ended up being other issues around company finances that caused my development pause, but I could see myself working on it again in the future.

If there is a plan to use this field in a native way sometime in the future, I'm fine with reverting - I can use a nonnative field or just work on other plugins.

@AaronVanGeffen
Copy link
Member Author

Thanks. Such multiplayer functionality should definitely be part of the core game logic, imo, with players joining separate companies on the same map, i.e. mixing cooperative and competitive multiplayer. Plug-ins could then extend that functionality in ways they see fit.

@Gymnasiast Gymnasiast merged commit 246f1f3 into OpenRCT2:develop Apr 12, 2024
22 checks passed
@AaronVanGeffen AaronVanGeffen deleted the revert-owner branch April 12, 2024 20:12
@Gymnasiast Gymnasiast added this to the v0.4.11 milestone Apr 15, 2024
janisozaur added a commit that referenced this pull request May 5, 2024
- Feature: [#11512] Coloured usernames by group on multiplayer servers.
- Feature: [#21734] Park admittance price can now be set via text input.
- Feature: [#21957] [Plugin] Expose whether the game is paused to the plugin API.
- Improved: [#21728] “Fix all rides” cheat now also works if a mechanic is already fixing the ride.
- Improved: [#21769] Expose “animation is backwards” wall property in Tile Inspector.
- Improved: [#21855] Add a separator between “Load Game” and “Save Game”, to avoid accidental overwriting.
- Change: [#21715] [Plugin] Remove access to the internal `owner` property. Note: `ownership` is still accessible.
- Change: [#21855] Cheats menu dropdown no longer requires dragging.
- Change: [#21866] Hide the FPS Counter when the top toolbar/widgets have been toggled off.
- Change: [#21950] Construction and removal buttons can now be held down for repeated placement.
- Fix: [#866] Boat Hire boats get stuck entering track (original bug).
- Fix: [#10701] No reason specified when placing door over unsuitable track.
- Fix: [#18723, #21870] Attempting to demolish a flat ride in pause mode allows you to place multiple copies.
- Fix: [#19559] Custom rides with long descriptions extend into lower widgets.
- Fix: [#21696] Fullscreen window option not correctly applied on macOS.
- Fix: [#21749] Crash when loading park bigger than current limits.
- Fix: [#21787] Map generator heightmap should respect increased height limits.
- Fix: [#21829] When creating a new scenario, the default name contains formatting codes.
- Fix: [#21937] Build errors with the ORIGINAL_RATINGS flag.
- Fix: [objects#324] Cannot build Colosseum inside a turn or helix.
- Fix: [objects#325] Sloped castle walls are vertically offset by one pixel (original bug).
mrmbernardi pushed a commit to mrmbernardi/OpenRCT2 that referenced this pull request May 10, 2024
- Feature: [OpenRCT2#11512] Coloured usernames by group on multiplayer servers.
- Feature: [OpenRCT2#21734] Park admittance price can now be set via text input.
- Feature: [OpenRCT2#21957] [Plugin] Expose whether the game is paused to the plugin API.
- Improved: [OpenRCT2#21728] “Fix all rides” cheat now also works if a mechanic is already fixing the ride.
- Improved: [OpenRCT2#21769] Expose “animation is backwards” wall property in Tile Inspector.
- Improved: [OpenRCT2#21855] Add a separator between “Load Game” and “Save Game”, to avoid accidental overwriting.
- Change: [OpenRCT2#21715] [Plugin] Remove access to the internal `owner` property. Note: `ownership` is still accessible.
- Change: [OpenRCT2#21855] Cheats menu dropdown no longer requires dragging.
- Change: [OpenRCT2#21866] Hide the FPS Counter when the top toolbar/widgets have been toggled off.
- Change: [OpenRCT2#21950] Construction and removal buttons can now be held down for repeated placement.
- Fix: [OpenRCT2#866] Boat Hire boats get stuck entering track (original bug).
- Fix: [OpenRCT2#10701] No reason specified when placing door over unsuitable track.
- Fix: [OpenRCT2#18723, OpenRCT2#21870] Attempting to demolish a flat ride in pause mode allows you to place multiple copies.
- Fix: [OpenRCT2#19559] Custom rides with long descriptions extend into lower widgets.
- Fix: [OpenRCT2#21696] Fullscreen window option not correctly applied on macOS.
- Fix: [OpenRCT2#21749] Crash when loading park bigger than current limits.
- Fix: [OpenRCT2#21787] Map generator heightmap should respect increased height limits.
- Fix: [OpenRCT2#21829] When creating a new scenario, the default name contains formatting codes.
- Fix: [OpenRCT2#21937] Build errors with the ORIGINAL_RATINGS flag.
- Fix: [objects#324] Cannot build Colosseum inside a turn or helix.
- Fix: [objects#325] Sloped castle walls are vertically offset by one pixel (original bug).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plug-in Related to the plugin system of OpenRCT2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants