Introduction
This script will allow you to have bigger control over Critical Hits.
Usage
Use the given notetags in a skill’s or state’s notebox.
Settings
Remember that there are settings in the script.
This script will allow you to have bigger control over Critical Hits.
Use the given notetags in a skill’s or state’s notebox.
Remember that there are settings in the script.
Hi, I’m getting an error with this script and yanfly’s command autobattle? whenever the autobattle command is chosen the game crashes and cites this line of critical hit:
crit_dmg_mod = [target.state_crit + item.critical_damage, 1].max
Command autobattle is here:
https://yanflychannel.wordpress.com/rmvxa/battle-scripts/command-autobattle/
Normally I wouldn’t say anything but it seems like you try to make your stuff compatible with yanfly more or less but ignore me if i’m wrong about that
LikeLike
Thanks for pointing that out. I’ve updated the script and it should be working now.
LikeLike
Hiya. Even with nearly all my scripts disabled (only two cosmetic ones are not), I always get this error after doing any move in battle testing, whether there was a custom critical defined or not:
Script ‘Critical Hit’ line 154: NoMethodError occurred.
undefined method ‘subject’ for #
Please save me.
LikeLike
Trying again:
Script 'Critical Hit' line 154: NoMethodError occured.
undefined method 'subject' for #
Sorry if that doesn’t work.
LikeLike
Line 154 is “alias make_damage_ae make_damage” for me. Make sure you haven’t altered the script’s code in any way. The only thing that comes to my mind is that Line 162 is commented out by default. Perhaps you accidentally removed the comment sign in front of it.
See this picture for reference:
LikeLike
I made a comment at the top describing why the script was needed, as I did with all scripts. I suppose I could leave that out– the scripts are well-categorized. I put this one under “gameplay: optional” or whatever, so I guess I’ll move it to “required” and just not comment at the top…
LikeLike
Update: the top line is “$imported[“AE-CriticalHit”] = true”. It still gives me an error at line 164. Gonna test a brand-new project now with just this script…
Doing a New Project, I did nothing but add the script and then add the note tag to Attack. I got this:
Script ‘Critical Hit’ line 1: NoMethodError occured.
undefined method ‘[]=’ for nil:NilClass
So basically the script doesn’t work out of the box.
LikeLike
The Line 1 Error is indeed an oversight by me, but I still can’t reproduce your other crash.
Insert this into Line 1 to fix the error: $imported = {} if $imported.nil?
My only assumption is that you have a conflicting script. Care to share your script list with me? Feel free to send it to me on the RPG Maker forums if it makes things any easier.
LikeLike
Hello, sorry for bothering you but I’m getting an error with this script. The error is:
Script ‘critical’ line 164: NoMethodError occured.
undefined method ‘damage_ratio’ for
#
LikeLike
Didn’t go through all the way, sorry:
undefined method ‘damage_ratio’ for
#
LikeLiked by 1 person
God.
https://prnt.sc/ftasfv
There.
LikeLike
It’s been a long time that I have coded in Ruby but I’ll try my best to help you here.
First of all, does it crash if you disable all other scripts?
LikeLike
No, I started a new project and it works fine there.
LikeLike
If you could find out which of your scripts is conflicting with mine it would make it way easier to resolve the issue.
Most likely, it’s another battle related plugin that’s conflicting.
LikeLike
Of course! I have to go to work, but I can do it later. Thank you so much by the way.
LikeLiked by 1 person
Hmm, alright. This is odd. I made a new project to test to see if it works. I get this.
https://prnt.sc/g3na10
LikeLike
And if I remove that, then this error shows up: https://prnt.sc/g3nb1h
LikeLike
The line 1 error occurs because I forgot to add something there.
Place this in line 1 so that the current line 1 becomes line 2:
$imported = {} if $imported.nil?As I said it’s been a long time that I have worked with RPG Maker VX Ace but I think this script required the basic Yanfly Battle scripts to work properly.
What happens when you only have this script and Yanfly’s scripts activated?
LikeLike
Hmm, still an error, but a different one. I have the “Yanfly Core” and “Yanfly Engine.”
https://prnt.sc/g4j0ql
If you don’t know or you don’t remember what to do, don’t worry about it.
LikeLike
Hey,
I tried looking into this a bit further and I found that it looks like I seriously coded this
with an addon made by Yami in mind. The thing is I forgot to note anywhere that this addon would be required.
The problem should hopefully be solved if you
1. Insert the line I mentioned in an earlier comment
2. Delete the line referencing “damage_ratio”. It shouldn’t break anything. According to your latest screenshot (and thank you so much for providing all of those) that should be line 165.
LikeLike
Oh yea, that worked. It works GREAT, I couldn’t find anymore scripts about “crit damage” until I found yours. Thank you so much Alistair.
Side note: Might be a smart idea to post the fixed script now, so this won’t happen to anyone else.
I love this script, thank you so much for your help. 😀
LikeLiked by 1 person