Notice: fwrite(): Write of 44 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 8192 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 2000 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96
Farming [RPGXP] (resolved)
Main Menu
  • Welcome to The RPG Maker Resource Kit.

Farming [RPGXP] (resolved)

Started by cody478, January 08, 2009, 12:50:10 AM

0 Members and 1 Guest are viewing this topic.

cody478

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

Grafikal

I could make one for you. I will later. Maybe tonight :)

It isn't very hard.

modern algebra

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.

firerain

But, he wants to be able to harvest it after a set period of time. I'll go muck around in RPG XP.

cody478

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:

Grafikal

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.

Grafikal


Grafikal





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?






modern algebra

#8
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.