Conditional for another mod's settings

Place to get help with not working mods / modding interface.
Post Reply
yeahtoast
Inserter
Inserter
Posts: 21
Joined: Wed Feb 27, 2019 6:17 pm
Contact:

Conditional for another mod's settings

Post by yeahtoast »

Hi there, is there a way to use a function like this one:

Code: Select all

if settings.global["mod-setting-1"].value then
But referencing another mod's setting? How does one access remote mod settings?

This code:

Code: Select all

settings.global["mod-setting-1"].value
will always be nil since it's not part of the base game or internal to this mod. Any help is appreciated!

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2636
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: Conditional for another mod's settings

Post by steinio »

Nope, if the setting with that name exists you can read it.
Set a dependency for the other mod in info.json to be sure it's loaded first.
Image

Transport Belt Repair Man

View unread Posts

yeahtoast
Inserter
Inserter
Posts: 21
Joined: Wed Feb 27, 2019 6:17 pm
Contact:

Re: Conditional for another mod's settings

Post by yeahtoast »

Huh, turns out my issue was using .global instead of .startup for a startup setting... :oops: Good to know this is how this works.

Thanks for the help!

Post Reply

Return to “Modding help”