mexican geek Posted September 3, 2021 Share Posted September 3, 2021 I'm making a character mod and i want it to be able to consume rocks and flint it picks up. I know there's a Topic like this already but I'm very new to lua and modding DST altogether, so, if anyone would be so kind as to help and explain bit by bit how this can be done, it'll be much appreciated... :3 Link to comment https://forums.kleientertainment.com/forums/topic/133237-help-with-eating-rocks/ Share on other sites More sharing options...
HarryPPP Posted September 3, 2021 Share Posted September 3, 2021 (edited) It's actually quite simple! Put this code below the "master_postinit" function in your character's file: if inst.components.eater ~= nil then table.insert(inst.components.eater.preferseating, FOODTYPE.ELEMENTAL) -- FOODTYPE.ELEMENTAL are pretty much all rocks in the game, including gems. table.insert(inst.components.eater.caneat, FOODTYPE.ELEMENTAL) inst:AddTag(FOODTYPE.ELEMENTAL.."_eater") -- Add a tag in case you want to check if a character can eat rocks. end I'm not sure if this is the best way of doing this, but I did what the "eater" component did for WX-78 eating gears. Edited September 3, 2021 by HarryPPP 1 Link to comment https://forums.kleientertainment.com/forums/topic/133237-help-with-eating-rocks/#findComment-1490735 Share on other sites More sharing options...
mexican geek Posted September 11, 2021 Author Share Posted September 11, 2021 On 9/3/2021 at 10:30 PM, HarryPPP said: It's actually quite simple! Put this code below the "master_postinit" function in your character's file: if inst.components.eater ~= nil then table.insert(inst.components.eater.preferseating, FOODTYPE.ELEMENTAL) -- FOODTYPE.ELEMENTAL are pretty much all rocks in the game, including gems. table.insert(inst.components.eater.caneat, FOODTYPE.ELEMENTAL) inst:AddTag(FOODTYPE.ELEMENTAL.."_eater") -- Add a tag in case you want to check if a character can eat rocks. end I'm not sure if this is the best way of doing this, but I did what the "eater" component did for WX-78 eating gears. THANKS SO SO MUCH, it worked instantly and helped me so much. I also used another topic to change each prefabs' bonuses and this is shaping up to be great, thank you so much! Link to comment https://forums.kleientertainment.com/forums/topic/133237-help-with-eating-rocks/#findComment-1493840 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