@modern_algebra - Yeah, I realized in a later post what he was trying to do was syncing the properties of his sub-sprite with the properties of the window after all initialization method had been run once the code had been cleaned up a bit. It was mostly the broken rescue blocks that made me cringe since he used it on pretty much every alias in his script submission to completed scripts (before he started cleaning it up here) and none of them did anything, so over half the code were branches that could never be reached.
As for overplanning, I was just mentioning that the mindset behind it can be detrimental, especially if just starting out with Ruby in RM where you can, as you said, have 30 people modifying the same code. Transparently passing arguments and a (potentially nonexistent) block is not inherently harmful by itself, but the idea that you can prevent
every compatibility would might be. I was just pointing this out as an example because if you actually needed to
use whatever arguments were passed, you'd have to make an assumption anyway, although 99% of the time if someone is going to alter a method's arguments, they are going to just tack an additional argument at the end of the existing list so transparently passing *args is always a good idea. I didn't mean to insinuate it wasn't.
If someone added a block requirement to the method
where there was none before, however, the method might not even have the same function anymore. (It
could, but probably not, especially specific to RM where I've never seen this done.) I'd hope that anyone modifying an existing method to take a block would be considerate of those things but you really have no idea what they have done - you are just operating on a set of assumptions that it will fit in with the base code, plus any code added by an arbitrary amount of people that doesn't directly overwrite or completely change the function. That just brings me back to the point I was trying to make in another post that even if you follow basic compatibility guidelines that there will be that one person that doesn't, and
that will be the incompatible script. If not binding and passing the block is causing a problem, you'd know that one or more of your assumptions is wrong and the code requires further analysis.
Of course, neither matters in situations such as your example where you don't care about what the content of either the arguments or if it needs a block, such as adding a variable in initialize.
Not including the block binding also wouldn't make errors any more obvious in the case where the block was a conditional argument in the other modified method anyway, and in the event they did use it correctly, it would just silently break some function in the other script. I guess I was more leaning toward expecting the function of the method to have changed if a block requirement is suddenly introduced, where you were leaning toward anyone adding the block argument knows what they are doing enough that you can safely pass the block without having to make any extra provisions. So, bad example of being overzealous for the sake of compatibility I guess.
Note I'm not a professional programmer, just a hobbyist who has been tinkering with Ruby and RM for just over 5 years now, and I think you have been in the RM scene around even longer. I've done far worse in an attempt to maintain compatibility, and looking back at that code, it still can be (and looking at the threads, in many cases, was) broken by another script, regardless of the provisions I had made, so I am just speaking from personal experience.
I could have cited a specific example from there, like the times I avoided overwriting make_obj_damage_value / make_attack_damage_value in separate scripts while changing either way criticals were handled or the damage formula through complicated workarounds, when I could have just overwritten the whole method, which would have made little difference because the scripts already made a large amount of assumptions about what was going on inside the method. Eg., since there was a "damage *= 3 if @critical" buried in the method, and I wanted to modify that 3, my assumption would be that this line remained in any so I would have to divide damage by 3 and then multiply by whatever value I wanted to modify it to. In this case, it was a safe assumption, since if anybody is going to change that value directly they probably wouldn't use a different script that specifically does the same thing, but it is still really easy to break since it operates on that assumption.
@Mike -
If you want to resize the sprite, instead of stretch_blt, which would require you maintaining a unique (not cached) bitmap for each Sprite, consider using the zoom_x and zoom_y properties of the sprite to size it appropriately.
It's window_help, and window_gold.
The width doesn't work with window_gold.
The height and width doesn't work on window_help.
The rest seems fine.
I don't immediately see the issue with a hand trace. I'll run a test on this after you post a finished version and see if I can weed it out.