Vlue's 'Animation Frame Rate' with symphony script error

 I am attempting to use Vlue's script 'Animation Frame Rate' purely for the reflecting animations on visual battlers (I require enemies to use the same skills as my actor).

However, I am having a strange problem when using an animated skill when using Symphony tags to play the animation. The effect works fine on the first hit (usually), or when the animation is on the User rather than on a Target. 

This is the error that comes up during the animation:

'Line 41 - undefined method 'name' for nil:NilClass'

I am guessing it is related to the use of Battle Engine Symphony in my game but I can't work out how to get around this error.

Vlue's script : http://forums.rpgmakerweb.com/index.php?/topic/3900-animation-frame-rate/
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.


Are you certain it's this script causing the problem? Because you've only posted a part of a single script, and you haven't included the full error message text (that would have included the name of the script), we can't be sure.


Please post a link to the complete script so we can see the whole thing if necessary.


My first guess would be - did you add the script and then resume a game that had been saved? The Undefined method ... for nil class errors are very common when you save a game, add a script, then try to resume the saved game. A lot of scripts set up new variables in the init methods, and because a saved game, when resumed, does not rerun the init methods, those variables are missing. Whenever you get an error like this, the first thing you should do is start a new game and see if it still happens.
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.

Are you certain it's this script causing the problem? Because you've only posted a part of a single script, and you haven't included the full error message text (that would have included the name of the script), we can't be sure.

Please post a link to the complete script so we can see the whole thing if necessary.

My first guess would be - did you add the script and then resume a game that had been saved? The Undefined method ... for nil class errors are very common when you save a game, add a script, then try to resume the saved game. A lot of scripts set up new variables in the init methods, and because a saved game, when resumed, does not rerun the init methods, those variables are missing. Whenever you get an error like this, the first thing you should do is start a new game and see if it still happens.
Sorry about that, this is the full script though. The full error message is:

Script 'animation reflect' line 41: NoMethodError occured.

undefined method 'name' for nil:NilClass

This happens even during battle test, regardless of whether or not a new game has been started.
well, I'm only guessing ...


try adding this line as the first line in the set_animation_rate method (insert it before line 41):

return if !@animationIt might fix it, or it might cause more problems here or in other areas.
Even if it's the full script, we don't like people putting other people's scripts in their posts. The author has no way to keep track of how many copies/versions of their script are out there; if there's a bug and it's fixed, nobody looking at this post would ever know that there was a bug and it was fixed - they'd have the buggy version; linking to the page where the script was sourced allows us to read the author's comments that were not added to the script itself; we also get to see any discussion that's happened on the author's page - bug reports, questions on how it runs or how to set it up, we get to see if anyone else had the same issue and what the problem might have been. As you can see, there's a fairly long (and still incomplete) list of reasons that show why it's preferable to just give a link to the scripter's page.
well, I'm only guessing ...

try adding this line as the first line in the set_animation_rate method (insert it before line 41):

return if !@animationIt might fix it, or it might cause more problems here or in other areas.Even if it's the full script, we don't like people putting other people's scripts in their posts. The author has no way to keep track of how many copies/versions of their script are out there; if there's a bug and it's fixed, nobody looking at this post would ever know that there was a bug and it was fixed - they'd have the buggy version; linking to the page where the script was sourced allows us to read the author's comments that were not added to the script itself; we also get to see any discussion that's happened on the author's page - bug reports, questions on how it runs or how to set it up, we get to see if anyone else had the same issue and what the problem might have been. As you can see, there's a fairly long (and still incomplete) list of reasons that show why it's preferable to just give a link to the scripter's page.
Alright, fair enough - I'll edit it out. Thanks, I'll give that a shot!

Edit: That did it! Thanks so much Shaz. 🙂

Original thread: https://forums.rpgmakerweb.com/threads/vlues-animation-frame-rate-with-symphony-script-error.42515/