Pianobeats Posted December 22, 2015 Share Posted December 22, 2015 I want to make a mod that changes the number of drops I get from hacking a vine bush and a bamboo tree. I know you can easily do this with grass and saplings by typing this code:function grasspostinit(inst) inst.components.pickable.numtoharvest = --Number of how much grass I wantendAddPrefabPostInit("grass", grasspostinit)But, bamboo trees and vine bushes aren't pickable. So I can't use inst.components.pickable.numtoharvestInstead, bamboo trees/vine bushes are hackable. So naturally I would try inst.components.hackable.numtoharvestHowever after looking closely in the hackable.lua file, there is no numtoharvest. So any ideas how I would go making this mod? Link to comment https://forums.kleientertainment.com/forums/topic/61195-help-on-making-a-simple-mod/ Share on other sites More sharing options...
Arkathorn Posted December 22, 2015 Share Posted December 22, 2015 The 'hackable' component uses the 'lootdropper' component to drop it's loot, which is specified and can be modified at 'inst.components.hackable.product' (where 'inst' is the prefab's instance). Unfortunately, the number of drops cannot be modified. I suggest that you create a prefab that, instead of initializing in it's 'fn' function, does the following:Spawn a 'bamboo' prefab with 'SpawnPrefab'. Edit the 'stackable' component of the bamboo to have a specific stack size. Return the bamboo.The 'product' field of the 'hackable' component can then be overridden with the identifier of this new prefab (eg. 'bamboostack'). Link to comment https://forums.kleientertainment.com/forums/topic/61195-help-on-making-a-simple-mod/#findComment-700479 Share on other sites More sharing options...
Pianobeats Posted December 22, 2015 Author Share Posted December 22, 2015 Okay. I kind of understand what you mean. But I'm not sure how I would start this. ._. I've never made a prefab of my own before. Link to comment https://forums.kleientertainment.com/forums/topic/61195-help-on-making-a-simple-mod/#findComment-700785 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