krylincy Posted May 7, 2021 Share Posted May 7, 2021 I want to cahnge the spawn chance of the weeds to be equal. How can i access these definitions inside the weed_defs.lua file to overwrite global (for all files that require this one)? WEED_DEFS.weed_forgetmelots.seed_weight = TUNING.SEED_CHANCE_VERYCOMMON WEED_DEFS.weed_tillweed.seed_weight = TUNING.SEED_CHANCE_RARE WEED_DEFS.weed_firenettle.seed_weight = TUNING.SEED_CHANCE_RARE WEED_DEFS.weed_ivy.seed_weight = TUNING.SEED_CHANCE_RARE I would be grateful for any help! Link to comment https://forums.kleientertainment.com/forums/topic/129730-how-to-modify-weed_defslua/ Share on other sites More sharing options...
penguin0616 Posted May 8, 2021 Share Posted May 8, 2021 local WEED_DEFS = require("prefabs/weed_defs").WEED_DEFS WEED_DEFS.weed_forgetmelots.seed_weight = TUNING.SEED_CHANCE_VERYCOMMON WEED_DEFS.weed_tillweed.seed_weight = TUNING.SEED_CHANCE_RARE WEED_DEFS.weed_firenettle.seed_weight = TUNING.SEED_CHANCE_RARE WEED_DEFS.weed_ivy.seed_weight = TUNING.SEED_CHANCE_RARE Link to comment https://forums.kleientertainment.com/forums/topic/129730-how-to-modify-weed_defslua/#findComment-1457828 Share on other sites More sharing options...
krylincy Posted May 8, 2021 Author Share Posted May 8, 2021 14 hours ago, penguin0616 said: local WEED_DEFS = require("prefabs/weed_defs").WEED_DEFS WEED_DEFS.weed_forgetmelots.seed_weight = TUNING.SEED_CHANCE_VERYCOMMON WEED_DEFS.weed_tillweed.seed_weight = TUNING.SEED_CHANCE_RARE WEED_DEFS.weed_firenettle.seed_weight = TUNING.SEED_CHANCE_RARE WEED_DEFS.weed_ivy.seed_weight = TUNING.SEED_CHANCE_RARE And this will also apply to all other instances that require the weed defs, not only my local instance? Link to comment https://forums.kleientertainment.com/forums/topic/129730-how-to-modify-weed_defslua/#findComment-1458000 Share on other sites More sharing options...
penguin0616 Posted May 8, 2021 Share Posted May 8, 2021 Yep, unless copies of WEED_DEFS are used instead. Link to comment https://forums.kleientertainment.com/forums/topic/129730-how-to-modify-weed_defslua/#findComment-1458013 Share on other sites More sharing options...
krylincy Posted May 8, 2021 Author Share Posted May 8, 2021 Hm no that is not working. if i add local WEED_DEFS = require("prefabs/weed_defs").WEED_DEFS WEED_DEFS.weed_forgetmelots.seed_weight = 0.5 WEED_DEFS.weed_tillweed.seed_weight = 2 WEED_DEFS.weed_firenettle.seed_weight = 0.5 WEED_DEFS.weed_ivy.seed_weight = 0.5 in my modmain i still get tons of forgetmelots. how can change the chances? Link to comment https://forums.kleientertainment.com/forums/topic/129730-how-to-modify-weed_defslua/#findComment-1458101 Share on other sites More sharing options...
penguin0616 Posted May 8, 2021 Share Posted May 8, 2021 Use the weighted seed table instead of the weed definitions. 1 Link to comment https://forums.kleientertainment.com/forums/topic/129730-how-to-modify-weed_defslua/#findComment-1458133 Share on other sites More sharing options...
krylincy Posted May 9, 2021 Author Share Posted May 9, 2021 That worked, thank you Link to comment https://forums.kleientertainment.com/forums/topic/129730-how-to-modify-weed_defslua/#findComment-1458339 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