Yanfly's event foraging system. Help

Status
Not open for further replies.

FiercestPixel

Veteran
Veteran
Joined
Jan 28, 2018
Messages
32
Reaction score
6
First Language
English
Primarily Uses
RMMV
YEP_ForageHelp3.png YEP_ForageHelp2.png YEP_ForageHelp.png Like the title says, im having some issues following along with Yanfly's foraging event system. Heshethey recently did a video about it but I didn't know where to ask exactly. I am pretty confident I have the eventing right (maybe not) but my coding is trash lol. Please, if anyone has watched the video or better yet, successfully used this event system, a little advice or insight would be greatly appreciated.

Here are some of the screens, notice the debug says the Temp Variable 2 is at 1000 when the break loop (see other screen) should have stopped the cycle at 999. Btw, my mapID is 9 and the second event page has a Self Var condition.
 

hiddenone

Lurker Extraordinaire
Global Mod
Joined
Feb 19, 2014
Messages
2,321
Reaction score
5,018
First Language
english
Primarily Uses
RMMV

I've moved this thread to Javascript/Plugin Support. Please be sure to post your threads in the correct forum next time. Thank you.

 

Fornoreason1000

Black Sheep
Veteran
Joined
Mar 1, 2014
Messages
205
Reaction score
94
First Language
English
Primarily Uses
RMMV
@FiercestPixel
Firstly, thanks for providing screenshots.

Secondly the Conditional branch, the reason it reaches 1000, is because it will break the loop once it is GREATER than 999. which jsut happens to be the point it reaches 1000
your loop is similar to this code. please note that this JS code shouldn't be inserted into events, since events have special wait logic and this code basically does nothing. im using it to explain what happens

Code:
var temp1 = 0;
var temp3 = 999;

//this statement will loop a code block indefinitely until we call break
while(true) { 

//999 + 1 == 1000, this increments the variable each loop;
temp1 += 1;

//since 999 is not greater than 999 we run a loop again!
//1000 IS greater than 999 so the loop breaks now!
if(temp1 > temp3) { break; } 
                                            
}
//temp1 breaks at 1000!
Basically you want to use EQUAL or GREATER instead
your conditional branch should look like this

Code:
if( Temp Variable 2 >= Temp Variable 3) {

}
Can you list the plugins you are using, i can see you are using SelfVariables and Switches but "Event Foraging System" eludes me. you said "Heshethey" did a video about it, can you link the video? just in case the condition isn't the only problem.
 
Last edited:

FiercestPixel

Veteran
Veteran
Joined
Jan 28, 2018
Messages
32
Reaction score
6
First Language
English
Primarily Uses
RMMV
[move]Javascript/Plugin Support[/move]
Okay, sorry about that... will do!

@FiercestPixel
Firstly, thanks for providing screenshots.

Secondly the Conditional branch, the reason it reaches 1000, is because it will break the loop once it is GREATER than 999. which jsut happens to be the point it reaches 1000
your loop is similar to this code. please note that this JS code shouldn't be inserted into events, since events have special wait logic and this code basically does nothing. im using it to explain what happens

Code:
var temp1 = 0;
var temp3 = 999;

//this statement will loop a code block indefinitely until we call break
while(true) {

//999 + 1 == 1000, this increments the variable each loop;
temp1 += 1;

//since 999 is not greater than 999 we run a loop again!
//1000 IS greater than 999 so the loop breaks now!
if(temp1 > temp3) { break; }
                                           
}
//temp1 breaks at 1000!
Basically you want to use EQUAL or GREATER instead
your conditional branch should look like this

Code:
if( Temp Variable 2 >= Temp Variable 3) {

}
Can you list the plugins you are using, i can see you are using SelfVariables and Switches but "Event Foraging System" eludes me. you said "Heshethey" did a video about it, can you link the video? just in case the condition isn't the only problem.

http://yanfly.moe/2018/07/13/eventing-a-foraging-system-rpg-maker-mv/

