MZ - Cae_Tweaks - lots of little features

● ARCHIVED · READ-ONLY
Started by caethyril 72 posts Page 2 of 4 View original ↗
  1. For D20 (reinforcements) load order shouldn't matter, because all it does on load is define & register the plugin command for later use.
  2. caethyril said:
    For D20 (reinforcements) load order shouldn't matter, because all it does on load is define & register the plugin command for later use.
    I'm sorry, what's the difference between D18 and D20?
  3. I believe D18 combines troops together into a single one right from the start (to get over the hardcoded editor limit of placing enemies in a troop), while D20 brings in a new troop set as reinforcements mid-fight via if I understand correctly!

    Also, super amazing set of features here, Caethyril! Thank you very much for sharing. I can definitely see myself making use of a fair few of these~
  4. FrigidGaze is correct: if you just want more enemies per troop, use D18. :kaohi:
  5. Good evening! It seems that Windows Defender is blocking certain plugins. Is this something to be expected or should something be fixed?
  6. xeneeve said:
    Good evening! It seems that Windows Defender is blocking certain plugins. Is this something to be expected or should something be fixed?
    Recently, one of my plugins was getting blocked by Windows Defender if users were using Edge or Chrome to download it. Firefox downloaded fine.

    A thorough scan on my side says there was no actual virus.
  7. This plugin is awesome, love your other work as well. Thank you for making this! :LZYgrin:
  8. Updated to v13!
    changes
    • Standardised boot patches and parsing of plugin parameters & event tags. Comment tags now respect Toggle Skip. Rewrote tags quick reference section.
    • M07: added luck effects for counter, reflect, enemy item/gold drops, and escape ratio. Each sub-feature can now be toggled independently via parameters.
    • M08: added state for any battler with TP > 0. This is added/removed "properly", so it will trigger add/remove messages etc. Also added crit effect for block popups. Both of these can be configured via parameters.
    • M09: now tpRate returns 0 if max TP is 0. By default the core scripts never call that method, but plugins or script calls might.
    • M16: now performs Recover All on actor copy, to avoid everlasting states from the actor. Now also grants the enemy their actor's guard skill.
    • M17: Auto Battle now evaluates follow-ups. For random follow-ups, it guesses one, rather than evaluating each possibility.
    • M20: the <cast state> notetag now supports multiple state IDs: all states will be added. Cast states now remove on cast end; this reverts the v04 change.
    • M22: added battler refresh triggers. This may help to resolve some compatibility issues or niche bugs.
    • M25: now triggers battler refresh for <no weapon>. Added an earlier trigger to account for a change in attack animation. Added check for M16 actor references.
    • M29: fixed cost-stacking bug for good *touch wood*. It was related to merging core and custom MP/TP costs.
    • M30: added "Image Override" parameter, allowing you to replace the padlock SVG with a bitmap if you prefer.
    • M31: events now lock correctly on follower trigger.
    • M32: fixed a typo...the parameter shows up now. O_o
    • M33: now enemies should recognise their added skills! Implemented <ai strictness: X> trait tag. Corrected a mix-up with the Min/Max combine rules.
    • Q02: offsets now affect the home XY, not just popup XY. E.g. for state overlay positioning.
    • Q03: no longer requires Q09 to show rates/resists. Added "Show State Icons" parameter.
    • Q11: added "No Offset Anim Pattern" parameter - animations with a matching name will not be subject to <attack anim plus: X>.
    • Q14: \align no longer modifies startX. This could be important for text measurement.
    • Q23: now <offset: X, Y> is supported in comments and the results are cached to reduce CPU usage.
    • Q26: now indicator image is sourced from img/system. This is to ensure it is not cleared from cache on map transition. If you're updating, check parameter Q26 - URL!
    • Q30: missing <gauge offset> value(s) are now taken to be 0. Added "Show Gauge Value" parameter.
    • Q33: now auto-messages are layered under existing UI. Also fixed a logic error regarding \! (wait for next); it was kind of working, but also not.
    • Q37: added safety check for malformed notetags. Now supports comment tags as well as notetags.
    • Q41: added <dim: X> trait tag, e.g. for blindness effects. Also fixed a logic error in culling off-screen lights: it was culling over-zealously.
    • Q45: scrollbars now only show on open windows.
    • Q48: now cursor images are sourced from "img/system". Same reason as Q26. If you're updating, check parameter Q48 - Cursors!
    • D02: added "Is LoS Blocked" & "Debug Text" parameters. Added <los: result, range, fov> event tag for a mechanical line-of-sight trigger.
    • D07: pitch scaling can now be toggled via the new "Scale with Game Speed" parameter.
    • D12: now force surprise cancels random preemptive and vice versa.
    • D15: now reads button style at runtime, in case you've customised your game's CSS.
    • D23: added "Integer Only" parameter and implemented replacement Math.random.
    • D24: audio cache should now use the correct keys! Whoops.
    additions
    • M34: adds notetags for trait objects that affect the chance of successful escape for the bearer or their opponents.
    • M35: adds user-defined party battle commands based on switches: when the switch is off, the command is enabled; when the command is OK'd, the switch turns on and the game checks for troop events. E.g. for unique boss mechanics.
    • Q49: various customisations for Show Choices:
      • Vertically align choice window independently of closed message.
      • Align choice text based on horizontal window alignment.
      • Merge consecutive Show Choices commands into a single block.
      • Hide and/or disable choices using plugin commands.
      • Show choices inlined within the message window.
      • Randomly shuffle choice order.
      • Show a choice help window with different text for each choice.
  9. thank you, more goodies!
  10. Updated to v14!
    • Added optional "Tag Names" plugin parameter. Allows customisation of all this plugin's tags, in case of conflicts with other plugins (or to work around my poor naming sense).
    • M09: "Default Max TP" now correctly skips if blank.
    • M13: should actually work now. Maybe I forgot to test it before. :kaoswt2: Also added "Max Multiplier" parameter, to scale the encounter rate's random variation.
    • Q03: fixed element/state heading alignment offset that was introduced in v13. Also removed the Language parameter from Q03 - Param Names! If you're updating, you can reset the parameter to default:
      • Right-click the parameter -> click "Clear".
      • Then edit the parameter -> click "OK".
    • Q08: no longer applies on last row. E.g. Input Number with 2+ digits should now work correctly again.
    • Q09: fixed the text codes \{, \}, and \fs[n]. They were broken since the "affect all windows" update in v06, but I never noticed because I hardly ever use them. :kaoslp:
    • Q17: now accounts for menu layout changes, e.g. Q50. Now supports %1 = command symbol in "Unknown Description" - this can help figure out unknown command symbols if you want to add a description. Also removed the Language parameter from Q17 - Descriptions! See Q03 update for more info.
    • Q23: now caches correctly for untagged events. This should reduce CPU usage.
    • Q25: reworked the "Empty Partitions" parameter into "Partition Colour" - same functionality, more flexibility.
    • Q37: added support for orbiting character 0 = screen centre.
    • Q49: merged choice blocks no longer spill into earlier choice blocks in the same event. Made inline choice window width independent of Touch UI status. Also, now the Q07-disabled-patch only applies while choices are inlined.
    • D02: now the "Is Los Blocked" parameter should actually apply (there was a typo). Also the <los> notetag no longer breaks when loading from a map to the same map.
    • D21: added "Track Autosaves" parameter - when enabled, autosaves don't count towards the Save Count statistic.
    New additions:
    • M36: adds a command window to the Gameover screen. Supports "return to title", "options", "load screen", and "load last save".
    • M37: switches/variables can be set to persist across playthroughs, and can be displayed as in-game options. Saves data to new "persist" save file for easy reset.
    • Q50: allows swapping the 3 basic menu alignments (command, help, touch ui). Also supports addition of a "mini help" window in the empty central touch ui area.
  11. caethyril said:
    M36: adds a command window to the Gameover screen. Supports "return to title", "options", "load screen", and "load last save".
    I absolutely cannot believe this isn't part of MZ by default
  12. Hi Caethyril, sorry for the inconvenience. I wanted to ask you if you have any plugin that fixes the overlapping in TPB System (wait). I would like the characters to wait until their partner has finished his action and that happens most of the time. Unless two characters have a similar load on the time bar and that's when the turns overlap and both characters act nearly at the same time. It's not that it's a game-breaking bug, but it does make the game look a bit messy.
  13. @Gigadragon78 - I don't think I've noticed any problem like that. If it happens when Cae_Tweaks is the only active plugin, it would be helpful to know exactly how to make it happen. (Remember to save your project to apply Plugin Manager changes before testing!)

    Otherwise, I suggest starting a new thread:
  14. Hi Caethyril, thank you for your prompt reply. I have already tried several blank projects from different versions of Rpg Maker MZ and it is still there. The issue is that it is very difficult to reproduce since it happens randomly. Thank you very much for taking the time to answer me.
  15. Hi caethryil, thanks for your tweaks and for making each feature its own code block so that we can easily delete the features that we don't need. I've found the Game Speed option so useful for playtesting (I'm also using the Pause Music and Clipboard Copy Error Message features).

    I do have a bug to report though for the Full Screen option (feature Q47): if I turn it on in Options, the game becomes full screen indeed, but if I exit the game (using your Q12: Quit Game feature), the game doesn't restart in full screen - instead, it's the original windowed size with the addition of thin black bars on both sides, and moved to the top left corner of my monitor. If I look at the Options menu now, full screen is off.

    If I exit the game again, without turning full screen on again, the game starts normally with the original window size, not full screen, and in the center without the thin black bars.

    This occurs in a new project with no other plugins except yours (the full version).

    (Side note: I had written my own full screen plugin, that calls Graphics._switchFullScreen() when the option is changed, but for some reason turning full screen off in the Steam Deck would cause the game to freeze, so I was trying to see if I should try a different fullscreen plugin.)
  16. SeaPhoenix said:
    I do have a bug to report though for the Full Screen option (feature Q47): if I turn it on in Options, the game becomes full screen indeed, but if I exit the game (using your Q12: Quit Game feature), the game doesn't restart in full screen - instead, it's the original windowed size with the addition of thin black bars on both sides, and moved to the top left corner of my monitor. If I look at the Options menu now, full screen is off.
    Oops. Yes, confirmed! I thought I tested that, maybe something changed. :kaoslp:

    Until I get around to releasing v15, you can try this code instead:
    updated Q47
    JavaScript:
    // Q47) Adds in-game option to toggle full-screen.
    void (() => { if (!CAE.Tweaks.Q47) return;
    'use strict';
    
        /** Internal label for new option. @type {string} */
        const KEY = CAE.Tweaks.Q47.KEY; // "fullscreen";
    
        /** Display value for new option. @type {string} */
        const TXT = CAE.Tweaks.Q47.TXT; // "Full Screen";
    
        /** Default value: `true` = full-screen, `false` = windowed. @type {boolean} */
        const DFAULT = Graphics._isFullScreen();
    
        /** Private value storage for new option. @type {boolean} */
        let isOn = DFAULT;
    
        /**
         * If `true`, skip usual `updateConfig` process.
         * Designed to work around NWJS `adjustWindow` pulling the game out of full-screen.
         * Approach chosen due to async request structure for fullscreen API.
         * @type {boolean} @since v15
         */
        let skipConfig = false;
    
        /**
         * Updates config to match full-screen status.
         * @returns {boolean}
         * `true` iff config was updated.
         */
        const updateConfig = function() {
            if (skipConfig)
                return Graphics._requestFullScreen(), skipConfig = false;
            const v = ConfigManager[KEY];
            const f = !!Graphics._isFullScreen();
            if (!f) { // for proper resize in case boot adjustment was done in fullscreen
                const sb = Scene_Boot.prototype;
                sb.adjustWindow.call(sb);
            }
            if (v === f)
                return false;
            ConfigManager[KEY] = f;
            const sc = SceneManager._scene;
            if (sc instanceof Scene_Options) {
                const w = sc._optionsWindow;
                w.redrawItem(w.findSymbol(KEY));
            } else
                ConfigManager.save();   // Scene_Options saves on exit
            return true;
        };
    
        /**
         * Updates full-screen status to match config value.
         * @returns {boolean}
         * `true` (in theory, `false` if request not sent - async makes that tricky).
         */
        const updateScreen = function() {
            const v = ConfigManager[KEY];
            if (v)
                Graphics._requestFullScreen();
            else
                Graphics._cancelFullScreen();
            return true;
        };
    
        // Sync config to full-screen state.
        for (const e of [
            // modern standard
            "fullscreenchange",
            // back-compatibility
            "webkitfullscreenchange",
            "mozfullscreenchange"
        ])
            document.addEventListener(e, updateConfig);
    
        // Update full-screen status when config value is changed.
        Object.defineProperty(ConfigManager, KEY, {
            get: function( ) { return isOn; },
            set: function(v) { isOn = !!v; updateScreen(); },
            configurable: true
        });
    
        // Patch - add new option.
        void (alias => {
            Window_Options.prototype.addGeneralOptions = function() {
                alias.apply(this, arguments);
                this.addCommand(TXT, KEY);
            };
        })(Window_Options.prototype.addGeneralOptions);
    
        // Patch - accommodate new option.
        void (alias => {
            Scene_Options.prototype.maxCommands = function() {
                return alias.apply(this, arguments) + 1;
            };
        })(Scene_Options.prototype.maxCommands);
    
        // Patch - add new option to config file data.
        void (alias => {
            ConfigManager.makeData = function() {
                const o = alias.apply(this, arguments);
                o[KEY] = this[KEY];
                return o;
            };
        })(ConfigManager.makeData);
    
        // Patch - read new option from config file data.
        void (alias => {
            ConfigManager.applyData = function(config) {
                alias.apply(this, arguments);
                this[KEY] = this.readFlag(config, KEY, DFAULT);
            };
        })(ConfigManager.applyData);
    
        // Patch - prevent window resize/movement from pulling game out of full-screen.
        void (alias => { // v15
            Scene_Boot.prototype.adjustWindow = function() {
                if (Utils.isNwjs() && ConfigManager[KEY])
                    skipConfig = true;
                alias.apply(this, arguments);
            };
        })(Scene_Boot.prototype.adjustWindow);
    
    })();
    Basically, I added:
    • A patch for Scene_Boot#adjustWindow. This method is responsible for moving & resizing the NWJS app, but pulls it out of fullscreen, e.g. applied when the options are loaded.
    • A corresponding bit of code to the start of updateConfig.
    • A little extra code to updateConfig, to eliminate black sidebars if the window was originally in fullscreen when adjustWindow was called.
    (I also removed the check for existing fullscreen from updateScreen, since it was potentially incorrect due to failing to detect pending fullscreen.)
  17. Thanks so much for the quick fix! It seems to work fine now on my PC, and I'll try to do more tests on other devices.

    One thing I noticed, though it's not a bug, is that when you boot the game in full screen, turning full screen off will have the game window on the upper left instead of centered (like it usually is when the player starts the game in windowed mode). But the player can just move the window, at least on computers, and restarting the game with full screen off will have it in the center once again.

    Thanks again!
  18. @SeaPhoenix - great! I'll look into addressing the position thing for v15. :kaohi:
  19. Hello caetryril. This is a great plugin with lots (and I mean, LOTS) of useful features.

    I'd like to report a bug (at least from what I understand it should do) for Q48 - Choice Controls - Enable Merge:

    When you have choices inside the last choice from the first event command, the merge happens with the choices inside instead of with the ones outside.
    I don't know how to clearly explain it but the following screens should make it clear:

    1723590272585.png

    1723590290125.png

    So I have the first level where Choice 1-6 and 7 merges correctly at first, but once I add choices inside Choice 6, Choice 7 starts merging with those ones inside instead of with 1-6.
  20. Xelion said:
    When you have choices inside the last choice from the first event command, the merge happens with the choices inside instead of with the ones outside.
    Oh wow, I just completely forgot to test for nested choices. :kaoswt2:

    v14 has a function called mergeLongChoices (lines 18111~18140); try replacing it with:
    updated code
    JavaScript:
        const mergeLongChoices = function(list) {
            /** Deep clone of command list, to avoid mutating map data. @type {EventCommand[]} */
            const r = JsonEx.makeDeepCopy(list);
            /** Commands to merge at next opportunity. @type {EventCommand[][]} */
            const e = [];   // v15 - account for indent
            // Merge (End, Show) choice command pairs.
            for (let n = r.length; n--;) {
                const c = r[n];
                if (c.code === 102) {   // Show Choices
                    if (n > 0 && r[n - 1].code === 404) {   // End Choices
                        (e[c.indent] ??= []).unshift(c);
                        r.splice(--n, 2);
                    } else if (e[c.indent]?.length) {
                        merge102(c, ...e[c.indent]);
                        delete e[c.indent];
                    }
                }
            }
            // Now tidy up the When indices.
            const p = [];   // v15 - account for indent
            for (const c of r)
                switch (c.code) {
                    case 102:   // Show Choices
                        p[c.indent] = 0; break;
                    case 402:   // When
                        p[c.indent] ??= 0;
                        c.parameters[0] = p[c.indent]++;
                        break;
                }
            return r;
        };