"Range Error Maximum Call Stack Size Exceeded"

Moo :D

Veteran
Veteran
Joined
Nov 27, 2015
Messages
31
Reaction score
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
 

Victor Sant

Veteran
Veteran
Joined
Mar 17, 2012
Messages
1,694
Reaction score
1,452
First Language
Portuguese
Primarily Uses
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,
 

Moo :D

Veteran
Veteran
Joined
Nov 27, 2015
Messages
31
Reaction score
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
 

NeoPGX

~ King of Cuteness ~
Veteran
Joined
May 15, 2014
Messages
847
Reaction score
175
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.
 

Victor Sant

Veteran
Veteran
Joined
Mar 17, 2012
Messages
1,694
Reaction score
1,452
First Language
Portuguese
Primarily Uses
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.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
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.
 

Victor Sant

Veteran
Veteran
Joined
Mar 17, 2012
Messages
1,694
Reaction score
1,452
First Language
Portuguese
Primarily Uses
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.
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.
 

NeoPGX

~ King of Cuteness ~
Veteran
Joined
May 15, 2014
Messages
847
Reaction score
175
First Language
English (US)
Primarily Uses
N/A
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.

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

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
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.
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?
 

Victor Sant

Veteran
Veteran
Joined
Mar 17, 2012
Messages
1,694
Reaction score
1,452
First Language
Portuguese
Primarily Uses
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.
 

Moo :D

Veteran
Veteran
Joined
Nov 27, 2015
Messages
31
Reaction score
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!!!
 

Victor Sant

Veteran
Veteran
Joined
Mar 17, 2012
Messages
1,694
Reaction score
1,452
First Language
Portuguese
Primarily Uses
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.
 

Leann Rolle

Warper
Member
Joined
Jul 16, 2017
Messages
1
Reaction score
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.
 

RK DracoRoy

Fire Emblem RPG Gamer
Veteran
Joined
Jun 29, 2017
Messages
259
Reaction score
76
First Language
English
Primarily Uses
RMMV
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!!!

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.
 

breesk

voted "worst person" 18 times and counting
Veteran
Joined
May 28, 2016
Messages
49
Reaction score
6
First Language
american
Primarily Uses
RMMV
What causes this issue in the first place???
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,050
Members
137,571
Latest member
grr
Top