I'm working on porting the farming update to DS, and in the file "prefabs/farm_plant_defs" there are some properties using DST only TUNING values, so I put them in another file and imported them in modmain.lua. However those values are not actually assigned, dumptable shows that any field with modded TUNING values are not actually set, but the TUNING values themselves are.
However, once I've put the modimport call of my tuning file before adding values to PrefabFiles table, those modded values got assigned and worked correctly. Is this intended to work this way?
1. Have all your modded tuning values in a separate lua file and import it after adding values to PrefabFiles table
2. Have another script file that returns a table, with some fields using the modded values and some don't.
3. In the prefab file, require the script file and notice how those modded values aren't actually assigned. Try doing an arithmetic operation and an error will show up.
4. Import tuning values file before adding values to PrefabFiles table, things work perfectly fine now.
--main/tuning.lua: GLOBAL.TUNING.FARM_PLANT_DROUGHT_TOLERANCE = 0.1 --modmain.lua in step 1: PrefabFiles = { "farm_plants", -- This file requires farm_plant_defs.lua } modimport("main/tuning.lua") --modmain.lua in step 4: modimport("main/tuning.lua") PrefabFiles = { "farm_plants", -- This file requires farm_plant_defs.lua }
- 1
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