Hey @Arthur.Bilibili, no worries at all. honestly, just being curious and wanting to try is already more than enough. you don’t have to know everything about C#, most of us just figure it out as we go anyway. If you’ve messed with MelonLoader before, you’re already on the right track.
take your time with it.
Most of the game is controlled by the GameManager
.
You can try hooking into any method you’re interested in from there.
Since there is il2cpp, this is a minimal working snippets example :
private void AddMoney()
{
if (float.TryParse(moneyInput.text, out float amount))
{
moneyAmount = amount;
GameManager.Command_ChangeMoney(moneyAmount);
MelonLogger.Msg($"Added {moneyAmount} money");
}
else
{
MelonLogger.Error("Invalid money amount input!");
}
}
private void AddHappiness()
{
if (int.TryParse(happinessInput.text, out int amount))
{
happinessAmount = amount;
GameManager.Command_ChangeHappiness(happinessAmount);
MelonLogger.Msg($"Added {happinessAmount} happiness");
}
else
{
MelonLogger.Error("Invalid happiness amount input!");
}
}
private void AddHunger()
{
if (int.TryParse(hungerInput.text, out int amount))
{
hungerAmount = amount;
GameManager.Command_ChangeHunger(hungerAmount);
MelonLogger.Msg($"Added {hungerAmount} hunger");
}
else
{
MelonLogger.Error("Invalid hunger amount input!");
}
}
private void SetEnergy()
{
if (float.TryParse(energyInput.text, out float amount))
{
energyAmount = amount;
GameManager.Command_SetEnergy(energyAmount);
MelonLogger.Msg($"Set energy to {energyAmount}");
}
else
{
MelonLogger.Error("Invalid energy amount input!");
}
}
but don’t forget to referencing the Il2CppBigAmbitions.dll in the dependencies.
This post is a continuation of the earlier Setting up a Modding Environment tutorial.
Since the original UnityExplorer doesn’t support Big Ambitions IL2CPP backend, we’re now using an IL2CPP-Interop fork along with the latest MelonLoader release to ensure full compatibility.