-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
List of API/Compat improvements and changes that could end up being useful #411
Comments
|
One of the changes I've proposed in rwmt#411, without any API implementation. List of changes: - `VerbOwnerType` enum was removed and replaced by `supportedVerbOwnerTypes` array - The array includes `typeof(Thing)` in stead of `typeof(Pawn)` for increased compatibility - `IVerbOwner` sync worker entry was added - `Verb` sync worker entry was modified to sync the owner as `IVerbOwner` Those changes should result in greater compatibility, as new supported `IVerbOwner` types can now be added to the array and synced using their own sync workers. This should also end up simplifying `Verb` sync worker going forward, as we won't have to expand it anymore in the future - only the array of supported types. Things that I did not include, but we may want to potentially consider: - Add more vanilla types to the list of supported verb owners, which could include: - `HediffComp` (specifically for `HediffComp_VerbGiver`) - however, in vanilla RW they don't have gizmos, but a mod could add a comp that adds one - `Pawn_MeleeVerbs_TerrainSource` - likely will never gizmos, probably will be completely pointless to include - `Pawn_NativeVerbs` - same as above - Automatically including all subtypes of `IVerbOwner` which have an explicit sync worker - Would simplify mod compat, as mods would (likely) never need to modify the list of supported verb owners - Could have potentially unintended consequences?
I've dropped a PR (#412) that addresses the first and third points I've made, as well as a mod compat that requires work to fully work (rwmt/Multiplayer-Compatibility#400). Currently stuff can be supported the same way custom
I suppose a This would slightly complicate it a bit. We'd have to check for it in the prefixes for
I just did encounter it, specifically here: https://github.com/rwmt/Multiplayer-Compatibility/blob/4d19b02ccd047ba5944b0fa1aff019f87596be62/Source/Mods/XVIMechframe.cs#L381-L398 I've also encountered this in the past, but ignored it back then. There would be some use at the very least. Also, the current implementation I've linked may not always work - depends on what's being synced, and it will never work for stuff selected in the world map. Perhaps an option for sync methods to not replace the selectors with empty lists, in situations where it's needed? Would fully remove the need for the patch I made there, as the mod itself would select the proper objects as needed. |
The primary reason for me making this issue is to raise some discussion on stuff we could add or change to either improve compatibility, or extend the API. Personally, many of those would be useful when patching compat for mods. However, not all of them are fully needed or something that would be reasonable to implement (specifically the last one).
@Zetrith @notfood I'd appreciate your thoughts on the list I've prepared. Perhaps some other ideas of things to add to here?
I personally would be able to (somewhat quickly) implement the first 4-5 objects on the list here, as well as the one for accessing faction from
IPlayerInfo
. I believe it would take a few days at most. However, I'm not exactly sure how to easily access current player'sPlayerInfo
object (tried to look through code, but couldn't find a simple way to do it besides relying on player's username). As for the other positions on this list, I could look into them - but currently don't see them as a priority.Potential API/Compat improvements and changes that could be implemented:
Verb
IThingHolder
? (a list of supported types, and synced usingWriteWithImpl<T>
/ReadWithImpl<T>
)supportedThingHolders
to support customIThingHolder
implementationsVerbOwnerType
handler fromPawn
toThing
for greater compatibilityDesignator_MechControlGroup
in vanilla that doesn't require syncing, and we already exclude itAllowTool
DesignatorFinalizePatch
to not cancel execution if the designator is not syncedSelector
andWorldSelector
selected objects when executing commandsSelector
it if it was temporarily replaced byAsyncTimeComp
, but notDebugSync
orSyncUtil
, as those don't store it in a temporary fieldIPlayerInfo
MP.PlayerName
withIPlayerInfo.Username
IPlayerInfo
actually list the selected objectsIPlayerInfo
to be able to lookup specific player's factionThe text was updated successfully, but these errors were encountered: