RPG Maker MV

RPG Maker MV

smallmak 2019년 5월 10일 오후 6시 51분
farming system
how would I go about making a farming system like this https://www.youtube.com/watch?v=esveWlNWIys&list=WL&index=79&t=539s but instead of having the plant wait a number of frames before growning, having it wait a number of days. I am thinking of using Moghunters time system found here https://atelierrgss.wordpress.com/rmv-time-system/ or a time system I made using events and common events.
< >
전체 댓글 17개 중 1~15개 표시 중
Caethyril 2019년 5월 11일 오전 2시 30분 
It's a pretty long video so I haven't watched it, but I'm guessing you have a "grow" common event to increase all your crops' variables? In that case you could probably just set that "grow" event's trigger to None and call it from your time event, e.g. every time the game time updates? =)

Rather than growing the crops every time update, you could call it only when, e.g., the hours roll over to a new game day. That'll work, but will sync all growth variables to the current game day. This isn't necessarily a bad thing: it's the approach used in Stardew Valley, for example. Or you could increase the "time resolution" a bit by updating every game hour (or minute). Naturally, it's up to you how you implement things~ :cozyjunimogreen:
smallmak 2019년 5월 11일 오후 3시 29분 
Caethyril님이 먼저 게시:
It's a pretty long video so I haven't watched it, but I'm guessing you have a "grow" common event to increase all your crops' variables? In that case you could probably just set that "grow" event's trigger to None and call it from your time event, e.g. every time the game time updates? =)

Rather than growing the crops every time update, you could call it only when, e.g., the hours roll over to a new game day. That'll work, but will sync all growth variables to the current game day. This isn't necessarily a bad thing: it's the approach used in Stardew Valley, for example. Or you could increase the "time resolution" a bit by updating every game hour (or minute). Naturally, it's up to you how you implement things~ :cozyjunimogreen:

Could you give me an example of how I would go about this? specifically how I would call an event from my time event. My time system is very basic wait 60 frames add to the minutes variable, once minutes reaches 60 it resets and minutes to 0 and adds 1 to the hour variable etc.
here is my current farming set up in case you are interested. I inted to change it a lot once I figure out how to make it dependent on my time variables.

https://imgur.com/a/a5IId6t
https://imgur.com/a/NlIi5Ch
https://imgur.com/a/vSndDao
https://imgur.com/a/mEq9t89
Caethyril 2019년 5월 12일 오전 1시 15분 
What I had in mind was a single "grow" event for all plots, e.g.
◆Comment:Is plot 1 currently growing something? ◆If:Plot 1 Active is ON ◆Comment:Grow a little more, down towards zero ◆Control Variables:#0010 Plot 1 += Random 30..50 ◆Comment:+growth bonus from farming skill ◆Control Variables:#0010 Plot 1 += Farming Skill ◆Comment:Check for growth complete ◆If:Plot 1 ≥ 200 ◆Comment:Turn off "growing" switch, turn on "ready to harvest" switch ◆Control Switches:#0001 Plot 1 Active = OFF ◆Control Switches:#0100 Plot 1 Done = ON ◆ :End ◆ :End ◆Comment:Etc for other plots ◆If:Plot 2 Active is ON ◆ :End
If you put this in a common event with trigger None, you can then use the Common Event command to call it from any other event. So, you can have a single parallel common event for tracking/updating game time (as in your other thread) and just call the relevant update events, like this crop growth stuff, from there. Highly readable, not to mention much better performance-wise than having 100s of separate parallel events. ^_^

As for when to call it: you could call it at the end of your Time event, so it updates (like you say) every 60 frames. Or you could call it once per game hour by finding the branch where minutes roll over to hours and sticking it in there, e.g.
◆Comment:+1 to minutes ◆Control Variables:#0001 Minute += 1 ◆Comment:Check if new hour has arrived ◆If:Minutes ≥ 60 ◆Comment:Reset minutes, +1 to hours ◆Control Variables:#0001 Minute = 0 ◆Control Variables:#0002 Hour += 1 ◆Comment:Update crop growth ◆Common Event:Update Crops ◆Comment:...etc... ◆ :End
Also, a suggestion: you might want to consider setting the timer at the threshold to begin with, and counting down in the growth event rather than up. This'll let you easily set varying growth durations when you plant the seeds. =)

If you're still confused, hang on and I'll see if I can make a little time/weather/farming demo project for the Workshop~

