Joined
Sep 16, 2013
Messages
30
Reaction score
12
First Language
English
Primarily Uses
Introduction

For years trends in gaming and patterns have become evident, one of the big examples is the use of zombie specific elements, even as mini games just to add that element into your game and appeal to fans of the genre. One of the current, and very popular styles of game / mini game present in most games is the farming element or system. This tutorial will teach you how to make a basic farming system for your own RPG Maker VX Ace games.

What you need

Knowledge of Eventing

Galv's Event Spawn Timer

Graphic of a Seed

Graphic of a Vegetable

Graphic of a Dirt Patch

Graphic of a Dirt Patch with seed growing

Graphic of a Dirt Patch with vegetable grown

(If your only using this in a personal non-commercial game, Celianna's Parallax Tiles offer some great farming graphics)

Special Thanks

Galv - For his Event Spawn Timer Script.

Celianna - For her awesome Tileset.

How it's done

After installing the script under Materials and above Main, importing the graphics into you RPG Maker game and going through the basic setup of a map, you are ready to set up a basic system. I will only cover the basics in the "How it's done" section, for more detailed analysis of each piece, look at the "How it works" section.

You will need to set up items for the seed as well as the vegetable and place a seed into your inventory before you even start on the map.
 

You will need to add a tile on your map of the dirt patch where it is possible to farm and then set an event on top of it. This event will be a 3 page event and I will go through each step with you.

On the first event page, you want to leave your graphic empty (or use a dirt patch/tilled dirt patch). This event should have no conditions ticked and it's trigger should be set to Action Button. You want the contents to be as follows:

[IMG]http://i429.photobucket.com/albums/qq18/DarrellLeon/Event1.png?t=1379959053[/IMG]
In place of Potion you would use your previously defined seed item and within the script call:

Script: set_spawn(0,0,5)you will want to replace the 5 with how ever many seconds you wish the plant to take before it grows. This is entirely up to you, the more seconds it takes, the longer the plant will take to grow.

The second page of the event should be set up like this:

[IMG]http://i429.photobucket.com/albums/qq18/DarrellLeon/Event2.png?t=1379959050[/IMG]
You'll want to use your seeds or part grown plant as a graphic in this slot.

It's very important that the Move Route type is set to Custom as this handles going on to the next frame once our timer is complete. Click the Move Route button and set it to a script call, placing the following code in:

do_respawn?("B",true)Then we are ready to move onto our third event page:

[IMG]http://i429.photobucket.com/albums/qq18/DarrellLeon/Event3.png?t=1379959046[/IMG]
Replace the graphic with that of your fully grown vegetable and replace hi-potion with the vegetable item you defined earlier and then you will have a working basic farming system with more than enough flexibility to make it as advanced as you want.

If you haven't fully understood this or want to know how it works, read further down.

How it works

In this section I'm going to take you step by step through how it works and ways to make the system more advanced should you choose it.

In Event Page 1, we are displaying a choice and that choice has two possible selections, they are Plant Crop or Leave it. If the player's input is Leave it then the game will simply cancel out of the event and your dirt patch left alone but if you select Plant Crop then a conditional branch is opened. The conditional branch is searching your inventory to see if you have any seeds available, if you do not then it will tell you so and cancel out the same as before but if you do then it will remove one seed from your inventory and start the Event Respawn Timer activating the Self Switch A.

In Event Page 2, our event is triggered by Self Switch A being activated automatically making this the current event when you press the action button. When used by the user it'll simply say that your crop is growing and the player must wait. Within the Move Route, there is a script call doing a very important task. The code detects when the Event Respawn Timer is active and sets self switch B to true.

In Event Page 3, our event is triggered by Self Switch B so our crop will become fully grown once the timer is done. When the player presses on the crop it will tell them it has grown and give the two choices again, either they can Harvest it or they can Leave it. Once more if you Leave it then nothing will happen and it will remain there but if harvested we are adding the grown crop to our inventory using the item we made and then switching both Self Switch A and B off allowing the event to return to Event Page 1.

The reason this so flexible in it's design is because of the simplicity behind it. You could add more growth stages in by repeating Event Page 2 and placing a second timer in (though you'd have to activate the second growth by setting it as a parallel process opposed to a action button event) and adding on more Self Switches. You could implement a watering system where the plant won't go to the next stage of growth unless you water it using choices. You can even activate crops from another map using a separate event. The system is endless and free for you to play and experiment with.

