Critical Hit

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.

ch


Settings

Remember that there are settings in the script.

ch2


ch3


Get it at my Dropbox

Advertisements

21 thoughts on “Critical Hit

  1. 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

    Like

  2. 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.

    Like

      1. 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:

        Like

      2. 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…

        Like

  3. 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.

    Like

    1. 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.

      Like

  4. 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
    #

    Like

    1. 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.

      Like

  5. 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?

    Like

      1. 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.

        Like

      2. 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. 😀

        Liked by 1 person

Write a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s