RPG Maker XP

RPG Maker XP

Growing Crops
Can someone help me on how to make a script to grow crops in my game. I got as far as making a graphic event where you could plant seeds, but, I need to know how to use time to set up a certain amount of time has passed before a new script+graphic show up for the crop to be harvested. If anyone can tell me how I can do this, it would be most helpful...
< >
Showing 1-4 of 4 comments
Einzelmais May 23, 2019 @ 12:21pm 
I've been thinking about making such a script for a while but don't have the time to do so. Anyway, working with real time in XP isn't easy but it's possible. I guess, you want to let your crops grow day by day and I have some ideas on how to make it mostly handled through game events but you will definetly need additional coding. If you really want to rely on real time (like a carrot - a minute, a potato - three minutes) you will definetly a script for multiple timers. Actually... now that I think of it, it's not that hard... So tell me what exactly are you looking for?
danjohnson_121984 May 24, 2019 @ 9:55pm 
I could do it either way, by day by day or with minutes and so forth. Im not that great at coding except for the built in stuff, but, im always willing to learn. I need to make a system too that handles so many minutes in a day and so forth. I trying to make a medieval life sim with minimal combat and no levels other than leveling up certain skills like for example Blacksmithing, Mining, Leatherworking, etc. Any help on any of this from you or anyone else would be greatly appreciated...

Thanks.
Einzelmais May 27, 2019 @ 12:41pm 
I see... I have a realtime script with so and so minutes per day, random weather etc but that's really unstable xD

You will need a hell load of scripting for that.
First of all you need a main class to programm in ("Game_Clock" or something like that). It probably needs an initialize method and definitely an update method. Let's say you have 24 hours per day and one hour equals one ingame minute. If you save your time information in game variables, you can easily use them in game events. Also note that XP runs with 30fps but the intern script runs with 60fps. It should look somehow like this:

class Game_Clock
def initialize
@counter = 0
@minute_id = 1
@hour_id = 2
@hours_per_day = 24
end

def update
@counter += 1
if @counter == 60 # Frames
@counter = 0
$game_variables[@minute_id] += 1
if $game_variables[@minute_id] == 60 # Seconds
$game_variables[@minute_id] = 0
$game_variables[@hour_id] = $game_variables[@hour_id] + 1 % @hours_per_day
end
end
end
end

I suggest you declare a clock object inside of the Game_Map class, so your clock will automatically pause in the menu etc. Just put "@clock = Game_Clock.new" (or whatever your class is called) in the initialize method of Game_Map and then "@clock.update" somewhere in the update method of Game_Map (somewhere under the first loop). So now you have your basis but it will get really complicated.

PS: I have no idea how to layout this correctly in a steam comment, sorry qwq
Last edited by Einzelmais; May 28, 2019 @ 11:44am
danjohnson_121984 May 28, 2019 @ 6:30am 
Thanks. Sounds interesting and complicated but Ill figure it out... Thanks again.
< >
Showing 1-4 of 4 comments
Per page: 1530 50

Date Posted: May 21, 2019 @ 8:58pm
Posts: 4