"Range Error Maximum Call Stack Size Exceeded"

Discussion in 'RPG Maker MV' started by Moo :D, Mar 22, 2016.

  1. Moo :D

    Moo :D Veteran Veteran

    Messages:
    31
    Likes Received:
    3
    First Language:
    English
    Hi all!


    I'm trying to use a custom formula that checks an actors %hp and then triggers a state based on the result of the check. I'm using Yanfly's Auto-Passive Traits, here is what I have


    <Custom Passive Condition>


    if (actor(1).hp / actor(1).mhp <= 0.10) {


    condition = true;


    } else {


    condition = false;


    }


    </Custom Passive Condition>


    It returns a "Range Error Maximum Call Stack Size Exceeded" error.


    T___T I don't know what to do please help if you can. Any other advice/links you could offer on general battle script command and such would be amazing too. Thanks for your time forum! I really do appreciate it


    ~Moo
     
    #1
  2. Victor Sant

    Victor Sant Veteran Veteran

    Messages:
    1,694
    Likes Received:
    1,437
    Location:
    Brazil
    First Language:
    Portuguese
    1 - Your code is totally wrong (there is no "actor(X)" function, to retrieve the actor you need to use '$gameActors.actor(X)')


    2 - There is a function that returns the the hp rate. it's .hpRate(), so the conditon could be $gameActors.actor(X).hpRate() <= 0.1


    3 - Do you want the state to check the actor under the state or another actor? If the state checks the actor under the state you don't need to use the <Custom Passive Condition>, use the <Passive Condition: HP Below x%> instead,
     
    #2
  3. Moo :D

    Moo :D Veteran Veteran

    Messages:
    31
    Likes Received:
    3
    First Language:
    English
    Hi Victor! Thank you for replying so quickly!! Sorry, my original code was indeed


    <Custom Passive Condition>


    if ($gameActors.actor(1).hp / $gameActors.actor(1).mhp <= 0.10) {


    condition = true;


    } else {


    condition = false;


    }


    </Custom Passive Condition>


    but that it was gave me the RangeError. 


    I do want to check another actor, not the actor under the state.


    I just tried this solution, 


    <Custom Passive Condition>


    if ($gameActors.actor(1).hpRate() <= 0.1) {


    condition = true;


    } else {


    condition = false;


    }


    </Custom Passive Condition>


    but I still get the RangeError: Maximum Call Stack Size Exceeded
     
    #3
  4. NeoPGX

    NeoPGX ~ King of Cuteness ~ Veteran

    Messages:
    774
    Likes Received:
    88
    Location:
    Shreveport, LA, United States
    First Language:
    English (US)
    Primarily Uses:
    N/A
    When you get the error again, press F8 and copy and paste the contents of it into a spoiler tag in your reply.
     
    #4
  5. Victor Sant

    Victor Sant Veteran Veteran

    Messages:
    1,694
    Likes Received:
    1,437
    Location:
    Brazil
    First Language:
    Portuguese
    Do this happen when using only the passive state? If so, it's a bug on the plugin. If not, it's a compatibility issue. Because both codes are correct.


    If it's a bug on the plugin, you can report YF to solve the issue.


    If it's a compatibility, find out wich plugins are conflicting and ask their authors if a fix is possible.


    Or, you can use an alternative plugin.
     
    #5
  6. bgillisp

    bgillisp Global Moderators Global Mod

    Messages:
    12,409
    Likes Received:
    12,642
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    What's the state? What are the remove conditions for the state? One thing I learned is if the state has remove by restriction in the state, ACE (and probably MV, as the code is very similar) will go into an infinite loop of removing/adding the state if you use that state in a passive, and crash the game.
     
    #6
  7. Victor Sant

    Victor Sant Veteran Veteran

    Messages:
    1,694
    Likes Received:
    1,437
    Location:
    Brazil
    First Language:
    Portuguese
    This depends on how the state was added. There are two methods/functions to add states: addState and addNewState. The first pass through the resist and other checks. The second, just add the state and period.


    Using the first is not advised for passive states exactly because those checks might conflict with having the state active all time.
     
    #7
  8. NeoPGX

    NeoPGX ~ King of Cuteness ~ Veteran

    Messages:
    774
    Likes Received:
    88
    Location:
    Shreveport, LA, United States
    First Language:
    English (US)
    Primarily Uses:
    N/A

    It may even be an error with the plugin order. Yanfly recommends a certain order for his/her plugins for a very good reason.
     
    #8
  9. bgillisp

    bgillisp Global Moderators Global Mod

    Messages:
    12,409
    Likes Received:
    12,642
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    Right. Which is why we need to see the state.


    @OP: Can you post a picture of the state so we can see exactly what is going on?
     
    #9
  10. Victor Sant

    Victor Sant Veteran Veteran

    Messages:
    1,694
    Likes Received:
    1,437
    Location:
    Brazil
    First Language:
    Portuguese
    Just to point out that the issue is either a compatibility or order issue like StarWarrior mentioned.


    I tested it and the condition works when only using the passive states, even with states that are removed by restriction.
     
    #10
  11. Moo :D

    Moo :D Veteran Veteran

    Messages:
    31
    Likes Received:
    3
    First Language:
    English
    Hey Yall! 


    Sorry I've been gone all day, I'm back home now! Here is the error log, I turned all plugins off, checked the Yanfly Website for plugin order recommendation (she said anywhere for this plugin) and I still have error, here it is:


    RangeError: Maximum call stack size exceeded
        at Game_Actors.actor (file:///C:/Users/imaekgaymz/Documents/Games/Base%20Project/js/rpg_objects.js:4556:35)
        at Game_Actor.eval (eval at <anonymous> (file:///C:/Users/imaekgaymz/Documents/Games/Base%20Project/js/plugins/YEP_AutoPassiveStates.js:351:15), <anonymous>:1:17)
        at Game_Actor.Game_BattlerBase.passiveStateConditionEval (file:///C:/Users/imaekgaymz/Documents/Games/Base%20Project/js/plugins/YEP_AutoPassiveStates.js:351:5)
        at Game_Actor.Game_BattlerBase.meetPassiveStateCondition (file:///C:/Users/imaekgaymz/Documents/Games/Base%20Project/js/plugins/YEP_AutoPassiveStates.js:327:17)
        at Game_Actor.Game_BattlerBase.getPassiveStateData (file:///C:/Users/imaekgaymz/Documents/Games/Base%20Project/js/plugins/YEP_AutoPassiveStates.js:313:17)
        at Game_Actor.passiveStatesRaw (file:///C:/Users/imaekgaymz/Documents/Games/Base%20Project/js/plugins/YEP_AutoPassiveStates.js:393:31)
        at Game_Actor.Game_BattlerBase.passiveStates (file:///C:/Users/imaekgaymz/Documents/Games/Base%20Project/js/plugins/YEP_AutoPassiveStates.js:294:30)
        at Game_Actor.Game_BattlerBase.states (file:///C:/Users/imaekgaymz/Documents/Games/Base%20Project/js/plugins/YEP_AutoPassiveStates.js:280:31)
        at Game_Actor.Game_BattlerBase.traitObjects (file:///C:/Users/imaekgaymz/Documents/Games/Base%20Project/js/rpg_objects.js:2359:17)
        at Game_Actor.traitObjects (file:///C:/Users/imaekgaymz/Documents/Games/Base%20Project/js/rpg_objects.js:3794:55)


    Thank you for all your help!!!
     
    #11
  12. Victor Sant

    Victor Sant Veteran Veteran

    Messages:
    1,694
    Likes Received:
    1,437
    Location:
    Brazil
    First Language:
    Portuguese
    Try updating the plugin, if this still don't work, simply use another plugin. There are at last 3 others passive state plugins with the option to use script code conditions.


    Since there are options available, it's more produtive to check if any of the other options works as intended rather than lose time trying to find a fix for this.
     
    #12
  13. Leann Rolle

    Leann Rolle Warper Member

    Messages:
    1
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    I know this post is old and I might be late on it, I came across it trying to find a fix for my SRD_GameUpgarde plugin and we had the same error, while I was messing around with it, I found that the plugin only works if you move it to the very top of your plugin list. Maybe try moving your plugin to the top, or find a spot that it can work in.
     
    #13
  14. RK DracoRoy

    RK DracoRoy Fire Emblem RPG Gamer Veteran

    Messages:
    154
    Likes Received:
    20
    First Language:
    English
    Primarily Uses:
    RMMV

    I think this should work. Try to change your Custom Passive Condition notetag to this:

    <Custom Passive Condition>
    if (actor.hp / actor.mhp <= 0.10) {
    condition = true;
    } else {
    condition = false;
    }
    </Custom Passive Condition>

    And for certain actors to have the passive state, you can just put this on either the Actor or Class notetag:

    <Passive State: "X">

    Hopefully this does solve the problem so that the error doesn't persist.
     
    #14
  15. breesk

    breesk I have absolutley no idea what I'm doing here, so Veteran

    Messages:
    47
    Likes Received:
    6
    Location:
    Not Telling
    First Language:
    a
    Primarily Uses:
    RMMV
    What causes this issue in the first place???
     
    #15

Share This Page