Close #13615: insert required action implementation#13648
Conversation
- added deserialization Visit() override for MapRange - ClearAction now usable via "clearscenery" script engine command
|
intended to replace #13616 |
- implement LoadOrQuitAction deserialization - implement NetworkModifyGroupAction deserialization - implement ParkEntranceRemoveAction deserialization - implement SmallScenerySetColourAction
- added deserialization for ParkSetParameterAction - added deserialization for ParkMarketingAction - added deserialization for ParkSetDateAction - added deserialization for ParkSetLoanAction
- ParkSetParameterAction - ParkSetResearchFundingAction - PeepPickupAction - PlaceParkEntranceAction - PlacePeepSpawnAction - PlayerKickAction - PlayerSetGroupAction
|
Don't open a new PR for the same thing. You can pretty much always recover your branch. By opening a new one we loose all the comments that we made on the previous one. |
| { | ||
| } | ||
|
|
||
| void FootpathPlaceFromTrackAction::AcceptParameters(GameActionParameterVisitor& visitor) |
There was a problem hiding this comment.
Remove this. This action should ONLY be used by track designs and never by plugins.
| { | ||
| } | ||
|
|
||
| void LoadOrQuitAction::AcceptParameters(GameActionParameterVisitor& visitor) |
There was a problem hiding this comment.
debatable if this is safe to perform from a plugin as it will unload the plugin. This may cause unexpected behaviour.
| { | ||
| } | ||
|
|
||
| void PeepPickupAction::AcceptParameters(GameActionParameterVisitor& visitor) |
There was a problem hiding this comment.
Will plugins understand this action. Its not a simple action to use.
|
Make sure all of the comments from #12933 are applied as well. |
|
The actions that I am implementing are based entirely on the list of exposed actions in ScriptEngine.cpp:964. If there are actions we don't want plugins to use, they should be removed there rather than just having a broken implementation. So far it looks like we don't want
As for the more complex actions (e.g. PeepPickupAction), it may be best to implement a simpler plugin interface if the action is desired. Remaining exposed actions in script engine that are missing implementation include:
|
|
one comment from #12933 is I think worthy of discussion:
A standardized naming scheme for arguments would be nice, as would a document detailing all the exposed callbacks and their arguments. There's also the general concern of the plugin user needing to pass enumeration values, which will work under the current system, but be very arcane and require source code examination until a document is made. |
- Did not add implementation for SurfaceSetStyleAction or TileModifyAction, as these likely should not be exposed in the script engine
- Remove FootpathPlaceFromTrackAction - this action should be purely internal - remove LoadOrQuitAction - doesn't make much sense for a plugin to use this and likely causes unsafe plugin unload - SurfaceSetStyleAction - complex to use via plugin and unlikely to be needed? - TileModifyAction - seems like it should be kept internal
| { "staffsetpatrolarea", GameCommand::SetStaffPatrol }, | ||
| { "surfacesetstyle", GameCommand::ChangeSurfaceStyle }, | ||
| { "tilemodify", GameCommand::ModifyTile }, | ||
| { "trackdesign", GameCommand::PlaceTrackDesign }, |
There was a problem hiding this comment.
I think for these actions that have been removed from the plugin API, like footpathplacefromtrack, loadorquit and others, their AcceptParameters function should rather be no-ops and actually have a comment there stating why they're intentionally empty, so that people don't think we just forgot to add them a few moments from now.
|
@csunday95 are you able to rebase this? It might help if you break it down into separate PRs to reduce the size. Perhaps start with the simpler actions that haven't been commented on (assumption being no one had any concerns with them). |
|
Closing this as it appears to be abandoned. Agree with @IntelOrca on the way forward, should OP want to pick it up again. |
GameActions exposed in the script engine