Issue with Combat Initiation (Yanfly Scripts)

Telemindred

Telemindred the Archmage
Member
Joined
Mar 12, 2020
Messages
15
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
15,354
Reaction score
8,536
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
5,624
Reaction score
5,107
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
15
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
5,594
Reaction score
6,527
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
2,661
Reaction score
563
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
5,624
Reaction score
5,107
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
15
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
 

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

Latest Threads

Latest Posts

Latest Profile Posts

"You can thank my later", "But you haven't done anything", "Well, that's why ..."
Are we allowed to post about non-RPG Maker games?
I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

Forum statistics

Threads
105,884
Messages
1,017,243
Members
137,609
Latest member
shododdydoddy
Top