Yakuzashi Posted October 27, 2019 Share Posted October 27, 2019 Hello, I have question to anybody willing to help me. In the configuration menu you can change values of certain item for example. But can you make perk (from charactername.lua in scripts folder) switchable between on and off option ? I have no clue how to start it, so I am here for help. local handle = inst.sg.sg.actionhandlers[ACTIONS.PICK] handle.deststate = function(inst) return "doshortaction" end Here's where did I get this perk @no_signal's solution in this topic Link to comment Share on other sites More sharing options...
Ultroman Posted October 30, 2019 Share Posted October 30, 2019 { name = "BedrollCanSleepAtDay", label = "SR Usable At Day", hover = "Straw Roll: Usable at day?\nMake players be able to use Straw Rolls at daytime?", options = { {description = "Enabled", data = true}, {description = "Disabled", data = false}, }, default = false, }, Link to comment Share on other sites More sharing options...
Yakuzashi Posted October 30, 2019 Author Share Posted October 30, 2019 Thanks, but I still don't know how to connect it with function inside master_postinit in character.lua. Could you help me with this too ? Thank you in advance. Link to comment Share on other sites More sharing options...
Ultroman Posted November 3, 2019 Share Posted November 3, 2019 Expanding on the example I posted before, you'd do this to get the setting values. local myValue = GetModConfigData("BedrollCanSleepAtDay") Link to comment Share on other sites More sharing options...
Serpens Posted November 3, 2019 Share Posted November 3, 2019 8 minutes ago, Ultroman said: Expanding on the example I posted before, you'd do this to get the setting values. local myValue = GetModConfigData("BedrollCanSleepAtDay") additional information: GetModConfigData only works in modmain (and in scripts you import via modimport from modmain). So it wont work within your custom prefab file. To still get the value there, you can save it within the TUNING list or within your own GLOBAL variable. So eg. TUNING.MY_UNIQUE_VARIABLE_NAME = GetModConfigData("BedrollCanSleepAtDay") And then use this TUNING within your prefab file. Link to comment Share on other sites More sharing options...
Yakuzashi Posted November 4, 2019 Author Share Posted November 4, 2019 Thank you @Ultroman and @Serpens for your time and patience. Link to comment 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