StrangeLoopGames / EcoModKit

Eco Modkit
https://docs.play.eco
71 stars 24 forks source link

Unity component to call custom RPC on server #60

Open Jinjer88 opened 2 years ago

Jinjer88 commented 2 years ago

Is your feature request related to a problem? Please describe. Adding custom client side code to a mod is near impossible right now, for example if you wanna mod a new throwable item into the game, with devtier you can use Bow as a base but it's very limited to bow functionality and you can't really be creative.

Describe the solution you'd like a Unity component exposed to the modkit that has only 1 method, takes a string parameter as the RPC name and call the RPC on the server. This way we can easily add an animation event that calls the custom RPC on the server and at least work with basic Unity components to do some cool stuff.

Describe alternatives you've considered I tried to make the throwable tool work with BowItem and bow prefabs, but all bows require ammo to shoot and the item I wanna add doesn't need an ammo.

Additional context There are already a lot of methods being called with animation events in the project, but they all call specific RPCs. Like with the bow, it uses LineRenderer for the aiming part and specifically calls an RPC on the server that creates an ArrowEntity. This part should be customizable, I need to be able to call my own RPC and maybe even create custom entities.