Jump to content

Recommended Posts

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

 

gardensystem.png

 

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

Share this post


Link to post
Share on other sites

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 by Cidiomar

Share this post


Link to post
Share on other sites

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

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

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 by eshra

Share this post


Link to post
Share on other sites

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 by harvard1932

Share this post


Link to post
Share on other sites

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

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 by Reactive Owl

Share this post


Link to post
Share on other sites
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
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 by Reactive Owl

Share this post


Link to post
Share on other sites

Okay, I will be a thread nechromancer here, but this shoulnd't really be an issue, right? =)

 

I am getting this error here.:

 

 J633ogd.png

 

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×