Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

RPG Maker Action Combat - RPG Maker MZ Plugin

Create high quality ABS, action games right inside RPG Maker · By Sang Hendrix

[ANSWERED] Plugin incompatibily fix

A topic by SirLovealot created 46 days ago Views: 339 Replies: 6
Viewing posts 1 to 3
(1 edit)

Hello SangHendrix,
While working on my project, I noticed that there are plugin incompatibilities – specifically between the DotMovePlugin and the third-party plugin Pocket Events/MapInventory by PhoenixKagedesu.
I created a plugin that catches the error TypeError: character.centerRealX is not a function and allows both to work together harmoniously.
If you’re interested, I’d be happy to send you the plugin file.
You can offer it yourself if you want, but I’d also be glad to host it. I’m not looking for any money – I just want to give something back to the community.

Developer (3 edits)

Hello, if it works for you, you should keep it. Modification should be only for the person who modifies it, as it's also my terms of use.

If it's only DotMove that you modified then feel free to do what you want (but still respect the terms of use of DotMove). DotMove itself is an open source plugin.

Hello SirLovealot, I saw the issue you had with Kagedesu plugins compatibility and had the same issues with them as well as using QJprojectiles (character.centerrealx crashing the game), I would be really interested by the fix u made if you are still good to share it of course, it could be really helpful.

I also saw your two fix on animation solution blinking and loading issue on web and I was the user that Sang mentioned to had those same issues, I tried you fix but it seems to have a typo issue when I put it in a blank .js, do u mind to share your SF_CharFrameGuard_MZ.js fix by any chance ?

Thanks again for your work on this as I battled with those issues for a moment without any idea how to fix them :)

(1 edit)

Here are the two scripts on Google Drive:
https://drive.google.com/drive/folders/1Lx3_1KdHMz1DUMJA8kxnrLIpAF6N3KBw?usp=sharing

Compat_DotMove_PKD_DotMove.js fixes "TypeError: character.centerRealX is not a function" by adding the missing centerRealX/centerRealY at runtime. No parameters required. Load it after DotMoveSystem & PKD_PocketEvents. Both before HendrixPlugins.

About the plugin SF_CharFrameGuard_MZ.js:
Activate it in the Plugin Manager below Hendrix_Animation_Solution / Hendrix_Action_Engine.
I can’t say how it works together with QJprojectiles since I don’t use it – I stick to the Hendrix ecosystem. But you can give it a try.

All plugins are free to use. Feel free to modify or adapt them however you like, also for commercial projects. I’d appreciate a credit, but it’s not mandatory. If you want, you can also send me a copy of your game as a thank you if it helped you.

The comments in the script are unfortunately in German, but I’ll translate them into English once I have time. Have fun with it, and I hope it solves your problem as it did for me.

Thank you so much, the SF_CharFrameGuard_MZ.js seems to be working great, no more spritesheet blinking on web browser for now, as for the Compat_DotMove_PKD_DotMove.js It doesn't solve the QJprojectiles crash issue when changing maps but maybe it's not related.

For the loading issue, the fix is to replace the first block by the second directly inside the Animation Solution right ? 

I'll credit you and send you a copy of the game as soon as a playable build is released, thanks again for sharing your work on theses fix.

(1 edit)

Yes, just look for that line and simply comment it out. In case you want to restore it later. For me it worked well, and if it also works without it, that’s fine too. Especially in connection with my Farming Plugin from DSI I tinkered around with it. Give it a try. Maybe I also mixed something up: also try this fix I still have up my sleeve AND that ist only fix I actually use and it works for me:

//const _Scene_Boot_isReady = Scene_Boot.prototype.isReady;

//Scene_Boot.prototype.isReady = function () {

    // Make sure preloaded images are ready

  //  if (enablePreload) {

        // Check preload status

    //    const status = PermanentImageCache.getLoadingStatus();

      //  if (status.total > 0 && status.loaded + status.failed < status.total) {

        //    return false;

        //}

    //}

    //return _Scene_Boot_isReady.call(this);

