JohnWatson Posted July 31, 2017 Share Posted July 31, 2017 for instance i want my server mod to always be survival and have caves turned off regardless of the settings the user has set is that even possible Link to comment Share on other sites More sharing options...
Lumina Posted July 31, 2017 Share Posted July 31, 2017 If i remember well, @Serpenswanted to do the same thing before, i don't know if he found a solution for this. Link to comment Share on other sites More sharing options...
Serpens Posted August 6, 2017 Share Posted August 6, 2017 (edited) You can force the most settings within modworldgenmain.lua (create it in your modfile where also modmain.lua is). There you add: AddTaskSetPreInitAny(function(tasksetdata) if tasksetdata.location == "forest" then tasksetdata.overrides={ world_size = "small", wormhole_prefab = "wormhole", layout_mode = "LinkNodesByKeys", season_start = "autumn", autumn = "veryshortseason", winter = "veryshortseason", spring = "veryshortseason", summer = "veryshortseason", } end end) I noticed you always have to include wormhole_prefab and layout_mode, otherwise game will crash. All other things are optionally. You can find the possible options here: Don't Starve Together\data\scripts\map\customise.lua ______________________________________________________________________________ Setting game mode and if caves should be active is a bit more complicated. For caves I added this workaround: if tasksetdata.location=="cave" then tasksetdata.tasks = {"CaveExitTask1"} tasksetdata.numoptionaltasks = 0 tasksetdata.optionaltasks = {} tasksetdata.set_pieces = {} tasksetdata.valid_start_tasks = {"CaveExitTask1"} tasksetdata.overrides={ world_size = "small", wormhole_prefab = "wormhole", layout_mode = "LinkNodesByKeys", } end This means, even if cave will exist, it will be totally empty. The workaround for the mode was to let the game crash, if the wrong mode is active if _G.TheNet:GetServerGameMode() ~= "adventure" then print("You have to choose adventure as game mode!! "..errortoabortgame) -- errortoabortgame is nil and can't be added to a string, it will cause a crash end From what I know you can't set the mode, but you can change the mode details. So instead forcing to use survival, you can change any choosen mode to work like survival: I copied this code somewhere: -----------spawn mode------------------------------------------------ -- local SpawnMode = GetModConfigData("spawn_mode") -- GLOBAL.GAME_MODES["custom_game"].spawn_mode = SpawnMode ----------ghost sanity drain-------------------------------------------- -- local GhostSanityDrain = GetModConfigData("ghost_sanity_drain") -- GLOBAL.GAME_MODES["custom_game"].ghost_sanity_drain = GhostSanityDrain -----------ghost enabled------------------------------------------------ -- local GhostEnabled = GetModConfigData("ghost_enable") -- GLOBAL.GAME_MODES["custom_game"].ghost_enabled = GhostEnabled ----------------reset timer----------------------------- -- local ResetTime = GetModConfigData("reset_time") -- if ResetTime then -- GLOBAL.GAME_MODES["custom_game"].reset_time = { time = 120, loadingtime = 180 } -- end -------------------------poratl revival------------------------------ -- local PortalRez = GetModConfigData("portal_rez") -- GLOBAL.GAME_MODES["custom_game"].portal_rez = PortalRez -----------------banned items----------------------------------------- -- local BanResItems = GetModConfigData("ban_rez") -- if BanResItems then -- GLOBAL.GAME_MODES["custom_game"].invalid_recipes = { "reviver", "lifeinjector", "amulet", "resurrections" } -- end Edited August 10, 2017 by Serpens Link to comment 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