Jjmarco Posted January 18, 2015 Share Posted January 18, 2015 Hello, I have a question about mod configs: If both the client and the host run the same mod, is it possible for the client to get the host's mod config?I want to be able to override the client's mod config with the host's. Thanks in advance Link to comment https://forums.kleientertainment.com/forums/topic/49319-get-hosts-mod-config/ Share on other sites More sharing options...
Kzisor Posted January 18, 2015 Share Posted January 18, 2015 @Jjmarco, more details on what you are wanting to do is needed. Please be specific because of the following. If you want to adjust items such as components or health values, etc. that only needs to be modified on the server side. If you are wanting to modify the client's UI, then I understand. Link to comment https://forums.kleientertainment.com/forums/topic/49319-get-hosts-mod-config/#findComment-603187 Share on other sites More sharing options...
Developer Diabu Posted January 18, 2015 Developer Share Posted January 18, 2015 (edited) Hello, I have a question about mod configs: If both the client and the host run the same mod, is it possible for the client to get the host's mod config?I want to be able to override the client's mod config with the host's. Thanks in advance I think PeterA worked on this I'll send him this topic ! Edited January 18, 2015 by Diabu Link to comment https://forums.kleientertainment.com/forums/topic/49319-get-hosts-mod-config/#findComment-603189 Share on other sites More sharing options...
Jjmarco Posted January 18, 2015 Author Share Posted January 18, 2015 @Kzisor, I want to modify the client's UI depending on the host's config of the mod.When the host disables a part of the mod through the config, it disables a server-side part of it, which results in a part of the UI being redondant.This is why I want to be able to get the host's config, to synchronize the change to the client, which may have a different mod config. Sorry if I was unclear. @Diabu, great, thanks! Link to comment https://forums.kleientertainment.com/forums/topic/49319-get-hosts-mod-config/#findComment-603190 Share on other sites More sharing options...
Kzisor Posted January 18, 2015 Share Posted January 18, 2015 @Kzisor, I want to modify the client's UI depending on the host's config of the mod.When the host disables a part of the mod through the config, it disables a server-side part of it, which results in a part of the UI being redondant.This is why I want to be able to get the host's config, to synchronize the change to the client, which may have a different mod config. Sorry if I was unclear. @Diabu, great, thanks! I think I have the code to accomplish that without needing the host's config settings.--Example:inst.screenshakeevent = net_event(inst.GUID, "screenshake")inst:ListenForEvent("screenshake", OnScreenShake) --Servers can push this and it will trigger on clientsinst.screenshakeevent:push()The theory is that on your server you want to push the event only when the section of code is enabled. Otherwise it won't be activated on the clients side. Link to comment https://forums.kleientertainment.com/forums/topic/49319-get-hosts-mod-config/#findComment-603195 Share on other sites More sharing options...
Developer PeterA Posted January 18, 2015 Developer Share Posted January 18, 2015 @Jjmarco,as Diabu mentioned, I've implemented a solution to this into the game (yet to be released). When you join a server, you'll download the mod configuration of any mod that is specified as "all_clients_require_mod = true" in the modinfo. An update with this will be coming out soon (hopefully this coming week) that also includes support for dedicated servers to specify mod configs, and a better user experience when server mods are out of date. Link to comment https://forums.kleientertainment.com/forums/topic/49319-get-hosts-mod-config/#findComment-603211 Share on other sites More sharing options...
outseeker Posted January 18, 2015 Share Posted January 18, 2015 Kickass idea! Link to comment https://forums.kleientertainment.com/forums/topic/49319-get-hosts-mod-config/#findComment-603221 Share on other sites More sharing options...
Jjmarco Posted January 18, 2015 Author Share Posted January 18, 2015 @PeterA, perfect, looking forward for the update!Does it mean the public standalone server will be released soon? @Kzisor, what must inst be in this case? Anything? Link to comment https://forums.kleientertainment.com/forums/topic/49319-get-hosts-mod-config/#findComment-603358 Share on other sites More sharing options...
Kzisor Posted January 18, 2015 Share Posted January 18, 2015 @Jjmarco, inst in this case would be the widget or UI section of the game which you do not want to show. Link to comment https://forums.kleientertainment.com/forums/topic/49319-get-hosts-mod-config/#findComment-603387 Share on other sites More sharing options...
Jjmarco Posted January 18, 2015 Author Share Posted January 18, 2015 @Kzisor, wouldn't the event get only pushed once? In which case any new player joining the server will not have the event triggered. Or am I missing something? Link to comment https://forums.kleientertainment.com/forums/topic/49319-get-hosts-mod-config/#findComment-603420 Share on other sites More sharing options...
Kzisor Posted January 18, 2015 Share Posted January 18, 2015 (edited) @Jjmarco, you would push the event upon a player logging into the game. local function SOMEFUNCTION(inst) -- CALL PUSH EVENT HEREend AddPlayerPostInit(SOMEFUNCTION) Edited January 18, 2015 by Kzisor Link to comment https://forums.kleientertainment.com/forums/topic/49319-get-hosts-mod-config/#findComment-603454 Share on other sites More sharing options...
Jjmarco Posted January 18, 2015 Author Share Posted January 18, 2015 @Kzisor, while trying to implement your solution and looking for more information about net_event, I noticed that there was a net_bool netvar.Wouldn't it be simpler to just use that? Considering it will never change during the play session, client would just have to read the net_bool set by the host and act accordingly. Something along these lines:self.isThisTrue = net_bool(self.inst.GUID, "is_this_true")if TheWorld.ismastersim then self.isThisTrue:set(GetModConfigData("Option1"))endif self.isThisTrue:value() then -- Do stuffendWould that work? Link to comment https://forums.kleientertainment.com/forums/topic/49319-get-hosts-mod-config/#findComment-603479 Share on other sites More sharing options...
Kzisor Posted January 18, 2015 Share Posted January 18, 2015 @Jjmarco, the net_event basically just wraps the net_bool in a nice wrapper. Check out the post by the Developers which is stickied at the top of this forum about netvars for more information. Should be the last post by V2C. Link to comment https://forums.kleientertainment.com/forums/topic/49319-get-hosts-mod-config/#findComment-603535 Share on other sites More sharing options...
Sarcen Posted January 19, 2015 Share Posted January 19, 2015 ..When you join a server, you'll download the mod configuration of any mod that is specified as "all_clients_require_mod = true" in the modinfo... @PeterA,Does that mean client side configs get overwritten by server side, or can you still access the client side configs as well? because some mods might require a server side component but you still want each client to configure it for themselves. So you should be able to access both config versions. Link to comment https://forums.kleientertainment.com/forums/topic/49319-get-hosts-mod-config/#findComment-603635 Share on other sites More sharing options...
rezecib Posted January 19, 2015 Share Posted January 19, 2015 @Sarcen, Do you have an example in mind? I think you're right, but I'm not coming up with one. Perhaps in the modinfo we could specify if a given config option should use the host's setting or the client's? Link to comment https://forums.kleientertainment.com/forums/topic/49319-get-hosts-mod-config/#findComment-603752 Share on other sites More sharing options...
Developer PeterA Posted January 19, 2015 Developer Share Posted January 19, 2015 @Sarcen, that's a good question! Currently it's implemented such that if you have temp config data from the server, the mod will read that data before it reads the local data. I should be able to add a flag so that you can request the local vs the host's config. Then your mod can use whatever logic it wants for determining which configuration to use. As rezecib also mentioned, I can't really think of a good use case for this, but it's a fairly simple change and I can imagine it might be helpful in some scenarios. I'll add that in! Thanks for the feedback! Link to comment https://forums.kleientertainment.com/forums/topic/49319-get-hosts-mod-config/#findComment-603764 Share on other sites More sharing options...
Jjmarco Posted January 19, 2015 Author Share Posted January 19, 2015 I was actually wondering about that, that's great now that it will be added! An example of a use would be a mod in which we want the server-side code to be configured by the server, but the client-side code, such as some UI components, to be configured by clients. This would give a much more customizable mod. @Kzisor, Ah, I see. I'll check the sticked post, thanks! Link to comment https://forums.kleientertainment.com/forums/topic/49319-get-hosts-mod-config/#findComment-603779 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