-
Notifications
You must be signed in to change notification settings - Fork 9
Tutorial two: Adding a config.
JMteam09 edited this page Feb 21, 2018
·
2 revisions
Great to see that you want to learn more, lets get started.
So remember where we left off?
Lets change our I_Do_not_know_da_wae.cs to do even better things!
Lets create a configuration class. (You can place this one in the same file)
namespace TestMod1
{
[MyModEntryPoint] //This tells the modloader this is the class that implements MyMod and is your main class
class I_Do_not_know_da_wae : MyMod
{
public I_Do_not_know_da_wae() : base("{YOUR MOD NAME HERE}","{YOUR MOD DESCRIPTION HERE}","{YOUR VERSION HERE}")
{
//Only assign variables here. doing mod related things meight result in errors!
}
protected override void onLoad()
{
//Do shit here
ModLoader.mainConsole.log("Hello world", "My Cool Log Tag");
}
protected override void onUnload()
{
//Not in use atm. will never be calld. dont worry
}
}
class MaiIConfigU : IMyConfig //Oh! im new! Look @ Me!!!
{
private String hi;
public override void SetupDefaults()
{
//This will be ran when the config is being created for the first time.
//You can do cool coding tricks in here too
this.hi = "Well im the default value";
ModLoader.mainConsole.log("We can do more here then just assign values!", "I have a free will too tag!");
}
}
}
W W W EEEEE L PPPPP
W W W W E L P P
W W W W EEEEE L PPPPP
W W W W E L P
W W EEEEE LLLLL P
I'm not a modder, what can I do?
Good question, if you still want to help us you can do your best to track bugs in mods.
Or report spelling errors because I am a silly writer.
Or you can try to come up with good ideas that we could implement.
Or if you can't think of anything, you can spread our name.
Home Section
Welcome / Getting started with modding
What is SFS-ML?
Tutorial Section
Tutorial one: Creating your first mod.
Tutorial two: Adding a config.