().maxHealth = MyFirstSRModConfig.MaxHealth We can set this value directly using the following line: In Slime Rancher the PlayerModel class instance can be accessed through the GameModel instance class which in turn can be retrieved from the SceneContext using the SRSingleton class. You can find this method by looking through the game code which will take some experience and analyzing.įor this particular scenario this method is not the best to use. This method uses only Unity Scripting and the game's own code to modify the max health value. MyFirstSRMod.Log("Error loading mod settings: " + e.Message + "(" + e.InnerException?.Message + ")") MyFirstSRMod.Log("Finished loading settings.") MaxHealth = cfg.Read("MaxHealth", new UMFConfigInt(999, 1, 9999), "This is the player's max health.") MyFirstSRMod.Log("Finished UMF Settings.") ![]() cfg.Write("MaxVersion", new UMFConfigString("9.99999")) //Uncomment if you think your mod may break with the next major UMF release.Ĭfg.Write("UpdateURL", new UMFConfigString("")) Ĭfg.Write("ConfigVersion", new UMFConfigString(configVersion)) cfg.Write("SupportsHotLoading", new UMFConfigBool(false)) //Uncomment if your mod can't be loaded once the game has started.Ĭfg.Read("LoadPriority", new UMFConfigString("Normal")) Ĭfg.Write("MinVersion", new UMFConfigString("0.52.1")) ![]() MyFirstSRMod.Log("The config file was outdated and has been deleted. If (cfgVer != string.Empty & cfgVer != configVersion) String cfgVer = cfg.Read("ConfigVersion", new UMFConfigString()) Private static readonly string configVersion = "1.0" Your config class should now look something like this: using System
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |