UlvakSkillz-RumbleModdingAPI icon

RumbleModdingAPI

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

Last updated a week ago
Total downloads 8939
Total rating 11 
Categories Mods Tools Libraries
Dependency string UlvakSkillz-RumbleModdingAPI-4.0.2
Dependants 120 other packages depend on this package

This mod requires the following mods to function

LavaGang-MelonLoader-0.6.6 icon
LavaGang-MelonLoader

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

Preferred version: 0.6.6

README

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

Video Guide


How to Include the API in your Project:

  1. Install MelonLoader Version 0.6.6+
  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;" at the top of your code / with the other "using"s
  6. Call Methods Supplied By Typing "Calls." followed by the Method Name (Visual Studios Supplies the List)
  • Calls.IsInitialized() - Use when messing with things in the loader to make sure API is ready
  • Calls.Scene.[Methods] - Used to see if scene changed
  • Calls.Managers.[Methods] - Used to access Managers
  • Calls.Gym.[Methods] - Used to access Gym Specific Objects
  • Calls.Park.[Methods] - Used to access Park Specific Objects
  • Calls.Pools.Structures.Methods - Used to access Structure Pools
  • Calls.Pools.ShiftStones.Methods - Used to access ShiftStone Pools
  • Calls.Players.Methods - Used for Quick access to different Players
  • Calls.Create.[Methods] - Used to create new Text/Buttons
  • Calls.ControllerMap.(Left/Right)Controller.[Methods] - Used to read Controller Inputs
  • Calls.onMapInitialized - System.Action to use as a listener to Auto-Run a Method when map is done Loading
  • Calls.onPlayerSpawned - System.Action to use as a listener to Auto-Run a Method when a Player Spawns in
  • Calls.onMatchStarted - System.Action to use as a listener to Auto-Run a Method when a Matchmaking Match Starts
  • Calls.onMatchEnded - System.Action to use as a listener to Auto-Run a Method when a Matchmaking Match Ends
  • Calls.onRoundStarted - System.Action to use as a listener to Auto-Run a Method when a Matchmaking Round Starts
  • Calls.onRoundEnded - System.Action to use as a listener to Auto-Run a Method when a Matchmaking Round Ends
  • Calls.onLocalPlayerHealthChanged - System.Action to use as a listener to Auto-Run a Method when a Local Player's Health Changes
  • Calls.onRemotePlayerHealthChanged - System.Action to use as a listener to Auto-Run a Method when a Remote Player's Health Changes
  • Calls.onMyModsGathered - System.Action to use as a listener to Auto-Run a Method when your Mods are Gathered in a List.

In-Depth How to Setup a Project to Use the API:

  1. Drag the Mods Folder into the RUMBLE Folder

  2. Click Create New Project

  3. Select Class Library (.NET Framework)

  4. Name Project

  5. Add References (Browse to "RUMBLE\MelonLoader\Managed" for Rumble References)

  • Add MelonLoader.dll (MelonLoader Folder)
  • Add RUMBLE.Runtime.dll (Managed Folder)
  • Add RumbleModdingAPI.dll (Mods Folder)
  1. Open Properties Dropdown and Open (double click) "AssemblyInfo.cs"

  2. In AssemblyInfo.cs, Add Usings at the Top:

  • using MelonLoader;
  • using YourModsName;
  1. After the Usings, Put:
  • [assembly: MelonInfo(typeof(Class1), "YourModsName", "1.0.0", "YourName")]
  • [assembly: MelonGame("Buckethead Entertainment", "RUMBLE")]
  1. Open Class File (default class name is "Class1")

  2. Add usings at the Top:

  • using MelonLoader;
  • using RumbleModdingAPI;
  1. Add " : MelonMod" after the Class Name

  2. Inside the Class Add a Function:

  • public override void OnSceneWasLoaded(int buildIndex, string sceneName) {}
  1. (Optional Test) Add Reference to Add this Line inside OnSceneWasLoaded: (On Gym Load, it'll output the player's name)
  • if (sceneName == "Gym") { MelonLogger.Msg(Calls.Managers.GetPlayerManager().localPlayer.Data.GeneralData.PublicUsername); }
  1. Build Project

  2. Open File Explorer to "C:\Users\YOURUSER\source\repos\YOURPROJECT\YOURPROJECT\obj\Debug"

  • Copy YOURPROJECT.dll into the Rumble Mods Folder (RUMBLE/Mods)
  1. Open Rumble and Load into the Gym. Then Look at the Console (Black Window)

  2. Subscribe to UlvakSkillz (and Like this Mod)


