#SMODS config tab API?
1 messages · Page 1 of 1 (latest)
It relies on the UI, and everyone builds their own UI, you can find information on how to start using the UI in the wiki, though, honestly, there should probably be an example mod that's just an easy config page, I'll look into making one sometime.
Ah I see
Dang I'd really hoped I don't have to dip my toes deep for a simple check option 😓
How much of a hassle is it?
It's no doubt a learning curve, but I'd say it's on the same level as contexts, looks intimidating, a little rough the first few times you experiment with it, then it really clicks.
Alright! sounds fairly easy then, Thank you very much :D
Good luck with making an example mod, seems necessary
I, up until now, relied exclusively on SMODS documentation, so I have no idea what wiki you're talking about, could I get a link please? 😅
Thanksies!!
Alright, I have a config page set up with a couple of checkmarks hooked up to a config.lua, now how do I grab their values?
Specifically during injection, as I want to link 'em to atlas positions and such 🤔
local config = SMODS.current_mod.config
config is nil, could this be because I'm calling it during injection? ☹️
Huh, I looked it up here and it seems plenty had the same issue before, including you 😅
What does your config.lua look like?
I think try surrounding your variables in [''], so it'd be ['jokers_designs'].
again, it's config itself that's nil, it won't even bring the file up
where are you accessing the config, and where is the config file at?
Config file is next to main.lua
I'm trying to call it during injection, as in setting a Joker's atlas
you need to save a reference to the config somewhere in your main file (not within any other object), SMODS.current_mod gets overwritten after the initial loading phase
is your config file's name exactly config.lua?
Yup
That's what I've been doing!
can you show code?
config.getValue?
it doesn't matter anyway, config itself is nil
crash please
but yeah what's the proper way of calling out of config, just ["jokers_designs"] 🤔
You can just do config.jokers_designs, or config['jokers_designs'].
I assume you're hiding it here for a reason, but, do you wanna DM me the code so I can mess around and figure it out?
like the whole mod?
Sure.
Alright haha
function get_design gets called in line 942 to set a joker's atlas to either one of these
this isn't config itself being nil, it's design[config.jokers_designs] being nil
that's designs.Redesign
wait what
try printing config
What's the command for logging 💀
sendDebugMessage(tprint(config)) should do
In the black console, and you may need to remove the crashing line.
This was correct, thank you