Why this method?

A very understandable question to ask is why use this method? Well you don't have to, that is entirely your own choice but I personally like this approach because of it's flexibility in use.

I would also advise this method because unlike waits, and most timers, Galv's system allows the player to freely move to any map they want without interrupting the timers, meaning that the growth of the plant will continue, even if your out adventuring on another map making it perfect for any system that uses farming not as the primary element in the game.

I hope you have enjoyed reading this tutorial as much as I enjoyed making it and it comes in handy for anyone who was looking for a basic method of making a farming system.
 

Abagail Asta

Programer by birth
Veteran
Joined
Oct 21, 2013
Messages
33
Reaction score
35
First Language
Russian
Primarily Uses
Thank you very much
 
Last edited by a moderator:

DoNgocNhan

Villager
Member
Joined
Nov 24, 2013
Messages
7
Reaction score
13
First Language
Vietnamese
Primarily Uses
We can make a farming system with use only event and don't need script. But if you use script, you can do your farming system with little develope time. Thanks for the tutorial ! Very useful !  BD
 

Sylevar

Villager
Member
Joined
Jan 10, 2014
Messages
8
Reaction score
0
First Language
English
Primarily Uses
What if a person wants to use this method with Galv's Use Items On Event's Script?  Would this be possible?  I ask because I am presently using the Use Items on Events Script and am trying to set up a farming event.  My biggest problem is that it's not reading which seed is being planted (in the case where multiple seeds are planted across multiple plots) like it should.  It's making all of them just 1 type when they grow.

Let me know if this is do-able and if so, how you think one might go about doing it.
 

dikkedrol12

Warper
Member
Joined
Jan 16, 2014
Messages
1
Reaction score
0
First Language
dutch
Primarily Uses
hi, great script but i'm having a problem...

the timer does not seems to work, when i plant the seed it's ready on the spot without any waiting time...

i have triple checked all the steps but can't seem to find where i go wrong....

any commen problems which might be the problem?

EDIT: im such a derp....i forgot self switch B in eventpage 3 :'-) :/
 
Last edited by a moderator:
Joined
Sep 16, 2013
Messages
30
Reaction score
12
First Language
English
Primarily Uses
Firstly I'd like to apologise for my late replies, I've been out of the country until the beginning of this week so I've been otherwise engaged the last few months. Now I'm back, I can return to the development of my own game but also help other aspiring developers with theirs so without further a do, to my replies:

Thank you very much
You are most welcome, I am glad I could be of some help.

We can make a farming system with use only event and don't need script. But if you use script, you can do your farming system with little develope time. Thanks for the tutorial ! Very useful !  BD
It is possible to develop a farming system through pure eventing but if farming on a large scale, this can get rather messy and even sometimes laggy on older systems due to the mass of simultaneous events running. Plus in base coding, the events will not run unless the character remains on the same map the events are on. This tutorial gives you a way to allow the crops to grow even while traversing other maps in your game world and to then come back to fully grown crops as well as an easy way to plug multiple other systems into it and develop it further. I'm glad you liked it and hope that you develop it to suit whatever needs you had in mind.  ;)

What if a person wants to use this method with Galv's Use Items On Event's Script?  Would this be possible?  I ask because I am presently using the Use Items on Events Script and am trying to set up a farming event.  My biggest problem is that it's not reading which seed is being planted (in the case where multiple seeds are planted across multiple plots) like it should.  It's making all of them just 1 type when they grow.

