undefined method 'dispose' for nil:NilClass

Hello Ruby geniuses....I grovel before your greatness in awe

I'm trying to make Yami's Order Gauge Script work (in a new project to isolate the script) and keep getting this error when a battle ends.

line 624: NoMethodError occurred.

undefined method 'dispose' for nil:NilClass

link to the page where the script is found since a lot of yam's scripts have been lost 

http://rpgmaker-vx-ace.de/board9-rpg-maker-vx-ace-lite/board18-scripts-rgss3-ace/board64-probleme/565-ysa-battle-system-predicted-charge-turn-battle-broken/

its not in english but its pretty easy to find.

I found the line in question and it reads

#--------------------------------------------------------------------------

# alias method: dispose_spriteset

#--------------------------------------------------------------------------

alias order_gauge_dispose_spriteset dispose_spriteset

def dispose_spriteset

for order in @spriteset_order

order.bitmap.dispose

order.dispose

end

order_gauge_dispose_spriteset

end

 

 

This is (what looks like at least) the last bump in the road for my games scripts so help would be very much appreciated and i'll give spiritual high fives to anyone who helps!!

 

let me know if more information is needed.
In 80% of all cases, "undefined for NIL" is the result when you load an older savefile after adding a script, instead of starting a new game with the new script.


If that is not the solution, then I suggest going through the following steps for bughunting:


http://forums.rpgmakerweb.com/index.php?/topic/40589-how-to-use-a-script/


EDIT: And pleas elink to the scripts you need help with, those tiny snippets are not enough.


Link - do not repost.
Thanks Andar, I've edited my original post. 

guess i'm not one of the 80% cases unfortunately. I start a new game from the launcher and still gives the same crash message on battle victory.
Looks like a bug on the script itself, order.bitmap is never created when using default settings.

Try changing this:

Code:
order.bitmap.dispose
for this:
Code:
order.bitmap.dispose unless order.bitmap.nil?
Looks like a bug on the script itself, order.bitmap is never created when using default settings.

Try changing this:

order.bitmap.disposefor this:
Code:
order.bitmap.dispose unless order.bitmap.nil?
You sir are a hero!

ONE HIGH FIVE COMING YOUR WAY

high-five.jpg


THANK YOU!!!

Original thread: https://forums.rpgmakerweb.com/threads/undefined-method-dispose-for-nil-nilclass.42926/