julz1981 Posted May 16, 2014 Share Posted May 16, 2014 I'd like to make it so that, when you see berrybushes with lots of berries it gives you three berries and the rest of the time it gives one as usual, any idea how? I'm not good at modding at all, but i saw this, and my guess is it's for the animation only, but there must be a way to change the number of berries it gives? p.s.- can someone tell me how to hide long text like the following?local function pickanim(inst) if inst.components.pickable then if inst.components.pickable:CanBePicked() then local percent = 0 if inst.components.pickable then percent = inst.components.pickable.cycles_left / inst.components.pickable.max_cycles end if percent >= .9 then return "berriesmost" elseif percent >= .33 then return "berriesmore" else return "berries" end else if inst.components.pickable:IsBarren() then return "idle_dead" else return "idle" end end end return "idle"end Link to comment https://forums.kleientertainment.com/forums/topic/36515-i-want-to-tweak-berry-bush-help-please/ Share on other sites More sharing options...
squeek Posted May 16, 2014 Share Posted May 16, 2014 (edited) Put this in modmain.lua:local function MakeBerryBushGiveMoreBerries(inst) inst.components.pickable.numtoharvest = 3endAddPrefabPostInit("berrybush", MakeBerryBushGiveMoreBerries)AddPrefabPostInit("berrybush2", MakeBerryBushGiveMoreBerries) Edited May 16, 2014 by squeek Link to comment https://forums.kleientertainment.com/forums/topic/36515-i-want-to-tweak-berry-bush-help-please/#findComment-482251 Share on other sites More sharing options...
julz1981 Posted May 16, 2014 Author Share Posted May 16, 2014 (edited) Put this in modmain.lua: local function MakeBerryBushGiveMoreBerries(inst) inst.components.pickable.numtoharvest = 3endAddPrefabPostInit("berrybush", MakeBerryBushGiveMoreBerries)AddPrefabPostInit("berrybush2", MakeBerryBushGiveMoreBerries)Thank you kind sir XD edit: should i just create a new ''modmain.lua'' in the mods folder? because there is no ''modmain.lua'' in the main folder, but i have a different ''modmain.lua'' for all mods edit2: i tried creating a modmain.lua in the mods folder and it does not work, i'm such a newb at modding lol Edited May 16, 2014 by julz1981 Link to comment https://forums.kleientertainment.com/forums/topic/36515-i-want-to-tweak-berry-bush-help-please/#findComment-482257 Share on other sites More sharing options...
squeek Posted May 16, 2014 Share Posted May 16, 2014 You're making a new mod, so create a new folder in the mods folder and add your modmain.lua to that. Link to comment https://forums.kleientertainment.com/forums/topic/36515-i-want-to-tweak-berry-bush-help-please/#findComment-482263 Share on other sites More sharing options...
julz1981 Posted May 17, 2014 Author Share Posted May 17, 2014 You're making a new mod, so create a new folder in the mods folder and add your modmain.lua to that.i'm only tweaking files in scripts, i don't have any clue how to make a mod lol Link to comment https://forums.kleientertainment.com/forums/topic/36515-i-want-to-tweak-berry-bush-help-please/#findComment-482578 Share on other sites More sharing options...
squeek Posted May 17, 2014 Share Posted May 17, 2014 (edited) i'm only tweaking files in scripts, i don't have any clue how to make a mod lolYou shouldn't tweak game scripts, as any changes have a high likelihood of being overwritten/lost whenever the game updates. My post that you just quoted is literally all you need to do to make a mod (create a folder in mods called anything, create a modmain.lua inside that folder). Edited May 17, 2014 by squeek Link to comment https://forums.kleientertainment.com/forums/topic/36515-i-want-to-tweak-berry-bush-help-please/#findComment-482620 Share on other sites More sharing options...
julz1981 Posted May 17, 2014 Author Share Posted May 17, 2014 (edited) You shouldn't tweak game scripts, as any changes have a high likelihood of being overwritten/lost whenever the game updates. My post that you just quoted is literally all you need to do to make a mod (create a folder in mods called anything, create a modmain.lua inside that folder).I just did that, I created a folder named more berries, and put a txt file that i renamed modmain.lua with the text you sent me, then i activated the mod and it didn't do a thing. ''it said mod out of date'' do i need to add something else? ''i play with RoG'' I did tweak some scripts 3 months ago and it didn't change as of yet. thanks for letting me know, i'll make backup of those, in case. Edited May 17, 2014 by julz1981 Link to comment https://forums.kleientertainment.com/forums/topic/36515-i-want-to-tweak-berry-bush-help-please/#findComment-482626 Share on other sites More sharing options...
Mutation142 Posted May 17, 2014 Share Posted May 17, 2014 Interesting, I have been working on a similar change to the berry bush, as my first attempt at mod creation. I'm not 100% sure, but you also need a modinfo.lua in the folder along with the modmain.lua. you can look at another mods modinfo to see what fields to change. One of the fields is version. Link to comment https://forums.kleientertainment.com/forums/topic/36515-i-want-to-tweak-berry-bush-help-please/#findComment-482812 Share on other sites More sharing options...
julz1981 Posted May 18, 2014 Author Share Posted May 18, 2014 Interesting, I have been working on a similar change to the berry bush, as my first attempt at mod creation.I'm not 100% sure, but you also need a modinfo.lua in the folder along with the modmain.lua. you can look at another mods modinfo to see what fields to change. One of the fields is version.Thanks for the reply, but i really don't have a clue how to mod so i guess i will just forget about it. Link to comment https://forums.kleientertainment.com/forums/topic/36515-i-want-to-tweak-berry-bush-help-please/#findComment-483364 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