Jump to content

Mods changes in today's update


Recommended Posts

  • Developer

Hello everyone!

 

We just pushed out a new update with various improvements to the mod system.

 

Now when entering the Mods screen, mods are only downloaded if a new version is detected. This should allow users to subscribe to many more mods without worrying about massive download times everytime they want to tweak a setting. There is still a dialog that pops up while we check what you're subscribed to, and verify that the versions match, but this time should be significantly shorter than the download times you were used to.
 

The second change is that mods can now access the mod config data of the local machine in addition to the temp config data they receive from the server they are playing on. To do this, just pass true as the second parameter to GetModConfigData. An example of this would be

local get_local_config = trueinst.prefix = GetModConfigData("local_option", get_local_config)

As requested by some users, this will allow your mod to have data that is configured for the server, while still allowing local users to configure certain aspects of the mod. This is an improvement on the mod config downloading that happens when you join servers now.

You may have seen MarkL's post http://forums.kleientertainment.com/topic/49832-dedicated-server-client-now-available/#entry606644, dedicated servers are now available for everyone to run. Dedicated servers support mods now too, and can be automatically installed via servermods.lua in the main mods directory. This file is run on boot and will download any mods or collection of mods that are setup in the file.

--servermods.lua--There are two functions that will install mods, ServerModSetup and ServerModCollectionSetup. Put the calls to the functions in this file and they will be executed on boot.--ServerModSetup takes a string of a specific mod's Workshop id. It will download and install the mod to your mod directory on boot.--The Workshop id can be found at the end of the url to the mod's Workshop page.--Example: http://steamcommunity.com/sharedfiles/filedetails/?id=350811795--ServerModSetup("350811795")--ServerModCollectionSetup takes a string of a specific mod's Workshop id. It will download all the mods in the collection and install them to the mod directory on boot.--The Workshop id can be found at the end of the url to the collection's Workshop page.--Example: http://steamcommunity.com/sharedfiles/filedetails/?id=379114180--ServerModCollectionSetup("379114180")

These mods will be downloaded and installed to your mod folder, but they aren't enabled by default. Also, the mod only updates when the version changes on the Workshop, so server boot times should be reasonable and only pickup mod changes as they get posted to the Workshop.

 

To enable mods on dedicated servers, there are two ways. The first is to force enable the mods. To do this you will need to modify the file modsettings.lua to force enable the mods you desire. For example this would enable three mods from the workshop

ForceEnableMod("workshop-345692228")ForceEnableMod("workshop-346968521")ForceEnableMod("workshop-352373173")

The second option is using a modoverride.lua file. Dedicated servers can now enable mods and set mod configurations via a file in the mod’s folder named “modoverride.lua” (\mods\your_mod\modoverride.lua). An example of the contents of this file is 

enabled = trueconfiguration_options ={    hunt_time = 6}

Note, dedicated servers (and normal clients) can override the mod config options to non-valid options using this method. In my example, 6 is not a normal option for the hunt_time in the Hunt game mode mod. This file will also not get deleted when a mod is update on both the client and dedicated servers, but will in the new Clean All button (described below :-) )

 

You'll also notice a new button on the Mods screen labeled "Clean All". This button deletes all subscribed workshop mods and re-downloads them, it also disables all mods, deletes all of your mod configs and clears the temp mod download cache. Previously mods were deleted and re-downloaded when going into the Mods screen, but now that we only download mods when they change, there was no easy way for users to get a fresh copy of their mods. This button should also serve as a useful tool, when debugging mod issues with users. A user can get back to a clean setup by clicking Clean All instead of directing them to delete certain files manually. Manually downloaded and installed mods are not cleaned up by this button though, as we'd have no way to re-install them and it's expected that users doing that are comfortable with modifying the contents of the mods directory.

 

Hopefully these changes and new features are useful to you all! Please let me know if you have any questions!

 

 

Just a quick update about what I'm currently investigating, as it may have affect several people's mods. Some mods are showing up as needing updating (via the announce message) when in-game. Something appears to have changed with the way we're storing version tags on the Workshop, which is causing the version check to fail. Fortunately it doesn't appear to have affect all Workshop content. I'm working on a potential solution that will limit the impact on both the mod code and your workflows.

Edit: this is fixed now as of the update today(Jan 28th).

 

 

 

 

 

 

 

  • Sanity 1
Link to comment
Share on other sites

It is necessary to insert in the file settings.ini?

