RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Farming [RPGXP] (resolved)

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 84
look at me! please... please?
This is my first post I'm new to rpgxp and it would be greatly appreciated if someone could help me out. i need to be able to plant a seed, water it, have it grow in a set time, and harvest it. I am not sure were to start here i've heard of t being done in events but i'm not sure how. thanks in advance for any suggestions
« Last Edit: January 08, 2009, 12:02:51 PM by cody478 »

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
I could make one for you. I will later. Maybe tonight :)

It isn't very hard.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Well, I guess the first thing to do would be to make an event item (or not) called seed.

1. Planting
I can imagine the planting in two pretty simple ways.

A. The first is to have the seed item be unuseable and have the planting handled through an event. For instance, this could mean that in areas where it is permissible to plant, you can put an event - when the hero presses enter, it will check if he has the item seed through a conditional branch, and it will then either say "You do not have any seeds" if the condition is failed or something like: "Would you like to plant a seed here?" if the condition succeeds. This, I believe, is the simplest way. However, if you want more freedom in where to plant the seed, then the next way might be best. With both ways, however, I would not suggest being able to plant more than 10 seeds in any given map. Well, that depends, I suppose. In any case, if this is the method you want, advance to 2.

B. Have the seed item be useable, and have it call a common event. In this common event, you would first need to check if the map is appropriate. You don't want to plant things in a cave. You then need to check if the X and Y positions are appropriate. You don't want to plant things on a tree. You will then need to set special events that have IDs common to all maps in which you can plant things. This is not very simple. I would suggest against this method. If you want more details, however, I can certainly go on.

2. Watering

When you have your special planting events set up (by either methods 1.A or 1.B), you should have a second page to them that is turned on when you plant your seeds. In this, you should check if the player has a watering can or whatever, and then give the option to water them. If you water them then that should be OK. You can then set a type of loop that disallows you from watering it for however long you want using wait frames. After several waterings, you can have it grow up.

3. Harvesting

Once it is grown up, it is a simple matter to harvest. Merely add another event page, and when the hero presses enter, have it give the option to harvest. If he chooses yes, then you can add the harvested item and then turn off all the related switches so that it reverts back to its initial setup.

*
Meet me in the middle
Rep:
Level 89
or left of the dial.
For frequently finding and reporting spam and spam botsSecret Santa 2012 Participant
But, he wants to be able to harvest it after a set period of time. I'll go muck around in RPG XP.

**
Rep:
Level 84
look at me! please... please?
thank you modern algebra that was very helpful, but yes my aim was to have it take a certain amount of time to grow (not quit sure how to do that [not much of a programmer]) but that is a great start thanks :epic:

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
I'm making the event system now. I'll post a link in here to the topic when I post it in XP event systems database.

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009



Hey MA, I hope you get around to seeing this, cause I want to use this event system as an example for my question pertaining to lag. How do you think the lag would differ from using a system how I set it up with the events being pretty much all over the place compared to where you suggested creating hot spots on the map in a single common event? It's kind of a battle of what creates more lag; a ton of conditional branches or a ton of events?





*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Well the problem with the "hotspots" is that they can never make less lag than the other method, because they need the con. branches, but they also need at least as many events as the other way, since while the plant is growing it needs a graphical component, so the maker needs to create an event for the plant in addition to the conditional branches. So there's just as many events either way, and likely more with the "hotspots". It's also a much bigger pain - since it is controlled through a common event, each map would have to have its own variable, and further all planting events would have to have the same ID. What it comes down to is if the added functionality. Is the ability to plant anywhere worth the cost? I think that (A) the hotspots would have to have some limit per map. So we should work with that. If they didn't have a limit, then you'd have to make as many events as there are potential plots, in which case you might as well do it the other way. Once you have a limit though, then the lag caused will not be that significantly more. I mean, you can retrieve the coordinates by just getting the Player's X and Y. If you're smart and just plant it underneath the player instead of in front of, then there would likely not be any lag. If you plant in front then you will have to condition to make sure it is a passable spot. Also, whatever lag is cause by the common event is caused only once when you first select it. Extra lag, in general, will really only come from the events - so that method's extra lag comes from whatever you set the limit to be.
« Last Edit: January 10, 2009, 07:34:26 PM by Modern Algebra »