^ There you go
Oh wow, I wasn't expecting a reply so soon. Thanks! I don't think I've ever used a event Loop but looking at your explanation it's seems like just a fancy jump to label. Yeah "Event Foraging System was just the name of the video, not a plugin. That script was pulled from that link and I just inserted my event info. I probably have about a hundred plugins on that project but only 5-10 are turned on atm, mostly yanfly's. I did have Mog Hunters Chrono ABS Plugin active but I later found out it wasn't compatible with Yanfly's SelfVariables and Switches earlier today.
 
Last edited by a moderator:

Fornoreason1000

Black Sheep
Veteran
Joined
Mar 1, 2014
Messages
205
Reaction score
94
First Language
English
Primarily Uses
RMMV
Okay, i think i've figured out what you are trying to do,
You want to make bunch of harvest able plants that will re-spawn in a few hours/days like Skyrim or the Witcher or some kinda farming game?.

here how i would do this,
instead of running a loop updating 40+ (this number can go up very quickly!!, a 40x40 grid is 1600!) self Variables, I'd just save a Time Stamp based on in game time or even just a made up timer in a Self Variable.

when the map refreshes or when you explicitly call a refresher event, it will check the Saved Time against the Current Time as a page condition, if the Current Time exceeds the saved time by a certain amount the plant can be re harvested. the reason I do it this way because i have a day/night cycle.
 
Last edited:

FiercestPixel

Veteran
Veteran
Joined
Jan 28, 2018
Messages
32
Reaction score
6
First Language
English
Primarily Uses
RMMV
Yeah exactly! I'm developing a Harvest moon, stardew valley, Orange Season or Worlds Dawn type of game (with a little bit of fantasy rpg butt kicking action haha). I never thought about a real time growing system, sounds better than what I had. Before I was using a common event that activates event self switches all set up around a time system that checked for "plants watered" and "season" conditions. The data base work is a massive pain for the scale I want to get to though. Then I seen this magnificent plugin http://yanfly.moe/2018/07/06/yep-168-event-copier-rpg-maker-mv/
^ which basically sets up one SINGLE event as a "template" for all the other events that share the same note tag. I already have a painstakingly slow crop time system set up buuuuut I want to be able edit all the events at once, especially since I'm trying to implement a limited Inventory soon. I'm probably gunna stick with my common event system (because I really want Chronos abs combat) but I'm definitely going try your idea out, it seems like it could less laggy in the long run. Thanks for the advice!
 

Barseque

Warper
Member
Joined
May 23, 2019
Messages
3
Reaction score
0
First Language
Arabic
Primarily Uses
RMMV
@FiercestPixel
did you figure it out ? i'm having sorta same problem. ( yanfly sure suck at explaining and should provide samples those r amazing )
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
21,854
Reaction score
11,066
First Language
English
Primarily Uses
RMVXA
[necro]Barseque[/necro]
If you are having sort of the same problem, then it probably isn't identical. I suggest you start a new thread, setting out exactly what the issue is for you, and what you have done so far to try and resolve it, so that people don't spend their time making suggestions that you've already worked through.

[mod]Closing this.[/mod]
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

So, uh, has anyone tried buying any resources from KokoroReflections? Because I've been looking for a 'buy' button on the site for like 10 minutes now and can't find one.
Any also thought it's too cringy to put the word "and you" in your credit as a special thanks?
Cause that's what I thought...
Everyone in the US right now: Please stay safe.
Symphony Celestia: Prophecy of the Falling Stars RPG Maker music pack WIP. Symphony Celestia is a new series that focuses on symphonic and orchestrated music to tell a story. Each story will include compositions that make up that story from beginning to end. Themes include: Battles, adventures, character themes, etc. Below is a video preview to the first story.

Jumping and gravitation 0.1 build - RPG Maker MV

Forum statistics

Threads
97,979
Messages
948,302
Members
129,241
Latest member
LordCola
Top