local get_local_config = trueinst.prefix = GetModConfigData("local_option", get_local_config)

don't have this file. Here is my

modsettings.lua

My settings.ini
 

DISABLECLOUD = true[MISC]CONSOLE_ENABLED = true[translation]translation_type = Fullupdate_frequency = OncePerWeek[account]token = hidden)server_token = hidden)[network]default_server_name = 123default_server_description = 123server_port = 11000server_password = max_players = 32game_mode = endlesspvp = trueenable_vote_kick = trueconnection_timeout = 15000tick_rate = 30enable_autosaver = trueenable_snapshots = true[STEAM]DISABLECLOUD = true
Edited by Atavis
Link to comment
Share on other sites

It is necessary to insert in the file settings.ini? ? 1 2 local get_local_config = true inst.prefix = GetModConfigData("local_option", get_local_config)
 No, this is the sort of code that a mod developer would put in their modmain.

 

Your settings.ini looks normal.

 

modsettings.lua you should have, but it's not in Documents/Klei/DoNotStarveTogether, it's in the game files' mod folder. modoverride.lua (which is where you should be putting most of the stuff mentioned in this post, the configuration) should be created right next to modsettings.lua if you need it.

Link to comment
Share on other sites

 No, this is the sort of code that a mod developer would put in their modmain.

 

Your settings.ini looks normal.

 

modsettings.lua you should have, but it's not in Documents/Klei/DoNotStarveTogether, it's in the game files' mod folder. modoverride.lua (which is where you should be putting most of the stuff mentioned in this post, the configuration) should be created right next to modsettings.lua if you need it.

 

This is my error I found the files in the folder, Don't Starve Together Dedicated Server\mods.

modsettings.lua

 

ForceEnableMod("workshop-345692228")

servermods.lua

 

ServerModSetup("345692228")

There is no mod in the game(

http://steamcommunity.com/sharedfiles/filedetails/?id=345692228

And if you put

modsettings.lua

ForceEnableMod("workshop-345692228")ForceEnableMod("workshop-346968521")ForceEnableMod("workshop-352373173")

servermods.lua

ServerModSetup("345692228")ServerModSetup("346968521")ServerModSetup("352373173")

then go write a lot of errors

 

Edited by Atavis
Link to comment
Share on other sites

@Atavis, rezecib beat me to it, but yeah, no changes need to be made to your settings.ini file. I'm a bit confused though, what are you trying to do? 

 

I'm trying to connect 3 fashion your guide.

@Atavis, Minimap HUD is a client-only mod. Enabling it on a dedicated server won't do anything. If people joining the server want the mod, they can enable it themselves.

Well. And what other mods?

Link to comment
Share on other sites

  • Developer

@Atavis, which mod are you trying to setup on the server?

I'd suggest starting with just one.

 

In servermods.lua, just have

ServerModSetup("346968521")

and in modsettings.lua, just have

ForceEnableMod("workshop-346968521")

If that doesn't work, please post your log.txt file so we can see what the issue is.

Link to comment
Share on other sites

@Atavis, which mod are you trying to setup on the server?

I'd suggest starting with just one.

 

In servermods.lua, just have

ServerModSetup("346968521")

and in modsettings.lua, just have

ForceEnableMod("workshop-346968521")

If that doesn't work, please post your log.txt file so we can see what the issue is.

Good. 

And where to register 

 

local get_local_config = trueinst.prefix = GetModConfigData("local_option", get_local_config)
Link to comment
Share on other sites

  • Developer
Good.  And where to register    ? 1 2 local get_local_config = true inst.prefix = GetModConfigData("local_option", get_local_config)
 

 

This code is only for mod developers to use in their modmain files. If you're just setting up a server, you don't need to do that.

Link to comment
Share on other sites

@Atavis, which mod are you trying to setup on the server?

I'd suggest starting with just one.

 

In servermods.lua, just have

ServerModSetup("346968521")

and in modsettings.lua, just have

ForceEnableMod("workshop-346968521")

If that doesn't work, please post your log.txt file so we can see what the issue is.

image.png

Edited by Atavis
Link to comment
Share on other sites

@Atavis, that error looks unrelated to the Wilson's House mod. I assume you're running another mod on your local client that is having issues? 

solved the problems. Downloaded the mod with the server part, copied in the folder mod_config_data and everything works.

Link to comment
Share on other sites

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
 Share

×
  • Create New...