Let me know if this is do-able and if so, how you think one might go about doing it.
Yes, that is very possible and if you are looking to develop the system further would most definitely be recommended. The idea of this tutorial is to show a basic farming system that any user can plug and develop into the system that they need. Using Galv's Use Items On Event's Script, you could set multiple seeds across multiple plots in the same manner but you can also even add in tools such as hoes, fertaliser and water bottles to interact with the crops and effect how they grow if you are willing to take the time to develop it.

Without seeing what you have done so far, the most likely things that would cause all plots to grow the same type of plant regardless of what is planted would be:

  • Conditional Branches set up incorrectly.
  • Plots share the same ID.
  • Scripts set up incorrectly.
My suggestion would be to fully go over what you have put in, ensure that each plot has an individual name and ID, ensure you have both scripts working individually of each other, then together and ensure all your conditional branches are set up to handle different events dependent on what seed is planted. Remember different seeds need to take a different path if it is to bear different fruit.

Good luck!

hi, great script but i'm having a problem...

the timer does not seems to work, when i plant the seed it's ready on the spot without any waiting time...

i have triple checked all the steps but can't seem to find where i go wrong....

any commen problems which might be the problem?

EDIT: im such a derp....i forgot self switch B in eventpage 3 :'-) :/
Haha, I'm glad you're enjoying this tutorial and were able to fix the problem without my help. It happens to everyone from time to time, I've lost count of the amount of times I've wrote my own scripts and the entire thing has imploded just because I forgot to put a comma somewhere.  :guffaw:
 

JapoZero

Veteran
Veteran
Joined
Mar 25, 2013
Messages
34
Reaction score
39
First Language
Spanish
Primarily Uses
RMMV
Thanks for the tutorial! I used it with More Self Switches and I have eight things to farm in my game.

It works very well. Like~
 

Moonpig13

Warper
Member
Joined
May 30, 2014
Messages
4
Reaction score
0
First Language
English
Primarily Uses
nvm got it to work, but now i have a different question. Do you know how to make it so u can plant any kind of seed in any farmland to grow anything in it instead of having a farmland that can you can only plant carrots here and tomatoes here?
 
Last edited by a moderator:

Fallun

Villager
Member
Joined
May 24, 2014
Messages
26
Reaction score
1
First Language
Danish
Primarily Uses
Thanks very usefull! :D
 

Ralpf

Veteran
Veteran
Joined
Jun 5, 2014
Messages
590
Reaction score
153
First Language
English
nvm got it to work, but now i have a different question. Do you know how to make it so u can plant any kind of seed in any farmland to grow anything in it instead of having a farmland that can you can only plant carrots here and tomatoes here?
I'm running into the same issue, so far the simplest method I have come up with involves 660 switches.....Hoping to find another way to do it. lol
 
Joined
Sep 16, 2013
Messages
30
Reaction score
12
First Language
English
Primarily Uses
Firstly I'd like to apologise for taking so long to reply to these questions as I have been away from the forums for most of this year, sadly work has dominated my time and the need for money has outweighed my desire to code leaving me little time to myself.

nvm got it to work, but now i have a different question. Do you know how to make it so u can plant any kind of seed in any farmland to grow anything in it instead of having a farmland that can you can only plant carrots here and tomatoes here?
I'm running into the same issue, so far the simplest method I have come up with involves 660 switches.....Hoping to find another way to do it. lol
As these are both basically the same question, I'll answer them in one. There are a number of ways you could set it up for a single square to allow multiple seeds but in the ideology of this tutorial being about simplicity, I will give you in my idea what the easiest method is to handle this functionality.

First ensure you have your seed items and crop items set up for however many items you wish to make, then when setting up your event make it so it shows choices with conditional branches dependent on what seed you select, this will show all the seeds you have in your game so there are more effective ways of doing it but for simplicity it allows a quick branching that can allow selection of different seeds.

More advanced users can use this and triggers to make all kinds of things like different timers dependent on the crop, etc but for basic simplicity we will just assign a unique variable the item we have placed, for example carrot is 1 so if they select carrot variable = 1, potato is 2 so if they select potato variable = 2. Once you've got this you just modify the end event of the crop so the item it gives back is dependent on variable using a conditional branch and hey presto, you've got a very basic multi-crop event.
 

