UlvakSkillz-RumbleModdingAPI icon

RumbleModdingAPI

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

Last updated 3 hours ago
Total downloads 14766
Total rating 11 
Categories Mods Tools Libraries
Dependency string UlvakSkillz-RumbleModdingAPI-5.1.1
Dependants 144 other packages depend on this package

This mod requires the following mods to function

LavaGang-MelonLoader-0.7.2 icon
LavaGang-MelonLoader

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

Preferred version: 0.7.2

README

I created this API to Help others get into the Modding Scene for Rumble.

RUMBLE Modding Discord

Video Guide to Make Mods


How to Include the API in your Project:

  1. Install MelonLoader Version 0.7.2 (Latest Nightly Build)
  2. Run Game (This initialized MelonLoader) (Close at T-Pose)
  3. Put RumbleModdingAPI.dll in your Mods Folder
  4. Add RumbleModdingAPI.dll as a Reference in your Project
  5. Add "using RumbleModdingAPI.RMAPI;" at the top of your code / with the other "using"s
  6. Here is a list of different Classes containing different Methods:
  • "Actions" Contains all the Actions to be able to Have listeners happen under certain conditions
  • "AssetBundles" Unsed to Load AssetBundles
  • "Calls" Contains Methods to get info about different stuff (stuff I couldn't figure out where to put it)
  • "Create" Contains Methods to create new objects easily at any time
  • "GameObjects" Contains access to almost every GameObject in Rumble Maps
  • "Utilities" Contains the contents of RMAPI's RaiseEvent Manager
  • "PhotonRPCs" This is the Class containing PunRPC to use Custom RPCs
  • "AudioManager" This is the Class containing Methods to Help with Audio.

RPCs

  • 1: in order to use RPCs, create a new Component class and inherit from MonoBehaviourPun instead of MonoBehaviour
  • 2: inside of your new class create a method and give it the [PunRPC] attribute (RumbleModdingAPI.RMAPI.PhotonRPCs.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)

RaiseEvent

setup:

  • 1: on your main mod, inherit from RumbleMod instead of MelonMod (RumbleModdingAPI.RMAPI.Utilities.RumbleMod)
  • 2: the first time you load into the gym, call RegisterEvents(), (RumbleMod.RegisterEvents() )
  • 3: override the OnEvent(List<Il2CppSystem.Object> data) function (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<Vector3>() or .Unbox<Quaternion>())
  • note: if you need to send integers, use a 'short' or 'int16' as normal ints dont work properly

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 will make sure every player actually receives the event but might take a bit longer SendOptions.SendUnreliable does not guarantee that the event will be received, use this for things like position values where losing out on it once every so often isn't too bad

ControllerInputPoller

  • 1: right and left controller are defined by RumbleModdingAPI.RMAPI.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 = RumbleModdingAPI.RMAPI.Utilities.ControllerInputPoller.RightController;" to create a shortcut to the right controller

PlayerController.HasMod()

checks if a player has a mod installed, can be used in matches or the park

  • To use, get a Player's PlayerController Component, you can do .HasMod()
  • PlayerController.HasMod(string modName): checks if the Player has a Mod regardless of the Version
  • PlayerController.HasMod(string modName, string modVersion): checks if the player has a mod with the exact version
  • PlayerController.HasMod(string modName, string modVersion, bool checkPreviousVersions): checks if the player has a mod with a version equal or lower than the modVersion that was input

Help And Other Resources

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