//};

// === SF Safe Preload Hook (replaces the old isReady hook) ===================

// Purpose:

//  - Waits until the Hendrix preloader is finished (loaded+failed == total).

//  - Prevents infinite loops when files are missing or status gets stuck.

//  - Logs cleanly if a timeout occurs.

//

// Usage:

//  - Comment out the old block.

//  - Insert this block below.

//  - Can be used unchanged with your enablePreload flag.

// ============================================================================

const _Scene_Boot_isReady = Scene_Boot.prototype.isReady;

Scene_Boot.prototype.isReady = function () {

    try {

        // Only check if preload is enabled and the cache API exists

        if (typeof enablePreload !== "undefined" && enablePreload &&

            window.PermanentImageCache && typeof PermanentImageCache.getLoadingStatus === "function") {

            // Query status robustly (in case Hendrix’ method crashes)

            let status = { total: 0, loaded: 0, failed: 0 };

            try {

                const s = PermanentImageCache.getLoadingStatus();

                if (s && Number.isFinite(s.total) && Number.isFinite(s.loaded) && Number.isFinite(s.failed)) {

                    status = s;

                }

            } catch (e) {

                // If status cannot be read, continue boot but log once

                if (!this._sfPreloadLoggedStatusError) {

                    console.warn("[SF Preload] getLoadingStatus() threw an exception. Continuing boot.", e);

                    this._sfPreloadLoggedStatusError = true;

                }

                return _Scene_Boot_isReady.call(this);

            }

            // If there’s nothing to load → continue directly

            if (status.total <= 0) {

                return _Scene_Boot_isReady.call(this);

            }

            // Check progress

            const done = status.loaded + status.failed;

            const total = status.total;

            // Initialize progress tracker

            if (this._sfPreloadLastDone == null) this._sfPreloadLastDone = -1;

            if (this._sfPreloadStallFrames == null) this._sfPreloadStallFrames = 0;

            // If progress was made → reset stall counter

            if (done !== this._sfPreloadLastDone) {

                this._sfPreloadLastDone = done;

                this._sfPreloadStallFrames = 0;

            } else {

                // No progress this frame → increase stall counter

                this._sfPreloadStallFrames++;

            }

            // Maximum allowed wait frames (≈5 seconds at 60 FPS)

            const MAX_STALL_FRAMES = 300;

            // Not finished yet?

            if (done < total) {

                // As long as we see progress or are below timeout → wait

                if (this._sfPreloadStallFrames < MAX_STALL_FRAMES) {

                    return false; // Scene not ready yet

                } else {

                    // Timeout: continue anyway, but log a warning

                    if (!this._sfPreloadTimedOutOnce) {

                        console.warn(

                            `[SF Preload] Timeout after ${MAX_STALL_FRAMES} frames. `

                            + `Progress: ${done}/${total} (failed: ${status.failed}). `

                            + `Starting scene anyway.`

                        );

                        this._sfPreloadTimedOutOnce = true;

                    }

                    // Falls through and lets Scene_Boot continue normally

                }

            }

            // Finished (done >= total) → continue normally

        }

    } catch (err) {

        // If something unexpected happens here, don’t block boot

        console.warn("[SF Preload] Unexpected error in boot hook. Continuing.", err);

    }

    return _Scene_Boot_isReady.call(this);

};

// ============================================================================

// End SF Safe Preload Hook

other question: Do you use this plugin? https://qiujiu.itch.io/qj-mapprojectilemz I think it can collide hard with Hendrix plugins.

Hi thanks! So I can add the code below in a new .js file called SF_Safe_Preload_Hook.js behind the hendrix animation one to use it as a patch (so It would work with new updates) rather that edit the plugin each times right ? 

And yes I use qiujui map projectiles, It seems to work the only crash is if I shoot a projectile and change map before It reached his impact then It will crash.