Mario384 Posted May 3, 2015 Share Posted May 3, 2015 Title pretty much says it all. Is it possible to enable and disable a character from being used via a mod config? Link to comment https://forums.kleientertainment.com/forums/topic/53476-enabling-and-disabling-a-character-via-config/ Share on other sites More sharing options...
Maris Posted May 3, 2015 Share Posted May 3, 2015 Why not? But why? Link to comment https://forums.kleientertainment.com/forums/topic/53476-enabling-and-disabling-a-character-via-config/#findComment-634248 Share on other sites More sharing options...
Mario384 Posted May 3, 2015 Author Share Posted May 3, 2015 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. Link to comment https://forums.kleientertainment.com/forums/topic/53476-enabling-and-disabling-a-character-via-config/#findComment-634287 Share on other sites More sharing options...
DarkXero Posted May 3, 2015 Share Posted May 3, 2015 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")endso 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. Link to comment https://forums.kleientertainment.com/forums/topic/53476-enabling-and-disabling-a-character-via-config/#findComment-634298 Share on other sites More sharing options...
Mario384 Posted May 3, 2015 Author Share Posted May 3, 2015 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")endso 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! Link to comment https://forums.kleientertainment.com/forums/topic/53476-enabling-and-disabling-a-character-via-config/#findComment-634311 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now