You are viewing a potentially older version of this package.
View all versions.
Date uploaded | 2 weeks ago |
Version | 1.0.0 |
Download link | ERRORMODS-RumbleStats-1.0.0.zip |
Downloads | 12 |
Dependency string | ERRORMODS-RumbleStats-1.0.0 |
This mod requires the following mods to function
UlvakSkillz-RumbleModdingAPI
API to Help Modders Get Started and to remove the necessity of GameObject.Find
Preferred version: 3.2.8Baumritter-RumbleModUI
Adds a pop-up window for centralized management of mod settings
Preferred version: 2.1.2README
Installation Instructions
- Install MelonLoader
- Run Game and close it when you get to T-Pose
- Drop "Mods" Folder in to Rumble Source Directory
- Run the Game.
How to Use
- If you have other mods installed that use this mod, they will store their statistics in their respective folders inside your UserData folder in the root game directory.
- If you don't have any mods installed that use this mod, it will store some base statistics that come with the mod.
Have fun!
Documentation
StatsMod
Class
Properties
ModName
: Name of the mod for indentifying and organizing data files.storeEntryTime
: Boolean value to include timestamps for each entry.
Methods
InitializeStatFile
- Creates a new CSV file with specified columns.
- Parameters:
fileName
: Name of the CSV file.columns
: Dictionary (string, type) of column names and their data types.
- Example:
var columns = new Dictionary<string, Type> { { "Player Name", typeof(string) }, { "Battle Points", typeof(int) } }; mod.InitializeStatFile("PlayerStats", columns);
StatFileExists
- Checks if a specific stat file exists.
- Returns:
true
if the file exists, otherwisefalse
.
GetAllRows
- Reads all rows from a CSV file.
- Parameters:
csvFileName
: The name of the file to read.skipHeader
: Boolean value to skip the header row.
- Returns: A list of string arrays representing rows.
AddStatRow
- Adds a new row to the CSV file.
- Parameters:
values
: Array of object values for the row. Make sure they match the column types defined in the CSV file, in the same order, and the same amount of values.csvFileName
: The name of the file to add the row to.
- Example:
mod.AddStatRow(new object[] { "Player1", 100 }, "PlayerStats");
FormatValue
- Converts a value to a CSV-compatible string format. This is automatically done by the
AddStatRow
method.
- Converts a value to a CSV-compatible string format. This is automatically done by the
Main
Class
Methods
RegisterCSVFile
- Registers a CSV file for ModUI toggles
- Parameters:
csvFileName
: The name of the CSV file to register.
RegisterMod
- Registers a mod for ModUI toggles
- Parameters:
mod
: The mod to register (of typeStatsMod
).
Example Mod
using MelonLoader;
using RumbleStats;
//other references...
namespace MyMod
{
public class Main : MelonMod
{
StatsMod mod = new StatsMod();
public override void OnLateInitializeMelon()
{
mod.ModName = "MyModName";
mod.storeEntryTime = true; //Stores entry timestamps when calling AddStatRow
mod.storeEntryTime = false; //Does not store entry timestamps when calling AddStatRow
var columns = new Dictionary<string, Type>
{
{ "Column1Name", typeof(string) },
{ "Column2Name", typeof(int) },
{ "Column3Name", typeof(bool) },
//etc...
};
mod.InitializeStatFile("CSVFileName", columns);
RumbleStats.Main.instance.RegisterCSVFile("CSVFileName");
RumbleStats.Main.instance.RegisterMod(mod);
//Do this for each CSV file you want to store stats for...
}
private void SomeRandomMethod()
{
mod.AddStatRow(new object[]
{
"Stat1",
1000101,
true,
//etc, same as the columns provided in the InitializeStatFile method...
}, "CSVFileName");
var rows = mod.GetAllRows("CSVFileName", skipHeader: true);
foreach (var row in rows)
{
MelonLogger.Msg(string.Join(", ", row));
}
}
}
}
CHANGELOG
Version 1.0.4
- Added a one second delay to adding moves to the csv file, which can cause lag right before a round ends, preventing the opponent from being able to block it sometimes.
Version 1.0.3
- Moves are now only written at the end of a round, hopefully reducing lag during gameplay.
- Replaced exceptions with error logging.
- Added
GetAggregateData
,RemoveRows
,RemoveRow
, andWriteAllRows
Version 1.0.2
- Fixed MatchData round results not getting stored correctly (You could win 3 times or win twice and then lose?)
- Moved documentation from README.md to the Wiki on thunderstore.
Version 1.0.1
- Added a Debug mode to the StatsMod class.
- Fixed some csv files not being stored to.
Version 1.0.0
- Created
Help And Other Resources
Get help and find other resources in the Modding Discord: https://discord.gg/fsbcnZgzfa