Helen1701

Veteran
Veteran
Joined
Sep 5, 2021
Messages
43
Reaction score
20
First Language
English
Primarily Uses
N/A
Farming seems pretty popular in a lot of games (I used to play farmville, you can farm some things on animal crossing, and it's a necessary part of minecraft too), I'm thinking of perhaps adding something like that as a sideline for the player to farm goods and sell them for gold. I am planning to make the graphics for the seeds, seeds in the soil, plant partially grown, and finally, plant fully grown and harvestable. Is it possible to do this by using events?

I'm thinking of adding a fishing rod to items too, and a small list of four possible fish to get (each one a different colour which sells for different prices, obviously the high value ones are going to be rarer than low value ones).

Has anyone else been able to add farming and/or fishing to their game?
 

Nolonar

Veteran
Veteran
Joined
Feb 18, 2018
Messages
276
Reaction score
377
First Language
French, German
Primarily Uses
RMMZ
I've never done it, but I can think of ways to do it.


Fishing is likely going to be the simplest of both, so let's start with that one.

You can easily implement fishing with events only. Simply create events in spots where the player is allowed to fish, check if the player has a rod, and reward them with whatever fish you think is appropriate for the current location.

If you want to allow the player to fish anywhere there's water (especially if your player can travel on water and is allowed to fish at the same time), you'll probably need to know how to code in Ruby (unless you're fine with covering your maps with fishing events, or designing maps with very little water). I'd recommend making sure that all your tilesets use the same tiles for water, so you can more easily check if the tile in front of the player is a water tile or not. Not all animated tiles are necessarily water. They can be lava or poison too.

Once you've allowed the player to fish anywhere, determining which fish they can get becomes more challenging. In MV/MZ, there are so-called "regions". You can simply mark bodies of water with regions, and have each region represent a different fishing reward pool. In fact, you could probably use regions to determine if the player is facing water by checking if the tile is marked with a fishing region, making the previous paragraph easier to deal with. That'd give you more flexibility regarding your tileset, and even allow you to easily create "weird" fishing spots, such as fish bowls and aquariums. Unfortunately, I'm not sure if VX Ace has regions or not.


Farming is going to be quite a bit more challenging.

With events only, the simplest would be to only allow the player to plant seeds at predefined places, by putting events where the player can farm. These events will change appearance over time, and will finally allow you to harvest your plant.

You will need a common event for the clock. The clock common event will periodically increase a variable, which will represent time. You will also need an extra variable for each plant event. The plant event will take the current time, add to it, and save the result to its own variable. Once the time variable reaches that value, you know enough time has passed for the plant to be harvestable.

If you want to allow the player to plant anywhere, it'll be easier to define a maximum amount of seeds per map and create as many plant events per map. You'll then need an additional common event that'll move the plant events to where they need to be, as well as all the necessary variables for each event. For example, you'll need variables to remember the location of each plant event, when they were planted (or when they can be harvested), which seed was used, and depending on how complex you want the farming system to be, whether it's been watered, etc.

Personally, I'd use Ruby for that, as it'll save you a ton of time and effort. I don't know about Ruby specifically, but JavaScript (MV/MZ) would allow you to abuse the Self Switch system to implement a very rudimentary Self Variable system, which would greatly reduce the time and effort needed to implement a farming system.

If you want to use the real time for your plants, similar to Animal Crossing, you won't need the clock common event, but you'll need Ruby instead. When sowing the seed, you'll need to retrieve the value of the RTC (Real Time Clock) instead. The RTC is always running, even when the PC is turned off and not powered on (there's a tiny battery on every PC mainboard that ensures the RTC remains powered on at all times). Unlike the clock common event, which you might only update once every second or so, the RTC will have a far higher resolution, commonly ranging in the nanosecond-millisecond range.



Unfortunately, I don't have much experience with Ruby or VX Ace, so I won't be able to give you any more detailed help than that.
 

Helen1701

Veteran
Veteran
Joined
Sep 5, 2021
Messages
43
Reaction score
20
First Language
English
Primarily Uses
N/A
Well, sadly I don't know any ruby, so it is something I'd have to learn. I was thinking of a farming system similar to the one Minecraft has, but with perhaps a greater variety of seeds. I was also thinking of having the harvested plants to be items the player could either sell or use. For example, you could sell wheat for 10G, but alternatively, you could feed a cow and get a bottle of milk, which you could sell for 15G, or use the milk to make cheese, which sells for 20G, or use the wheat to make bread, which could sell for 15G. Basically, the more steps you took to process your harvested plants, the more money you get if you choose to sell. There is a cooker in the default tileset, perhaps I could add an event to that which would enable the various cooking options.

I'll have to do some experimenting to see what I am able to do with eventing only (at least until I am able to learn ruby). Having the farm in a designated part of the map isn't a bad idea. Maybe in a village which is dedicated to farming, where a farmer will sell you some land which you may then use any time. I might even make it so that you can buy additional areas of land, becoming increasingly expensive the more you buy, to the maximum of ten.

Now, as to the fishing thing, I don't mind covering some of my maps in events. I might have designated fishing spots where you can fish anywhere along the bank of a lake. My map is basically a big Island with several regions, and an archipelago containing a village and some other stuff on each individual Island. So I am likely not going to place events around the border of every land mass and river bank, but I don't mind the idea of making a few designated fishing areas. I might use the graphic for the water pond to represent a fishing area, that way it will be easily recognisable to the player for what it is. When they touch the pond graphic, they are transferred to the fishing map automatically. On the main world map, I might make it so you can fish, but only when you're stood on a pier. That will greatly reduce the number of fishing events I need to make, while making fishing easily accessible to the player.

To answer your curiosity, VX Ace does have a regions function, I will be using that at some point anyway to define which monsters may appear in which parts of the map.

In any case, thank you for your advice! It's all useful stuff, I'll just need to play around with things for a while until I have a system in place I am happy with.
 

ovate

tale
Veteran
Joined
Dec 16, 2016
Messages
894
Reaction score
1,526
First Language
English
Primarily Uses
N/A
VX Ace tutorial for Simple Farming System handled with Galv's Event Spawn Timer script and events
https://forums.rpgmakerweb.com/index.php?threads/simple-farming-system.18377/

Spoiler contains event images from the main thread.

Event1.png


Event2.png


Event3.png
 

Helen1701

Veteran
Veteran
Joined
Sep 5, 2021
Messages
43
Reaction score
20
First Language
English
Primarily Uses
N/A
Thanks for this, I will check it out :)
 

Latest Threads

Latest Profile Posts

Disk Check Plugin - Running on Linux:
RMMV-Game-Mint.png
workin on some graphics for my game. was originally planning on doing a cartoony style for the town but I might stick with this instead
I'm so annoyed with myself...I can't get this code to work so it looks like I'm going the plugin route for a problem I should be able to do myself :kaolivid:Great. Now I get to murder save file compatibility. Again.
Can't believe my code from four years ago is still working! Did some expansions, and...
1635194553179.png
In related news, I may have an update for my old Extra status window plugin ready. That is, once I manage to sit down and update the documentation... and the demo project... :kaoswt:

Forum statistics

Threads
116,079
Messages
1,095,574
Members
151,450
Latest member
Dankim633
Top