Ralpf

Veteran
Veteran
Joined
Jun 5, 2014
Messages
590
Reaction score
153
First Language
English
Thanks for the answer, I actually forgot I even posted that though, lol.

It's still runs into the same problem...but not to the same extent with variables instead of switches... I hadn't really thought of using them like that.

I am going to stick with what I have working though, it will still take 500 switches (10 switches per plot, 8 for crops, one for whether it is watered, and another for when it is harvested) and another 100 variables (how long it has been growing, whether it is ploughed [should be a switch, but for some reason it wasn't working how I wanted it to, so I made it a variable that will only ever hold 0 or 1, same effect anyway]), but beyond that is really very simple (half of my events have nothing at all in the content sections, just conditions and because you can't have 2 variables in the conditions section [annoying] it would have to use more conditional branches). It's going to be time consuming and take some testing to make sure I didn't miss something, but not to the point I had initially thought it would when I posted that.

Though if I made one plant start the variable at 100 and counted up the days using that same variable and the next one 200....hmm...that could work. Gonna give that a shot.

Edit: Dude...that was so easy...just need to use 1 variable and 1 switch (watering really need to be switch as I see it to avoid potential problems) per plot, which means less that needs changing per plot...I don't think what I did is what you were trying to tell me, but you did somehow point me down the right path, so thanks again.
 
Last edited by a moderator:
Joined
Sep 16, 2013
Messages
30
Reaction score
12
First Language
English
Primarily Uses
Thanks for the answer, I actually forgot I even posted that though, lol.

It's still runs into the same problem...but not to the same extent with variables instead of switches... I hadn't really thought of using them like that.

I am going to stick with what I have working though, it will still take 500 switches (10 switches per plot, 8 for crops, one for whether it is watered, and another for when it is harvested) and another 100 variables (how long it has been growing, whether it is ploughed [should be a switch, but for some reason it wasn't working how I wanted it to, so I made it a variable that will only ever hold 0 or 1, same effect anyway]), but beyond that is really very simple (half of my events have nothing at all in the content sections, just conditions and because you can't have 2 variables in the conditions section [annoying] it would have to use more conditional branches). It's going to be time consuming and take some testing to make sure I didn't miss something, but not to the point I had initially thought it would when I posted that.

Though if I made one plant start the variable at 100 and counted up the days using that same variable and the next one 200....hmm...that could work. Gonna give that a shot.

Edit: Dude...that was so easy...just need to use 1 variable and 1 switch (watering really need to be switch as I see it to avoid potential problems) per plot, which means less that needs changing per plot...I don't think what I did is what you were trying to tell me, but you did somehow point me down the right path, so thanks again.
I'm glad you got it all figured out. The reason I made it so simple in design and instruction is there are a dozen possibilities to grow this in a number of ways and that is why I encourage people to do so. I actually use a lot of these same core base systems in my own game but I did mine entirely through scripting with an advanced system which ties it all together nicely but the beauty of this is that the system can be expanded, even without knowledge of scripting and is super friendly to anyone.

I'm glad you're finding this tutorial useful, solving your problems and happy game making!
 

Ralpf

Veteran
Veteran
Joined
Jun 5, 2014
Messages
590
Reaction score
153
First Language
English
I'm glad you got it all figured out. The reason I made it so simple in design and instruction is there are a dozen possibilities to grow this in a number of ways and that is why I encourage people to do so. I actually use a lot of these same core base systems in my own game but I did mine entirely through scripting with an advanced system which ties it all together nicely but the beauty of this is that the system can be expanded, even without knowledge of scripting and is super friendly to anyone.

I'm glad you're finding this tutorial useful, solving your problems and happy game making!
I actually didn't use your tutorial, I found this looking for general farming event help, I already had a lot of it set up (specifically time keeping so I didn't need Galv's script) I just was hoping to find a a way to make it easier to complete. Though your tutorial looks good at a glance, I didn't go through it but it looks simple enough to follow, and should be good for simple growth events, not just farming, other uses come to mind.

I just needed to get away from the method I envisioned when first started working on it, went through a lot of changes but never changed at it's core...needed my thought processes shaken up a bit.
 
Joined
Sep 16, 2013
Messages
30
Reaction score
12
First Language
English
Primarily Uses
Ah I see. Yeah, a lot of the scripts I am running are my own custom design as well but I unfortunately do not release my scripts to the public as a lot of them I am using in a commercial game I'm developing that I'm keeping under wraps for now. I also replaced Galv's script with my own timer devices and built on top of my own core concepts and took to scripting to deliver a much smoother system, overall, scripting is the way forward but for those who are not advanced enough to achieve that I think that this gives them a great opportunity to dip their feet into eventing and learn the core systems and how they are manipulated before dipping their feet into scripting and applying those same concepts to more advanced work.

Yeah, the system itself can be used for a massive range of things, I use my own alongside several systems that causes certain monsters to spawn at certain times of the day, certain events to happen around my game world on certain dates, certain weather conditions to happen in certain seasons, trees to grow, fish to respawn in lakes, ore to reappear in mines, shops to restock their items, and a number of other things that I can't mention without giving too much information away about my game but if applied correctly, one simple system such as a farming system with worldwide timers can be expanded to run almost an entire game system.

One of the hardest steps is having a vision in mind and moving from it, a lot of the things I designed in my concept papers were very differently imagined to how they have ended up but overall, a lot of my systems are smoother and I think bring the gameplay into a more well rounded feel overall. It's learning what you want and like, what your consumer base wants and likes, what is gonna sell and then finding the happy medium between all those gaps to deliver a well maintained, polished work of genious that could take the world by storm.

Good luck and happy game designing!
 

ZumataScream

Villager
Member
Joined
Feb 18, 2015
Messages
14
Reaction score
3
First Language
English
Primarily Uses
RMVXA
ATTENTION:

I've noticed that you must set move route to "repeat action" or otherwise it wouldn't *work*.  This stumped me for a while as I was unable to spawn correctly past the time limit, might want to give a warning to others using this engine.

Mmm, good post btw
 

larviform

Warper
Member
Joined
Jul 2, 2020
Messages
1
Reaction score
0
First Language
english
Primarily Uses
RMVXA
i get a game interpreter crash every time i try to call the event spawn timer script, is this script no longer functional?
 

RedRose190

Anna/Misty190
Veteran
Joined
Oct 9, 2018
Messages
100
Reaction score
47
First Language
Greek
Primarily Uses
RMVXA
Thank you very much! (guys pay attetion on the second page!
Click the Move Route button and set it to a script call
Don't make your own command in "Set Move Route"
 

Latest Threads

Latest Posts

Latest Profile Posts

Folks, if anyone sends you a message inviting you to add their API to your game, please report them. We don't want people spamming our members asking them to add stuff to their games for their own (or others') benefit.
I'm listening to iiluminaughtii talking about the secrets behind shady businesses and scams. Meanwhile I'm writing a fanfic about Sephiroth from FF7, one specifically for my stepmom. I'll get to give it to her, too, because my boss said I could take the holidays off! Dec. 22-27 I will be in Orlando, and maybe Fort Myers too, visiting my dad and stepmom!
Of course, I bought a handful of games on the Steam Black Friday sale. Will I try them? Will I complete any? Who knows...
I don't really have any neat updates today about how I screwed up programming... But if you want to observe the intensenes of me programming, then you can check out my stream :)
New Weapons.gif
No more spam from me today, I promise! Just wanted to upload this, people have been giving me feedback that my weapon sprites (which were RTP) clashed badly with my battlers for ages, so today I finally took the plunge and updated them! Really happy with how they came out :D :D

Forum statistics

Threads
117,007
Messages
1,103,781
Members
152,904
Latest member
gumi16
Top