[Edit: changed "Plot 1" variable condition in first example, whoops.]
Caethyril 님이 마지막으로 수정; 2019년 5월 12일 오전 6시 53분
smallmak 2019년 5월 12일 오전 3시 08분 
Caethyril님이 먼저 게시:
What I had in mind was a single "grow" event for all plots, e.g.
◆Comment:Is plot 1 currently growing something? ◆If:Plot 1 Active is ON ◆Comment:Grow a little more, down towards zero ◆Control Variables:#0010 Plot 1 += Random 30..50 ◆Comment:+growth bonus from farming skill ◆Control Variables:#0010 Plot 1 += Farming Skill ◆Comment:Check for growth complete ◆If:Plot 1 ≤ 0 ◆Comment:Turn off "growing" switch, turn on "ready to harvest" switch ◆Control Switches:#0001 Plot 1 Active = OFF ◆Control Switches:#0100 Plot 1 Done = ON ◆ :End ◆ :End ◆Comment:Etc for other plots ◆If:Plot 2 Active is ON ◆ :End
If you put this in a common event with trigger None, you can then use the Common Event command to call it from any other event. So, you can have a single parallel common event for tracking/updating game time (as in your other thread) and just call the relevant update events, like this crop growth stuff, from there. Highly readable, not to mention much better performance-wise than having 100s of separate parallel events. ^_^

As for when to call it: you could call it at the end of your Time event, so it updates (like you say) every 60 frames. Or you could call it once per game hour by finding the branch where minutes roll over to hours and sticking it in there, e.g.
◆Comment:+1 to minutes ◆Control Variables:#0001 Minute += 1 ◆Comment:Check if new hour has arrived ◆If:Minutes ≥ 60 ◆Comment:Reset minutes, +1 to hours ◆Control Variables:#0001 Minute = 0 ◆Control Variables:#0002 Hour += 1 ◆Comment:Update crop growth ◆Common Event:Update Crops ◆Comment:...etc... ◆ :End
Also, a suggestion: you might want to consider setting the timer at the threshold to begin with, and counting down in the growth event rather than up. This'll let you easily set varying growth durations when you plant the seeds. =)

If you're still confused, hang on and I'll see if I can make a little time/weather/farming demo project for the Workshop~

A workshop item would help so much :D
Caethyril 2019년 5월 13일 오후 2시 44분 
smallmak님이 먼저 게시:
A workshop item would help so much :D
OK, looks like I've got a functional, purely event-based time/weather/farming demo working, but the farming is pretty clunky & limited right now and I'm not sure how to improve it without plugins. Uploaded it anyway because why not? xP https://steamcommunity.com/sharedfiles/filedetails/?id=1740691264 I'm thinking about upgrading the farming stuff using two of Yanfly's plugins: Event Morpher[yanfly.moe] and Self Switches/Variables[yanfly.moe]. Morpher to turn farm plots into the appropriate crop event (making it easy to customise each crop's growth stages) and Self Variables so you don't have to use all those global variables with different references for each plot etc. Other than that the eventing/mechanics would be basically identical. =)

Lots of different ways to do this sort of stuff, too, so feel free to redo it in your own style if you like~ ^_^
Caethyril 님이 마지막으로 수정; 2019년 5월 13일 오후 2시 46분
smallmak 2019년 5월 13일 오후 3시 47분 
Caethyril님이 먼저 게시:
smallmak님이 먼저 게시:
A workshop item would help so much :D
OK, looks like I've got a functional, purely event-based time/weather/farming demo working, but the farming is pretty clunky & limited right now and I'm not sure how to improve it without plugins. Uploaded it anyway because why not? xP https://steamcommunity.com/sharedfiles/filedetails/?id=1740691264 I'm thinking about upgrading the farming stuff using two of Yanfly's plugins: Event Morpher[yanfly.moe] and Self Switches/Variables[yanfly.moe]. Morpher to turn farm plots into the appropriate crop event (making it easy to customise each crop's growth stages) and Self Variables so you don't have to use all those global variables with different references for each plot etc. Other than that the eventing/mechanics would be basically identical. =)

Lots of different ways to do this sort of stuff, too, so feel free to redo it in your own style if you like~ ^_^

This looks amazing I cant wait explore it! I'm actually already using SelfSwitches/Variables, I will have to download the Event Morpher.
Caethyril 2019년 5월 14일 오전 12시 00분 
smallmak님이 먼저 게시:
This looks amazing I cant wait explore it! I'm actually already using SelfSwitches/Variables, I will have to download the Event Morpher.
Hope it helps! If you have any questions, feel free to ask here or on the Workshop page. =)
smallmak 2019년 5월 14일 오전 7시 56분 
Hope it helps! If you have any questions, feel free to ask here or on the Workshop page. =) [/quote]

I tried copying what you did in my game and I managed to get it so I can plant the crops and they begin to grow but I am running into something strange and I can't figure out what is causing it. For some reason when the plants reach maturity they just disappear, I suspect this is because Under the "Harvest Crop" common event we set the crop id to 0 but I cant tell what you did differently than me. here are some picture of my events.

