Jump to content

Recommended Posts

Why not? But why?

 

I was asking because I basically want to make the mod I have going a little more "server friendly" because the mod adds the Giants in as playable characters.  Now, they can rather... destructive, so I thought it might be a good idea to make a config to enable and disable specific characters.  Also, how would I go about it?  I've been looking at some other mods, but I'm lost as to how to go about it.

 

First you edit the configuration options in modinfo, example:

configuration_options = {	{		name = "Deerclops",		label = "Deerclops",		options = 		{			{description = "Yes", data = "Yes"},			{description = "No", data = "No"},		},		default = "Yes"	},}

Now there is a Deerclops option, that will return either the data Yes or No.

 

Now, in your modmain, you put this, example:

if GetModConfigData("Deerclops") == "Yes" then	AddModCharacter("deerclopsplayer", "MALE")end

so when the mod loads, if the configdata returned is Yes, the deerclops is added.

 

Also, you have to eliminate the AddModCharacter("deerclopsplayer") at the end. AddModCharacter("deerclopsplayer") does the same as AddModCharacter("deerclopsplayer", "MALE") excepts it assigns a default gender.

First you edit the configuration options in modinfo, example:

configuration_options = {	{		name = "Deerclops",		label = "Deerclops",		options = 		{			{description = "Yes", data = "Yes"},			{description = "No", data = "No"},		},		default = "Yes"	},}

Now there is a Deerclops option, that will return either the data Yes or No.

 

Now, in your modmain, you put this, example:

if GetModConfigData("Deerclops") == "Yes" then	AddModCharacter("deerclopsplayer", "MALE")end

so when the mod loads, if the configdata returned is Yes, the deerclops is added.

 

Also, you have to eliminate the AddModCharacter("deerclopsplayer") at the end. AddModCharacter("deerclopsplayer") does the same as AddModCharacter("deerclopsplayer", "MALE") excepts it assigns a default gender.

 

Thanks!  As for the double AddModCharacter thing, I forgot to update the version of the mod on the fourms.  I have the mod up on Steam and I only updated it there, so this reminds me to post that update on the fourms.  Thanks!

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...