Jump to content

Modoverrides.lua Issue


Recommended Posts

Hello. I am having the following problem:

Whenever a mod has both numbers and text in its config options, I seem to be unable to define them in modoverrides.lua. Example (disabled until I figure out how to properly configure it):

--# Throwable Spears    ["workshop-354415247"] = { enabled = false,        configuration_options ={        SMALL_MISS_CHANCE = "0",        LARGE_USES = "150",        SMALL_USES = "150",        RANGE_CHECK = "false",} },

If I enable the mod with that config, the server will crash whenever I go to throw a spear. If I have it enabled, and remove the configuration_options, then it works fine.  I tried doing ["RANGE_CHECK"] = "false", but that didn't work. I tried "RANGE_CHECK" = "false", and that didn't work either.

*Edit: Also, even if I leave out RANGE_CHECK entirely, and just have the 3 options, it still crashes the server when I throw a spear.

 

I guess my question is: how do I use configuration_options when both numbers and letters are used? Also, I want to configure the Mineable Gems mod but I have no idea how to:

--# Mineable Gems    ["workshop-380423963"] = { enabled = false,        configuration_options ={        Boulder Blue Gem = "0.5",} },

I also tried "Boulder Blue Gem" = "0.5" and ["Boulder Blue Gem"] = "0.5" but neither worked.

*Edit: Mineable Gems enabled = false. I forgot which one I had it set to - was typing it all manually.

 

*Edit: Added these log entries:

[00:01:03]: [string "../mods/workshop-354415247/modmain.lua"]:25: attempt to compare number with stringLUA ERROR stack traceback:../mods/workshop-354415247/modmain.lua:25 in (field) onhit (Lua) <22-54>inst = 109253 - spear_projectile (valid:true)attacker = 109196 - wx78 (valid:true)target = 109251 - crow (valid:true)skipsanity = nilsmalltarget = truemissed = falsescripts/components/projectile.lua:155 in (method) Hit (Lua) <141-157>self =launchoffset = table: 04461C70dest = (-107.45, 0.00, 344.06)start = (-101.72, 0.00, 342.17)inst = 109253 - spear_projectile (valid:true)onhit = function - ../mods/workshop-354415247/modmain.lua:22speed = 30hitdist = 1homing = true_ = table: 04461B58target = 109251 - crow (valid:true)attacker = 109196 - wx78 (valid:true)weapon = 109253 - spear_projectile (valid:true)scripts/components/projectile.lua:195 in (method) OnUpdate (Lua) <177-206>self =launchoffset = table: 04461C70dest = (-107.45, 0.00, 344.06)start = (-101.72, 0.00, 342.17)inst = 109253 - spear_projectile (valid:true)onhit = function - ../mods/workshop-354415247/modmain.lua:22speed = 30hitdist = 1homing = true_ = table: 04461B58dt = 0.033333335071802target = 109251 - crow (valid:true)current = (-106.31, 1.91, 343.69)scripts/update.lua:183 in () ? (Lua) <146-219>dt = 0.033333335071802tick = 562k = 109253v = 109253 - spear_projectile (valid:true)cmp = table: 04462260

Link to comment
Share on other sites

I had the same issue so instead of adding the configuration to modoverrides.lua I went to the mod folder directly in file manager\mods\ and looked for the workshop folder. You should see a file called modinfo.lua and you can change the default value #'s there.  :-)

Link to comment
Share on other sites

I had the same issue so instead of adding the configuration to modoverrides.lua I went to the mod folder directly in file manager\mods\ and looked for the workshop folder. You should see a file called modinfo.lua and you can change the default value #'s there.  :-)

 

@Dave0522 I know, thanks.  :friendly_wink: I was hoping there was a way to fix it in modoverrides.lua so that clients who download the mod from the workshop will have the same settings as the server. Modoverrides.lua does that, right? Or does it only override config for the server?  :hororr:

 

If that's the case, it really does look like I'm better off editing the modinfo for each one...  :frown-new:

Link to comment
Share on other sites

@Dave0522 I know, thanks.  :friendly_wink: I was hoping there was a way to fix it in modoverrides.lua so that clients who download the mod from the workshop will have the same settings as the server. Modoverrides.lua does that, right? Or does it only override config for the server?  :hororr:

 

If that's the case, it really does look like I'm better off editing the modinfo for each one...  :frown-new:

 

Not sure if changing the configuration settings in modinfo only affects the host. 

 

Yeah, editing each modinfo is a pain but inserting the configuration changes in modoverrides wouldn't work for me either.  :(

Link to comment
Share on other sites

I have this config working, yours is very similar to mine

 

--#Speartrhow

["workshop-354415247"] = { enabled = true,

configuration_options =

{

SMALL_MISS_CHANCE = 0,

LARGE_USES = 150,

SMALL_USES = 150,

RANGE_CHECK = true,

}

},

 

@Screamer21 Ah. You're not surrounding the override setting in quotes. I bet that is what's causing it to screw up for me. I'll test this and post the results.

 

*Edit: And now I'm getting modoverrides.lua - FMOD errors. :frown-new: Beginning to think this is totally unnecessary, that it's easier to ForceEnable all of them and edit the modinfo.lua for each one when I need to. Only problem is that when the mod author updates it then I have to go back and re-edit. Oh well.  :chargrined:

Link to comment
Share on other sites

@Screamer21 Ah. You're not surrounding the override setting in quotes. I bet that is what's causing it to screw up for me. I'll test this and post the results.

 

*Edit: And now I'm getting modoverrides.lua - FMOD errors. :frown-new: Beginning to think this is totally unnecessary, that it's easier to ForceEnable all of them and edit the modinfo.lua for each one when I need to. Only problem is that when the mod author updates it then I have to go back and re-edit. Oh well.  :chargrined:

 

You need to use only one of both, modoverrides.lua is better if u have many servers, and it works for me, and you dont need quotes

Link to comment
Share on other sites

Use quotes only for strings.

150 and 0.5 are the numbers.

true and false are the booleans.

 

Just copy and paste values from modinfo of the mod, without adding or removing quotes.


 

 

Boulder Blue Gem = "0.5",

:wilson_facepalm:

Link to comment
Share on other sites

Copy & paste for dedicated server:

["workshop-380423963"] = { --Mineable Gems	enabled = true,	configuration_options =	{		-- 1 means 100%, 0.3 means 30%, 0.15 means 15% etc.		-- Also 3.7 means 3 gems + 70% chance of 4th gem.		["Boulder Blue Gem"] = 0.01,		["Boulder Purple Gem"] = 0.005, --Means 0.5%		["Gold Vein Red Gem"] = 0.01,		["Gold Vein Purple Gem"] = 0.005,		["Flintless Blue Gem"] = 0.02,		["Flintless Red Gem"] = 0.02,		["Flintless Purple Gem"] = 0.01,		["Meteor Yellow Gem"] = 0.01,		["Meteor Orange Gem"] = 0.01,		["Meteor Green Gem"] = 0.01,	}},

Link to comment
Share on other sites

Just copy and paste values from modinfo of the mod, without adding or removing quotes.

 

 

Would changing the config in modinfo.lua only apply to/affect the server host if the client already has the mod downloaded?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...