Jump to content

Recommended Posts

Hello

 

I'm having trouble figuring out how to define different variables that mode creators allow us to change. To give a clear example I've added the simple protection mod and need to add different parameters such as minimum player days, starting day etc. and I'm not sure how to do it. I opened modmain.lua but there's no place where all these are predefined to their default values so I can change them.

I will continue with the example of the mod I've already mentioned. This is the first lines of code:

 

local STRINGS = GLOBAL.STRINGS
 
local IS_ROG_ENABLED = GLOBAL.kleifileexists("scripts/components/witherable.lua")
 
local starting_day = GetModConfigData("starting_day")
local min_days = GetModConfigData("min_days")
local container_protection = GetModConfigData("container_protection")
local stewer_protection = GetModConfigData("stewer_protection")
local backpack_protection = GetModConfigData("backpack_protection")
local ghost_protection = GetModConfigData("ghost_protection")
local willow_love = GetModConfigData("willow_love")
local bushes_protection = GetModConfigData("bushes_protection")
local bushes_dig_protection = GetModConfigData("bushes_dig_protection")
local fire_spread_protection = GetModConfigData("fire_spread_protection")
 
I'm guessing the things above is the definition of the parameters used. So therefore, should I give the values in the form I've done below? 
 
Starting day = 10
Minimum player days = 1 
Ghost protection = Yes 
Chest protection = Yes 
Backpack protection = No 
Crock pot protection = Yes 
Bushes dig protection = No 
Willow protection = Yes 
 
// Sorry if my question is silly, but I'm not familiar with customizing mods via this way. I got my first dedicated server a few hours ago and still have trouble making the mods run without crashing the server :D

I have something like:

 

configuration_options =
{
    {
        name = "starting_day",
        label = "Starting day",
        options =
        {
            {description = "10", data = 10},
            {description = "15", data = 14},
            {description = "21", data = 20},
            {description = "36", data = 35}
        },
        default = 10,
    },
 
so all I do is modify the default value?
 
Do you also know why when I run steam update on the server all my mods disappear? I have to add serverModSetup and ForceEnableMode over and over again. Also mods won't install themselves unless I turn off the server and turn it back on, restarting won't do it. I'm have my server on a hosting website.
Thanks
Edited by arheidis

ForceEnableMode is deprecated for servers. Use modoverrides.lua file instead of modsettings.lua. Also you will be able to change setting of your mods.

 

​More info here: http://dont-starve-game.wikia.com/wiki/Don’t_Starve_Together_Dedicated_Servers 

Edited by Maris

that doesn't even work and it's not even error free. I will still get this error at times:

[00:00:22]: CURL ERROR: couldn't connect to host at api.steampowered.com:80
[00:00:22]: Failed GetPublishedFileDetailsResponse

 

actually I had to reinstall server again after doing what you said... it won't run at all after at one point, even without mods.

Edited by arheidis

yes I know... I've been using that. but the server seems so buggy and random. sometimes when I reset it, it will give error otherwise it will work. I can't even add scheduled restart because I'm afraid it might not work and I would have to check the console myself all the time.

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...