Calls:

  1. Able to be Called Anytime:
  • Calls.LoadAssetBundleGameObjectFromFile(string filePath, string assetName)
    • .LoadAssetBundleFromFile(string filePath)
    • .LoadAssetFromFile<T>(string filePath, string assetName)
    • .LoadAssetBundleFromStream(string modName, string modAuthor, string assetPath)
    • .LoadAssetBundleFromStream(MelonMod instance, string assetPath)
    • .LoadAssetFromStream<T>(MelonMod instance, string path, string assetName)
    • .LoadAssetFromStream<T>(string modName, string modAuthor, string path, string assetName)
  • Calls.GameObjects.DDOL.*
  • Calls.IsInitialized()
  • Calls.IsMapInitialized()
  • Calls.Scene
    • .WhenSceneChanged()
    • .GetSceneName()
  • Calls.Managers
    • .GetGameManager()
    • .GetNetworkManager()
    • .GetPlayerManager()
    • .GetInputManager()
    • .GetSceneManager()
    • .GetNotificationManager()
    • .GetStackManager()
    • .GetQualityManager()
    • .GetSocialHandler()
    • .GetSlabManager()
    • .GetRecordingCamera()
    • .GetCombatManager()
    • .GetBHapticsManager()
    • .GetPhotonHandler()
    • .GetAudioManager()
    • .GetSteamAudioManager()
    • .GetUIGameObject()
    • .GetPoolManager()
  • Calls.Pools.Structures
    • .GetPoolDisc()
    • .GetPoolPillar()
    • .GetPoolBall()
    • .GetPoolCube()
    • .GetPoolWall()
    • .GetPoolSmallRock()
    • .GetPoolLargeRock()
    • .GetPoolBoulderBall()
  • Calls.Pools.ShiftStones
    • .GetPoolVolatileStone()
    • .GetPoolChargeStone()
    • .GetPoolSurgeStone()
    • .GetPoolFlowStone()
    • .GetPoolGuardStone()
    • .GetPoolStubbornStone()
    • .GetPoolAdamantStone()
    • .GetPoolVigorStone()
  • Calls.Players
    • .IsHost()
    • .GetAllPlayers()
    • .GetLocalPlayer()
    • .GetLocalLCKTablet()
    • .GetPlayerController()
    • .GetEnemyPlayers()
    • .GetClosestPlayer(UnityEngine.Vector3 pos, bool ignoreLocalController)
    • .GetClosestPlayer(UnityEngine.Vector3 pos, PlayerController ignoreController)
    • .GetPlayerByControllerType(RUMBLE.Players.ControllerType controllerType)
    • .GetPlayerByActorNo(int actorNumber)
    • .GetPlayersInActorNoOrder()
    • .GetLocalHealthbarGameObject()
  • Calls.Create (Callable after first Gym Load)
    • .NewText()
    • .NewText(string text, float textSize, Color textColor, UnityEngine.Vector3 textPosition, Quaternion textRotation)
    • .NewButton()
    • .NewButton(UnityEngine.Vector3 buttonPosition, Quaternion buttonRotation)
    • .NewButton(Action action)
    • .NewButton(UnityEngine.Vector3 buttonPosition, Quaternion buttonRotation, Action action)
  • Calls.ControllerMap
    • .LeftController.Get(Trigger, Grip, Primary, Secondary, Joystick, JoystickClick)
    • .RightController.Get(Trigger, Grip, Primary, Secondary, Joystick, JoystickClick)
  1. Able to be Called in the Gym:
  • Calls.GameObjects.Gym.*
  • Calls.Gym
    • .GetGymMailTube()
    • .GetGymMatchConsole()
    • .GetGymRegionSelectorGameObject()
    • .GetGymBeltRack()
    • .GetGymFriendBoard()
    • .GetParkBoardBasicGymVariant()
    • .GetGymParkBoardGymVariant()
    • .GetGymHoward()
    • .GetGymPoseGhostHandler()
    • .GetGymDailyLeaderboard()
    • .GetGymRankStatusSlabGameObject()
    • .GetGymCommunitySlabGameObject()
    • .GetGymShiftstoneQuickswapper()
    • .GetGymShiftstoneCabinet()
    • .GetGymGondolaGameObject()
    • .GetGymRanksGameObject()
    • .GetGymSpawnPointHandler()
    • .GetGymMatchmakingHandler()
    • .GetGymRewardHandler()
  1. Able to be Called in the Park:
  • Calls.GameObjects.Park.*
  • Calls.Park
    • .GetParkSpawnPointHandler()
    • .GetParkInstance()
    • .GetParkFriendBoard()
    • .GetParkBoardBasicParkVariant()
    • .GetParkBoardParkVariant()
    • .GetParkShiftstoneQuickswapper()
  1. Able to be Called in Matchmaking (findMyOwnMods anytime Loader+):
  • Calls.Mods
    • .getMyModString()
    • .getOpponentModString()
    • .getMyMods()
    • .getOpponentMods()
    • .findOwnMod(string modName, string ModVersion, bool matchVersion = true)
    • .doesOpponentHaveMod(string modName, string modVersion, bool matchVersion = true) -Calls.Matchmaking
      • .GetMatchmakingTypeAsString()
      • .GetMatchmakingTypeAsInt()
  1. Able to be Called in The Ring:
  • Calls.GameObjects.Map0.*
  1. Able to be Called in The Pit:
  • Calls.GameObjects.Map1.*
  1. Actions to Listen to:
  • Calls.onMapInitialized (used shortly after scene change when api has scene items)
  • Calls.onModStringRecieved (used right after mod list is recieved to check opponents mods)

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.Calls.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.Calls.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.Calls.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

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