https://imgur.com/a/NOqXMl1
https://imgur.com/a/vo7z6kb
https://imgur.com/a/u5faVWA

Also I am not sure if this is relavent but I thought I better include it just incase. I tried changing the system a little bit to work with Moghunters time system https://atelierrgss.wordpress.com/rmv-time-system/ and to have the crops update daily rather than hourly so here are the related event for that.

Sleeping event https://imgur.com/a/PkbcAA5
time common event https://imgur.com/a/avIGNkL (you'll notice I only have the 1 thing in the time common event. I am trying to make it so if the player stays awake into the next day the crops will update even without them sleeping. (I also set the hour variable in mog hunters time system to 448.) )

smallmak 님이 마지막으로 수정; 2019년 5월 14일 오전 8시 13분
Caethyril 2019년 5월 14일 오전 9시 05분 
smallmak님이 먼저 게시:
For some reason when the plants reach maturity they just disappear, ...
When this happened to me when I was making it, it was because I'd made a mistake in the page conditions, referencing the Crop Time variable instead of Crop ID. >_< I double-checked my events and your screenshots, though, and it all looks OK as far as I can tell.

Are your plant sprites from the tileset or from character sprite sheets? If the latter, make sure you have Direction Fix ON (and Stepping OFF unless they're animated).

You could also press F9 during playtest to check the values of your variables, maybe something's going wrong somewhere with the value assignment.

Also I am not sure if this is relavent but I thought I better include it just incase. I tried changing the system a little bit to work with Moghunters time system https://atelierrgss.wordpress.com/rmv-time-system/ and to have the crops update daily rather than hourly so here are the related event for that.

Sleeping event https://imgur.com/a/PkbcAA5
time common event https://imgur.com/a/avIGNkL (you'll notice I only have the 1 thing in the time common event. I am trying to make it so if the player stays awake into the next day the crops will update even without them sleeping. (I also set the hour variable in mog hunters time system to 448.) )
The sleep event looks OK, but note that the "time" event will repeat every frame that the Hour variable is at least 23. I'm guessing you only want it to run once per game day, so maybe consider having a switch to track if it's already run this day, e.g.
◆If:Hour ≥ 23 ◆If:Night Update is OFF ◆Common Event:Update Crops ◆Common Event:Update Weather ◆Control Switches:#0002 Night Update = ON ◆ :End ◆ :Else ◆If:Night Update is ON ◆Control Switches:#0002 Night Update = OFF ◆ :End ◆ :End
(Might also want to add a Wait command in there to ease the CPU usage a bit.)

I'm not familiar with Mog's plugin, but it looks like it'll help a lot with smoothing out the tint transitions! ^w^
Caethyril 님이 마지막으로 수정; 2019년 5월 14일 오전 9시 09분
smallmak 2019년 5월 14일 오후 12시 01분 
Caethyril님이 먼저 게시:
smallmak님이 먼저 게시:
For some reason when the plants reach maturity they just disappear, ...
When this happened to me when I was making it, it was because I'd made a mistake in the page conditions, referencing the Crop Time variable instead of Crop ID. >_< I double-checked my events and your screenshots, though, and it all looks OK as far as I can tell.

Are your plant sprites from the tileset or from character sprite sheets? If the latter, make sure you have Direction Fix ON (and Stepping OFF unless they're animated).

You could also press F9 during playtest to check the values of your variables, maybe something's going wrong somewhere with the value assignment.

Also I am not sure if this is relavent but I thought I better include it just incase. I tried changing the system a little bit to work with Moghunters time system https://atelierrgss.wordpress.com/rmv-time-system/ and to have the crops update daily rather than hourly so here are the related event for that.

Sleeping event https://imgur.com/a/PkbcAA5
time common event https://imgur.com/a/avIGNkL (you'll notice I only have the 1 thing in the time common event. I am trying to make it so if the player stays awake into the next day the crops will update even without them sleeping. (I also set the hour variable in mog hunters time system to 448.) )
The sleep event looks OK, but note that the "time" event will repeat every frame that the Hour variable is at least 23. I'm guessing you only want it to run once per game day, so maybe consider having a switch to track if it's already run this day, e.g.
◆If:Hour ≥ 23 ◆If:Night Update is OFF ◆Common Event:Update Crops ◆Common Event:Update Weather ◆Control Switches:#0002 Night Update = ON ◆ :End ◆ :Else ◆If:Night Update is ON ◆Control Switches:#0002 Night Update = OFF ◆ :End ◆ :End
(Might also want to add a Wait command in there to ease the CPU usage a bit.)

I'm not familiar with Mog's plugin, but it looks like it'll help a lot with smoothing out the tint transitions! ^w^


after spending mroe time looking at it I still am not finding what is wrong. I uploaded the game I was testing this on to the steam workshop, if it isn't too much too ask would you look at it and see if you can find the problem?
https://steamcommunity.com/sharedfiles/filedetails/?id=1741320866

I will continue to look at it and update if I figure it out.
Caethyril 2019년 5월 14일 오후 2시 41분 
OK, I took a look and it seems it was just a minor thing with the big script call in the Plant Crop event. You've got this line:
var cropId = $gameVariables.value(60);
...but your "Seed: Crop ID" variable is ID 64, so the line should read:
var cropId = $gameVariables.value(64);
It was bugging out because you were "growing" crop ID 0 regardless of what was selected. I should've commented that line or something to explain what it does, sorry. ^-^'

Since your plants are all character sprites, you should check the Direction Fix option on each of the event pages to make sure their sprites don't change when activated from different directions. You can find the Direction Fix checkbox in the bottom-left of the event editing window, in the small box titled "Options". =)

And in case you weren't aware: this version of your project doesn't have event calls to update crops/weather when you sleep. Also, the crops update every 3 seconds between 11 pm and midnight. o.o
smallmak 2019년 5월 14일 오후 2시 51분 
Caethyril님이 먼저 게시:
OK, I took a look and it seems it was just a minor thing with the big script call in the Plant Crop event. You've got this line:
var cropId = $gameVariables.value(60);
...but your "Seed: Crop ID" variable is ID 64, so the line should read:
var cropId = $gameVariables.value(64);
It was bugging out because you were "growing" crop ID 0 regardless of what was selected. I should've commented that line or something to explain what it does, sorry. ^-^'

Since your plants are all character sprites, you should check the Direction Fix option on each of the event pages to make sure their sprites don't change when activated from different directions. You can find the Direction Fix checkbox in the bottom-left of the event editing window, in the small box titled "Options". =)

And in case you weren't aware: this version of your project doesn't have event calls to update crops/weather when you sleep. Also, the crops update every 3 seconds between 11 pm and midnight. o.o


Works like a charm!!! :D
I really can't thank you enough for all this help!
Should I set it to wait 999 frames?
smallmak 님이 마지막으로 수정; 2019년 5월 14일 오후 2시 51분
Caethyril 2019년 5월 14일 오후 3시 17분 
smallmak님이 먼저 게시:
Works like a charm!!! :D
I really can't thank you enough for all this help!
You're welcome! I'll try out the plugins I mentioned and update my Workshop project when I get around to it, should make the whole system much easier to work with. I'll also try to make the scripts clearer~ :cozyjunimogreen:
Should I set it to wait 999 frames?
If you want to use a wait time I'd suggest waiting at least one game hour; not sure how long that is, but you can put multiple wait commands one after another if need be. Put those waits inside the branch otherwise the event might be waiting when it's supposed to update the crop timers. Example:
◆If:Hour ≥ 23 ◆Common Event:Update Crops ◆Common Event:Update Weather ◆Comment:Wait for at least 1 game hour (900 frames = 15 seconds) ◆Wait:900 frames ◆Wait:900 frames ◆ :End ◆Comment:Don't need to check *every* frame. ◆Wait:30 frames
Note, though, that the parallel event will restart if you change maps. That's one of the reasons I suggested using a switch in my earlier post, but it's your call. =)
Caethyril 2019년 5월 16일 오전 8시 28분 
\o Heya, just thought I'd mention that I've updated my Workshop project to use Yanfly's Event Morpher & self variables now. It feels much easier to use: make each crop as its own event on the Template map, copy+paste farm plots wherever you like, then update the list of event IDs in the "Update Crops" event~

I also tried to fill in the gaps in the comments; there's a bit more script stuff but hopefully it's not confusing! ^_^'
smallmak 2019년 5월 17일 오전 8시 34분 
Caethyril님이 먼저 게시:
\o Heya, just thought I'd mention that I've updated my Workshop project to use Yanfly's Event Morpher & self variables now. It feels much easier to use: make each crop as its own event on the Template map, copy+paste farm plots wherever you like, then update the list of event IDs in the "Update Crops" event~

I also tried to fill in the gaps in the comments; there's a bit more script stuff but hopefully it's not confusing! ^_^'

It took a little bit of work because my item numbers where different from yours but I got it working :D I now have a full farming system. I think I will use this template you made and try to use it to also build my player store system.
< >
전체 댓글 17개 중 1~15개 표시 중
페이지당 표시 개수: 1530 50

게시된 날짜: 2019년 5월 10일 오후 6시 51분
게시글: 17