Note that there is a way to fix the F12/One instance per script bug:
Instead of using
alias bluemage_update_old update
def update
...
bluemage_update_old
end
You should use this (and make your name more specific if you can):
unless method_defined?(:tim_bluemage_update_old_xyz)
alias tim_bluemage_update_old_xyz update
end
def update
...
tim_bluemage_update_old_xyz
end
This will prevent you from re-aliasing the update code -- which causes it to call itself rather than the old code -- if it has already been aliased.
Just a quick tip ;)
Nice one WcW :) *powers up*
:) This is really handy! Thanks!
*power up*
This isn't really all mine. Blizz/Zeriab have used this in a couple scripts before, but I'd thought I'd share with you to spread the knowledge :P
I avoid using it if I can. I only needed it for the shaded text thing. Since in Blizz-ABS there's an outline text thing, I needed to alias the original method only if Tons wasn't already present.
... Oh wait, I checked for Tons there. xD Anyway, I avoid using it. It seems kinda ruggish to me. What if somebody named a method the same, but it doesn't do the same? It's a bit risky and due to the high variety of RMXP scripts I'd rather have somebody report a "Stack level too deep" error, since I know what's going on, than a new random error which I can't figure out without checking out a demo. ._.;
It's sometimes very, very useful, though. Just be careful when you use it.
Zeriab did make an F12 fix as well...
Yes, but this fixes that on its own, without assuming the user already has another script for it.
While it is rather useless, its good practice.
Loads of things are good practice, but most scripters don't do it. :(
Most scripters only know the basics of programming, which is a sad fact. Heck, I only realized how horribly slow hashes and arrays in Ruby must be, after seeing the implementations from the C side (and ack, Ruby-style arrays are horribly hard in C! C++ has vectors though, so yippee :P)