RPGM Below the Fold [Ep.5 R2] [iLTinoBambino]

2.80 star(s) 5 Votes

Best princess?


  • Total voters
    101
  • Poll closed .

Arikania

Active Member
Feb 10, 2023
650
225
I tried to look into the code to see what can cause that, and my hypothesis is this: map/event data can tell for an image to be shown, and it can tell it to be erased. There is some plugin (some thing called TDDP_BindPicturesToMap) that adds some additional functionality, and this plugin does some processing with a picture after it is finished loading. However, since the loading seems to be asynchronous, it can actually finish AFTER the map/event processing has instructed the image to be erased. In this case, this postprocessing function added by TDDP_BindPicturesToMap tries to use some information about the image that has already been deleted due to "erase picture" command.

So what causes an image to be "erased" before it is done loading in the first place? It's a combination of the image being erased very quickly after being first shown (either because it's part of an animation, or because of skipping) and possibly slow loading (either due to disk or CPU performance).

Either way, I would say the plugin is at fault here since I would not call this situation the fault of the game developer - the plugin developer should have considered this can happen. The fix would be fairly simple in the plugin code.

This analysis is done based on looking at the code for like 5 minutes so I may be off with some things.
1) Just before activating the plug-in, set a boolen variable to "TRUE",
2) When the plug-in is done, set that variable to "FALSE",
3) Put the "erase picture" command into a subroutine that waits for that variable to turn "FALSE".
4) In your source code, use that subroutine instead of the actual erase command wherever a picture needs to be removed.
 
  • Star-struck
Reactions: TinoBambino

nuqqur

Newbie
May 8, 2018
90
84
1) Just before activating the plug-in, set a boolen variable to "TRUE",
2) When the plug-in is done, set that variable to "FALSE",
3) Put the "erase picture" command into a subroutine that waits for that variable to turn "FALSE".
4) In your source code, use that subroutine instead of the actual erase command wherever a picture needs to be removed.
I don't think it needs to be that complex. Can just add a null check to the function that tries to use the missing picture information (the last 3 lines are new, file www\js\plugins\TDDP_BindPicturesToMap.js):
JavaScript:
    Sprite_Picture.prototype.bltLoadedBitmap = function(sourceBitmap) {
        var picture = this.picture();
        if(!picture) {
            return;
        }
There's no need for it to do anything if the underlying picture is already gone.
 
  • Star-struck
Reactions: TinoBambino

TinoBambino

Member
Game Developer
Aug 6, 2016
127
227
I don't think it needs to be that complex. Can just add a null check to the function that tries to use the missing picture information (the last 3 lines are new, file www\js\plugins\TDDP_BindPicturesToMap.js):
JavaScript:
    Sprite_Picture.prototype.bltLoadedBitmap = function(sourceBitmap) {
        var picture = this.picture();
        if(!picture) {
            return;
        }
There's no need for it to do anything if the underlying picture is already gone.
this is awesome thank you so much, i just tried this and it seems like it works. seriously thank you like this was constructive and useful and community oriented :D thank you!!!
 
2.80 star(s) 5 Votes