Jump to content

[Solved]How to use GetModConfigData(" ") in character.lua?


Recommended Posts

Hello, if someone can help me with this that'd really help be great :)!

So, how can I use " GetModConfigData("   ") " in my character.lua? The game crashes & says "use ModIndex:GetModActualName(   )" or something like that, but I try to use that instead of the other & I get crash " variable 'ModIndex' is not declared"... Help would be appreciated :(..

Thanks for looking at my problem, have a good time :D!

Edited by SuperDavid
Link to comment
Share on other sites

I'd be interested to see if anyone has directly linked data from that function straight to a character (from what I can tell it's mod utility specific, so I assume it's for the mod initialise only), I have merely used it to adjust my character's mechanic by reading the function value from main. Sample:

local Mad_enabled = GetModConfigData("Mad_CHK")

-- if mad disabled
if not Mad_enabled then
	AddPrefabPostInit("warrick", function(inst)
		inst.madness = 1
	end)
end

I've tested the impact of the code via network and client - it all matches up even though inst.madness is network specific (past pristine/not world etc).

Hope this helps some!

Edited by MorickClive
Link to comment
Share on other sites

the easiest way would be to store your modsetting in TUNING.
So in modmain you do

GLOBAL.TUNING.MYMODNAME_SPEED = GetModConfigData("characterspeed")

and then use
TUNING.MYMODNAME_SPEED
in your other game files.

Edited by Serpens
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...