elmish-RumbleModdingLibrary icon

RumbleModdingLibrary

a library for RUMBLE

By elmish
Last updated 2 weeks ago
Total downloads 11
Total rating 1 
Categories Libraries
Dependency string elmish-RumbleModdingLibrary-1.0.0
Dependants 0 other packages depend on this package

This mod requires the following mods to function

LavaGang-MelonLoader-0.7.0 icon
LavaGang-MelonLoader

The World's First Universal Mod Loader for Unity Games compatible with both Il2Cpp and Mono

Preferred version: 0.7.0
UlvakSkillz-RumbleModdingAPI-3.3.4 icon
UlvakSkillz-RumbleModdingAPI

API to Help Modders Get Started and to remove the necessity of GameObject.Find

Preferred version: 3.3.4
Baumritter-RumbleModUI-2.1.2 icon
Baumritter-RumbleModUI

Adds a pop-up window for centralized management of mod settings

Preferred version: 2.1.2

README

General mod library for things i need or end up repeating in every mod

Brings back photon's RPCs, (nick originally remade it but it broke in melonloader 0.6.x) Easier RaiseEvent(), (makes it easier to use) Easy inputs (such as WasPressedThisFrame and WasReleasedThisFrame)

how to use:

1: RPCs

1: in order to use RPCs, create a new class and inherit from MonoBehaviourPun, 2: inside of your new class create a method and give it the [PunRPC] attribute (RumbleModdingLibrary.Utilities.PunRPC), 3: create a new gameobject or take an existing object, 4: give that object a PhotonView, store it in a variable and assign a unique ViewID to it (must be consistent across all players), 5: give that object your new components with the RPC, 6: use photonView.RPC("your method name here") to send the RPC (for a better explanation go to the photon docs)

2: RaiseEvent

setup:

1: on your main mod, inherit from RumbleMod instead of MelonMod (RumbleModdingLibrary.Utilities.RumbleMod) 2: the first time you load into the gym call RegisterEvents(), (RumbleMod.RegisterEvents() ) 3: override the OnEvent(List<Il2CppSystem.Object> data) method (RumbleMod.OnEvent(List<Il2CppSystem.Object> data) ) 4: add whatever logic you need to your OnEvent, (if you need to get data such as a Vector3 or Quaternion use .Unbox<>() )

actually raising an event

1: create a new RaiseEventOptions (Il2CppPhoton.Realtime.RaiseEventOptions) and set set the Receivers variable 2: create your data (most variables like Vector3 and Quaternions have a .BoxToIl2CppObject() method to convert them to an Il2CppSystem.Object, the others can be simply cast to it) 3: Call RaiseEvent(List<Il2CppSystem.Object> data, RaiseEventOptions raiseEventOptions, SendOptions sendOptions) (from RumbleMod)

SendOptions.SendReliable guarantees that the event will be received by everyone but is slightly slower SendOptions.SendUnreliable does not guarantee that the event will be received and is faster read a better description on the photon docs

3: ControllerInputPoller

1: right and left controller are defined by RumbleModdingLibrary.Utilities.ControllerInputPoller.RightController and LeftController respectively 2: each controller contains 5 buttons and the joystick position (Vector2)

the buttons are: primary, secondary, trigger, grip and stick click 3: each button contains 4 variables (float) value: how much pressed in the button is, 0-1 for trigger and grip (bool) pressed: if the button is currently held down (bool) WasPressedThisFrame: if the button was pressed in this frame (bool) WasReleasedThisFrame: if the button was released this frame tip: you can add something like "using RC = RumbleModdingLibrary.Utilities.ControllerInputPoller.RightController;" to create a shortcut to the right controller

Help And Other Resources

Get help and find other resources in the Modding Discord: https://discord.gg/fsbcnZgzfa