eshra 54 Posted December 4, 2012 Introduction The base for a gardening/ farming system. Features - Plant seeds anywhere or specify where they can be planted with terrain tags. - Fertilize seeds - Water seeds - Cyclic plant behavior - Harvesting - Use skills to plant seeds - Plants can have up to 1 million growth stages - Erosion Screenshots How to Use Everything is explained in the documentation and the demo. This explains how to set up a very simple plant (for the full features you'll need to read the documentation or look at the demo) Script + Demo Get it from this site so I don't have to run around updating links everywhere when I'm fixing bugs. Credit and Thanks - Tsukihime - Celianna Author's Notes 7 Share this post Link to post Share on other sites
Sievn 4 Posted December 4, 2012 May I suggest that Rains would allow the Planets to grow? or maybe a climate system that farms? 1 Share this post Link to post Share on other sites
eshra 54 Posted December 4, 2012 Uh yeah that's a great Idea actually I guess I should implement some kind of climate system, would be fun but might take some time to design. Share this post Link to post Share on other sites
Cidiomar 39 Posted December 4, 2012 (edited) Just some tips: Optional arguments: def self.plant_seed(*args) item = args[0] plant_id = args[1] # the unique plant id this event is associated with planting = args[2] opts = (t = args[3]) ? t : {} # optional pos = (t = args[4]) ? t : 0 # optional stage = (t = args[5]) ? t : 1 # optional def self.plant_seed(item, plant_id, planting, opts = {}, pos = 0, stage = 1) You can use 'or equal' instead of inline ifs: t[:max_fertile] = (tmp = t[:max_fertile]) ? tmp : item.seed_max_fertillizer t[:grow_frames] = (tmp = t[:grow_frames]) ? tmp : item.seed_rate t[:loop] = (tmp = t[:loop]) ? tmp : item.seed_loop t[:loop_stage] = (tmp = t[:loop_stage]) ? tmp : item.loop_stage t[:fertile_effect] = (tmp = t[:fertile_effect]) ? tmp : item.fertile_effect[/background][/color] t[:max_fertile] ||= item.seed_max_fertillizer t[:grow_frames] ||= item.seed_rate t[:loop] ||= item.seed_loop t[:loop_stage] ||= item.loop_stage t[:fertile_effect] ||= item.fertile_effect Use #upto instead of Range#each: def number_stages_not_watered_optimally count = 0 optimal_water_per_st = optimal_water (1...last_stage).each{ |st| count += 1 if times_watered(st) != optimal_water_per_st } count end def number_stages_not_watered_optimally count = 0 optimal_water_per_st = optimal_water 1.upto(last_stage - 1) do |st| count += 1 if times_watered(st) != optimal_water_per_st end count end Edited December 4, 2012 by Cidiomar 1 Share this post Link to post Share on other sites
eshra 54 Posted December 4, 2012 Wow I am honored to have you commenting on my code Cidiomar ty Share this post Link to post Share on other sites
TheFaceless 6 Posted December 4, 2012 I must say I may most likely be using this in my game as a main method of making money and obtaining rare and important materials. Thanks for the awesome script! This is perfect for harvest moon/Rune Factory type RPGs Share this post Link to post Share on other sites
LBQ 0 Posted December 4, 2012 Looking for this since last year! Although I have already created one by events, I decide to use yours! Share this post Link to post Share on other sites
eshra 54 Posted December 4, 2012 I must say I may most likely be using this in my game as a main method of making money and obtaining rare and important materials. Thanks for the awesome script! This is perfect for harvest moon/Rune Factory type RPGs Looking for this since last year! Although I have already created one by events, I decide to use yours! Np glad to hear Share this post Link to post Share on other sites
harvard1932 1 Posted December 5, 2012 (edited) the script crashes if an event moves randomly though. Even on demo version Edited December 5, 2012 by harvard1932 Share this post Link to post Share on other sites
eshra 54 Posted December 5, 2012 (edited) the script crashes if an event moves randomly though. Even on demo version Ah, thank you. It was a careless mistake I made. Should work now. Edited December 5, 2012 by eshra Share this post Link to post Share on other sites
eshra 54 Posted December 5, 2012 (edited) double post... laggy Edited December 5, 2012 by eshra Share this post Link to post Share on other sites
harvard1932 1 Posted December 6, 2012 Error : Line 1315: NoMethodError occured. undefined method ‘keys’ for nil:NilClass†sometimes crash the game Share this post Link to post Share on other sites
eshra 54 Posted December 6, 2012 (edited) Can you be slightly more specific as to what you were doing just before the crash? I can't figure out how that error would happen just looking at my code. I don't think the problem is with my script. Add in this line: @garden_fertillizer ||= {} in between lines 1315 and 1314 if you want to fix the error though. Be sure you can reproduce the problem in an empty project with only this script (also what other scripts are you using? I'm interested in verifying this). Just from looking at my code it looks like you have another script that is not properly aliasing the initialize method inside Game_System or is overwriting it. Edited December 6, 2012 by eshra Share this post Link to post Share on other sites
harvard1932 1 Posted December 7, 2012 (edited) I use many other scripts that modifies the database. For some reason I am getting a different error when I try use inventory... Full script line 2035L No method error occured undefined method 'clear_crops?" for<Hand Axe>:Game_Weapon.... it 100% happens when in your demo. you give the character a weapon. and when you get to weapon tab... it give this error. Edited December 7, 2012 by harvard1932 Share this post Link to post Share on other sites
eshra 54 Posted December 7, 2012 (edited) Thanks again Harvard, I've updated the links with the fix. Sorry for the trouble, thought I had gotten most of the bugs in this one. Edited December 7, 2012 by eshra Share this post Link to post Share on other sites
harvard1932 1 Posted December 8, 2012 (edited) I am wondering if there will be randomized harvesting :P/>/> like wheat seed harvest can give 1-10 wheat, etc. Edited December 8, 2012 by harvard1932 Share this post Link to post Share on other sites
GreatswordGames 2 Posted December 8, 2012 I have tsuki's Custom Data Manger but it says I don't? Share this post Link to post Share on other sites
eshra 54 Posted December 9, 2012 I have tsuki's Custom Data Manger but it says I don't? Make sure tsuki Custom Data Manager is above the garden system script. If it is and you're still getting the problem, pull the custom dm from the demo. I am wondering if there will be randomized harvesting :P/>/> like wheat seed harvest can give 1-10 wheat, etc. I've added this functionality, links updated. You can now specify a range based on the base harvest amount with this notetag: <seed harvest VALUE - VALUE> replace "VALUE" with an integer. Share this post Link to post Share on other sites
Reactive Owl 22 Posted January 2, 2013 (edited) this script makes it possible to place anything into the world! aside from just plants! the seed map essentially becomes an Event Cache. I made a fully functional "Workbench" item that I can place and then use to craft things... Edited January 2, 2013 by Reactive Owl Share this post Link to post Share on other sites
eshra 54 Posted January 11, 2013 this script makes it possible to place anything into the world! aside from just plants! the seed map essentially becomes an Event Cache.I made a fully functional "Workbench" item that I can place and then use to craft things... I'd probably just use the event reproducer in that case, it's included in the demo. Share this post Link to post Share on other sites
Reactive Owl 22 Posted January 11, 2013 (edited) this script makes it possible to place anything into the world! aside from just plants! the seed map essentially becomes an Event Cache.I made a fully functional "Workbench" item that I can place and then use to craft things... I'd probably just use the event reproducer in that case, it's included in the demo. oh...that makes more sense Edited January 11, 2013 by Reactive Owl Share this post Link to post Share on other sites
luiscesjr 0 Posted December 3, 2014 Okay, I will be a thread nechromancer here, but this shoulnd't really be an issue, right? =) I am getting this error here.: And what I am doing? Nothing! There simply is a moving route going on, on a scene, and the character moves>talks and when he is about to move again, this error pops up. Everytime, same place. Any ideas? Tried to look into the script myself, but it was a no go... I Will try in other different map areas, who knows... Thanks in advance! Share this post Link to post Share on other sites
luiscesjr 0 Posted December 14, 2014 Bump Anyone? This is what the console writes to the screen...: Share this post Link to post Share on other sites
Tandinos 0 Posted December 27, 2014 how you doing, For some reason now when I harvest crops grown using this script, it won't pop up with the text saying how much "wheat" I've acquired as it does in the demo used to do for me, may be another script over writing it ? if so how can I set a message to display when I have acquired x "wheat" Share this post Link to post Share on other sites
+ DarthVollis 59 Posted December 29, 2014 Try it in a new project and see if you get the same problem. Share this post Link to post Share on other sites