Jump to content

Built-In Arbitrary Action RPC Handler


Recommended Posts

So I've recently been trying to make a hotkey mod for Wortox that will allow him to teleport and drop souls through custom keybinds. I've been able to get it working, but the only way I found to get the telepoofing feature to work was to make a custom RPC call that would translate the pressing of the designated button into Wortox performing the action server-side, making the mod a server mod instead of a client mod.

Dropping an item from an inventory actually already has a pre-built RPC Handler specifically for it (DropItemFromInvTile), but the only handlers that I can see that handle arbitrary actions are the ones that check for a specific button to be pressed ("Leftclick", "RightClick", "ActionButton", etc). The way these handlers are currently set up, if you try to trigger an action by other means (say, a hotkey) while trying to call the RPC handler and making it think an action was made, it will not work. I imagine this was deliberately set up to ensure synchronization between the client and the server, because the function that's called in the playercontroller component by the RPC handler specifically checks if the passed bufferedaction is the same bufferedaction that's retrieved from the available action pool of said handler's button (depending on the action in question). This probably wouldn't be an issue if I wanted to keep the action available on the right-click, however I don't. I actually removed the availability of the action to telepoof from Wortox's right-click by default so the only way for him to telepoof is to use the hotkey, thus leading to this action synchronization problem.

My request is would there be any way to include a new RPC handler (and most likely new playercontroller function) to include a way for mods to be able to pass arbitrary actions to the server, allowing for more/better client mod custom button controls? I'll fully admit that I'm still a bit naïve when it comes to capability of the clients so maybe this is a bit of an outlandish request, or maybe it's something that's already possible that's I'm just missing/unaware of, but I think this type of capability would open up a world of more/better possibilities for hotkey client mods.

I also still think it would be possible to allow for client/server synchronization if that's truly a worry by passing a check for the deisgnated hotkey in question in the newly needed playercontroller function. However, to achieve this may also require a function to be added to the playeractionpicker component (and maybe even an extra/appended API function to boot) to allow for such synchronization, so I can definitely understand how this may not be a trivial task to tackle nor a high priority one, but I do think it would open up a lot of opportunities for mod developers to add more client-based custom keybinds for actions. I mean if we're being honest, I'd vote to just add API support for adding in custom keybinds to the native controls menu in the options menu instead, but I just thought this route may be less of a hassle for your end while allowing us to achieve the same thing through our own mod's config.

Edited by w00tyd00d
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...