Yanfly's event foraging system. Help

Discussion in 'Javascript/Plugin Support' started by FiercestPixel, Jan 1, 2019.

Thread Status:
Not open for further replies.
  1. FiercestPixel

    FiercestPixel Villager Member

    Messages:
    25
    Likes Received:
    5
    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.
     
    #1
  2. hiddenone

    hiddenone Lurker Extraordinaire Moderator

    Messages:
    1,817
    Likes Received:
    4,471
    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.

     
    #2
  3. Fornoreason1000

    Fornoreason1000 Black Sheep Veteran

    Messages:
    199
    Likes Received:
    92
    Location:
    Anor Londo
    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: Jan 1, 2019
    #3
    FiercestPixel likes this.
  4. FiercestPixel

    FiercestPixel Villager Member

    Messages:
    25
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMMV
    Okay, sorry about that... will do!


    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: Jan 1, 2019
    #4
  5. Fornoreason1000

    Fornoreason1000 Black Sheep Veteran

    Messages:
    199
    Likes Received:
    92
    Location:
    Anor Londo
    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: Jan 1, 2019
    #5
  6. FiercestPixel

    FiercestPixel Villager Member

    Messages:
    25
    Likes Received:
    5
    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!
     
    #6
  7. Barseque

    Barseque Warper Member

    Messages:
    3
    Likes Received:
    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 )
     
    #7
  8. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,178
    Likes Received:
    10,328
    First Language:
    English
    Primarily Uses:
    RMVXA

    Barseque, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.


    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.

    Closing this.

     
    #8
Thread Status:
Not open for further replies.

Share This Page