Telemindred

Telemindred the Archmage
Member
Joined
Mar 12, 2020
Messages
24
Reaction score
3
First Language
English
Primarily Uses
RMVXA
I'm relatively new not only to this forum, rpgmaker or scripts, but also windows and game making. I've been practicing a while and recently started implementing Yanfly's scripts and learning how they operate and work. However this is something that I can't figure out and would like to ask for assistance on.

I had added in Yanfly's Battle Core script and several of the battle scripts along with that, but ever since I added them in combat won't work. Anytime I attempt it, before it shows anything in the screen this message pops up:

undefined method 'X' for Game_Enemy:Class

Originally it was for maxbuff because I had the Buffs and Stats script, but I took that out seeing if combat would work. When I did, the 'X' changed from 'maxbuff' to 'warmup_rate'. I haven't actually changed anything in the classes, monsters, actors yet, was just running it to see if the scripts worked but it doesn't. I tried to read the instructions on how to use it but I couldn't find anything. When the game crashes and I go to scripts, it immediately jumps to this part of the Yanfly Ace Skill Restrictions Script:

#--------------------------------------------------------------------------
# new method: wur
#--------------------------------------------------------------------------
def wur
n = 1.0
if actor?
n *= self.actor.warmup_rate
n *= self.class.warmup_rate
for equip in equips
next if equip.nil?
n *= equip.warmup_rate
end
else
n *= self.enemy.warmup_rate
if $imported["YEA-Doppelganger"] && !self.class.nil?
n *= self.class.warmup_rate
end
end
for state in states
next if state.nil?
n *= state.warmup_rate
end
return n
end


As I've explained already I'm new to script, so I'm not entirely sure what is going on. Whether it's that I should have written something in somewhere, taken something out, turn something off/on, or else something I'm not coming up with I'm unsure of what's wrong or what to do other than take out all the scripts (which is what I *don't* want). Can someone help me figure this out?
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
16,038
Reaction score
8,904
First Language
English
Primarily Uses
RMMV

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

 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
6,042
Reaction score
5,705
First Language
English
Primarily Uses
RMVXA
This error happens when you are trying to access a property or method that hasn't been defined within the scope of the class (or been made "accessible" through the attr_accessor keyword in the case of properties). Normally this points to a code error, but given that it's a Yanfly script that hasn't been modified in almost a decade, that seems very unlikely.

First of all, let's make sure this isn't an obsolete version of the script. At the very top of the Skill Restrictions script should be a "Last Updated" line. Make sure it says "Last Updated: 2012.01.23 " or even more recently than that. If it's older, you may have an obsolete version which had bugs.

The only other thing I might suspect, since you say you haven't actually added notetags to Actors/Enemies/Skills yet, is that you may have inserted the scripts in the wrong order. You almost always want to add custom scripts AFTER Scene_Gameover and BEFORE Main. Additionally, sometimes scripts have dependencies on each other - the dependent script must always be placed AFTER the script that it is dependent on. For example, Yanfly's "Battle System: FTB" must always be placed somewhere after his "Ace Battle Engine". If it's placed before Ace Battle Engine, it won't work. Go ahead and take a screenshot of your Script Editor that shows the order of scripts you've inserted, and I'll look to see if anything looks like it could be causing your error.

(Also, whenever you change anything with scripts, be sure to Save your project before testing anything.)
 

Telemindred

Telemindred the Archmage
Member
Joined
Mar 12, 2020
Messages
24
Reaction score
3
First Language
English
Primarily Uses
RMVXA
Alright, so it *is* the 2012.01.23

And the Yanfly scripts are out of order actually. I hadn't realized its order would affect it so that is very good to know. All the Yanfly scripts were put into the materials category (I do take tutorials, but either they didn't mention how the scripts had to be in the right order or I missed it).

1583965070857.png
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,204
Reaction score
7,469
First Language
Indonesian
Primarily Uses
RMVXA
Whenever you have an error, don't type the error message. Screenshot it. Most of the time, the important message is lost in the process when typing it, so it is better to just show the error notice screenshot and post it here.

And as always, link to the script (the original one) and post a snippet of what you've edited if you did edit any.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
3,134
Reaction score
708
First Language
English
Primarily Uses
RMVXA
either they didn't mention how the scripts had to be in the right order or I missed it
In red it says to put them in the order shown.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
6,042
Reaction score
5,705
First Language
English
Primarily Uses
RMVXA
So when you put them in the right order, does it still give the 'undefined method' errors?
 

Telemindred

Telemindred the Archmage
Member
Joined
Mar 12, 2020
Messages
24
Reaction score
3
First Language
English
Primarily Uses
RMVXA
So when you put them in the right order, does it still give the 'undefined method' errors?

Just removed and reapplied all of the scripts and it does work. Thank you very much Wavelength, I truly appreciate it! I'll keep in mind to double check any/all instructions and descriptions in case I miss something the first time.


Whenever you have an error, don't type the error message. Screenshot it. Most of the time, the important message is lost in the process when typing it, so it is better to just show the error notice screenshot and post it here.

And as always, link to the script (the original one) and post a snippet of what you've edited if you did edit any.

I was not aware of that, so thank you for letting me know. I'll make sure to do that if I have any further issues. Thanks again guys for helping me out with this
 

Latest Threads

Latest Profile Posts

image_2021-06-16_153010.png

Why are barrels to difficult? xD I feel like i Barrel...y made it....eh EHHH!? :p
Bluh... glad this present heatwave is coming to a close...
Look what I found, it was my first ABS.

This project was never completed because I had lost the computer where it was stored.
Character Creator for RPGM 2000, VX, XP, & LPC Style Sprites | RPG Maker News #72

Is there any way to get more than 8 enemies in a troop in RMMV or is that limit pretty much hardcoded into the engine?

Forum statistics

Threads
112,277
Messages
1,067,029
Members
145,899
Latest member
noor123
Top