Caethyril's MZ Plugins

● ARCHIVED · READ-ONLY
Started by caethyril 209 posts Page 10 of 11 View original ↗
  1. EXCELLENT plugins, @caethyril !

    I'm requiring some assistance with Cae_OnUseEffects. I'd like to have a skill where I can select any ally to use it on EXCEPT for the caster. They can't be selected at all. For note tags, I've tried <target filter: return user> but I don't think that's enough information there for it to work, since it doesn't work, haha.

    I looked through this thread to see if it's been covered yet, but didn't seem to find anything on it.

    Thanks!
  2. skroberts34021 said:
    Hello! I would like to use Cae_TitleMenu to add a ’New Game’ command to the main menu that only appears once the player has completed one certain ending.

    I know the plugin says “They can be hidden/shown and enabled/disabled with script conditions.” So is there code that I can put in the JS: Visible or JS: Enabled sections to make the ‘New Game’ command only appear if a certain switch is ON, or something similar?
    To use a switch for one of those conditions, you can type:
    JavaScript:
    $gameSwitches.value(123)
    This will be true iff switch ID 123 is currently ON. However, there's a twist...

    Normally switches are part of a playthrough, but the title screen is outside of that. So first you would want some kind of plugin to add custom data (e.g. a persistent switch) that is accessible on the title screen. Maybe you already have one. If not, here are some options that look promising:

    starguy said:
    I'm requiring some assistance with Cae_OnUseEffects. I'd like to have a skill where I can select any ally to use it on EXCEPT for the caster. They can't be selected at all. For note tags, I've tried <target filter: return user>
    :kaohi: Try this instead ("target not equal to user"):

    <target filter: return target !== user;>
  3. caethyril said:
    To use a switch for one of those conditions, you can type:
    JavaScript:
    $gameSwitches.value(123)
    This will be true iff switch ID 123 is currently ON. However, there's a twist...

    Normally switches are part of a playthrough, but the title screen is outside of that. So first you would want some kind of plugin to add custom data (e.g. a persistent switch) that is accessible on the title screen. Maybe you already have one. If not, here are some options that look promising:


    :kaohi: Try this instead ("target not equal to user"):

    <target filter: return target !== user;>

    Yep, that did it! Thanks, @caethyril !
  4. caethyril said:
    To use a switch for one of those conditions, you can type:
    JavaScript:
    $gameSwitches.value(123)
    This will be true iff switch ID 123 is currently ON. However, there's a twist...

    Normally switches are part of a playthrough, but the title screen is outside of that. So first you would want some kind of plugin to add custom data (e.g. a persistent switch) that is accessible on the title screen. Maybe you already have one. If not, here are some options that look promising:


    Thank you for your response.

    I turned on VisuStella's Save Core, added a <Global> tag to Switch 111, turned on your Cae_TitleMenu plugin, typed $gameSwitches.value(111) for JS: Visible and JS: Enabled.

    When I try to launch the game, I get "TypeError undefined is not iterable (cannot read property Symbol(Symbol.iterator)", which I did not get before and does not occur if I turn the JS: Visible and JS: Enabled back to true.

    Might you be able to help me? Thank you for your time.
    Screen Shot 2025-03-01 at 3.08.14 PM.png
    Screen Shot 2025-03-01 at 3.02.55 PM.png
  5. skroberts34021 said:
    I turned on VisuStella's Save Core, added a <Global> tag to Switch 111, turned on your Cae_TitleMenu plugin, typed $gameSwitches.value(111) for JS: Visible and JS: Enabled.

    When I try to launch the game, I get "TypeError undefined is not iterable (cannot read property Symbol(Symbol.iterator)", which I did not get before and does not occur if I turn the JS: Visible and JS: Enabled back to true.
    Cae_TitleMenu doesn't actually use any Symbol properties, so I imagine that's some kind of plugin conflict...

    However, if you're using VisuStella then you can just use their Core Engine's Title Command List plugin parameter instead. Try this:
    • JS: Enable
      JavaScript:
      return $gameSwitches.value(111);
    • JS: Run Code
      JavaScript:
      // Get current start point.
      const { startMapId, startX, startY } = $dataSystem;
      // Set custom start point.
      $dataSystem.startMapId = 53;
      $dataSystem.startX     = 0;
      $dataSystem.startY     = 0;
      // New game as usual.
      SceneManager._scene.commandNewGame();
      // Reset start point.
      $dataSystem.startMapId = startMapId;
      $dataSystem.startX     = startX;
      $dataSystem.startY     = startY;
      I copied the map ID, X, and Y (53, 0, 0) from your screenshot.
    I downloaded VisuStella's Sample Project and tested it, and this seemed to work for me with switch 111 marked as "global". :kaohi:

    [Edit: corrected a typo: I originally forgot to write return for the JS: Enable part. I'd used it in my test, just wrote it wrong here.]
  6. caethyril said:
    Cae_TitleMenu doesn't actually use any Symbol properties, so I imagine that's some kind of plugin conflict...

    However, if you're using VisuStella then you can just use their Core Engine's Title Command List plugin parameter instead. Try this:
    • JS: Enable
      JavaScript:
      $gameSwitches.value(111);
    • JS: Run Code
      JavaScript:
      // Get current start point.
      const { startMapId, startX, startY } = $dataSystem;
      // Set custom start point.
      $dataSystem.startMapId = 53;
      $dataSystem.startX     = 0;
      $dataSystem.startY     = 0;
      // New game as usual.
      SceneManager._scene.commandNewGame();
      // Reset start point.
      $dataSystem.startMapId = startMapId;
      $dataSystem.startX     = startX;
      $dataSystem.startY     = startY;
      I copied the map ID, X, and Y (53, 0, 0) from your screenshot.
    I downloaded VisuStella's Sample Project and tested it, and this seemed to work for me with switch 111 marked as "global". :kaohi:

    Thank you. I was able to use the Title Command List plugin with the javascript above to make the new button appear on the title menu, and it works, but in both my project and VisuStella's Sample Project, for me the new title menu button appears regardless of whether Switch 111 is marked <Global> or whether I use an event to turn it ON or OFF within the game. I tried with different Switches as well.

    You were able to get it so that the title menu originally does not contain the button, then you flip a switch in-game, and then when you return to the title menu afterwards, the button then appears?
  7. skroberts34021 said:
    You were able to get it so that the title menu originally does not contain the button, then you flip a switch in-game, and then when you return to the title menu afterwards, the button then appears?
    Yes, just put return $gameSwitches.value(111); in JS: Show.

    Note the return part! I forgot it in my previous post (now corrected). VisuStella's plugin needs the return because it's function code rather than an eval. :kaoswt:
  8. caethyril said:
    Yes, just put return $gameSwitches.value(111); in JS: Show.

    Note the return part! I forgot it in my previous post (now corrected). VisuStella's plugin needs the return because it's function code rather than an eval. :kaoswt:
    This worked! Thank you so, so much for your clear explanations and your patience. You have really helped me out here.
  9. Another inquiry! Haha. I've made the switch to ATT_Turan's Eval Tags plugin from Visustella and I've got a state that reduces a battler's max hp incrementally every turn.

    With that, using your OnUseEffects plugin, is there a way for me to have the max hp loss show up as a damage popup of sorts? The variable for the lost mhp is 'loss' and it's located in a passive state that every battler would have, and is activated if the state is applied to the battler.
  10. starguy said:
    With that, using your OnUseEffects plugin, is there a way for me to have the max hp loss show up as a damage popup of sorts? The variable for the lost mhp is 'loss' and it's located in a passive state that every battler would have, and is activated if the state is applied to the battler.
    Unfortunately my plugin's custom popups currently (v1.8) aren't very sophisticated:
    • They only offer fixed text, like "Critical" or "Immune"; and
    • They proc when an action deals damage (Game_Action#executeDamage).
    relevant plugin excerpt
    JavaScript:
            /** Evaluates and stores all custom popup data for this action. */
            $.evaluateCustomPopupData = function(...args) {
                $.popups._hide = $.popups.hide?.apply(this, args) || false;
                $.popups._data = $.popups.custom.map(function(o) {
                    return {
                        culr: o.c,
                        text: $.getRandomText(o.l),
                        time: o.t,
                        show: o.f.apply(this, args)
                    };
                }, this) || [];
            };
    
            // Alias! Evaluate custom popup data just before dealing damage.
            void (alias => {
                Game_Action.prototype.executeDamage = function(target, value) {
                    $.evaluateCustomPopupData.apply(this, arguments);
                    alias.apply(this, arguments);
                };
            })($.alias.Game_Action_executeDamage = Game_Action.prototype.executeDamage);
    You may be able to work around the fixed text by replacing the random text selection with an eval. However, by default regen effects aren't processed as actions, so the custom popup won't show in that situation regardless.

    I think the simplest option here would be to find a different custom popup plugin. :kaohi:
  11. caethyril said:
    Unfortunately my plugin's custom popups currently (v1.8) aren't very sophisticated:
    • They only offer fixed text, like "Critical" or "Immune"; and
    • They proc when an action deals damage (Game_Action#executeDamage).
    relevant plugin excerpt
    JavaScript:
            /** Evaluates and stores all custom popup data for this action. */
            $.evaluateCustomPopupData = function(...args) {
                $.popups._hide = $.popups.hide?.apply(this, args) || false;
                $.popups._data = $.popups.custom.map(function(o) {
                    return {
                        culr: o.c,
                        text: $.getRandomText(o.l),
                        time: o.t,
                        show: o.f.apply(this, args)
                    };
                }, this) || [];
            };
    
            // Alias! Evaluate custom popup data just before dealing damage.
            void (alias => {
                Game_Action.prototype.executeDamage = function(target, value) {
                    $.evaluateCustomPopupData.apply(this, arguments);
                    alias.apply(this, arguments);
                };
            })($.alias.Game_Action_executeDamage = Game_Action.prototype.executeDamage);
    You may be able to work around the fixed text by replacing the random text selection with an eval. However, by default regen effects aren't processed as actions, so the custom popup won't show in that situation regardless.

    I think the simplest option here would be to find a different custom popup plugin. :kaohi:
    Ah, understood! Thank you for the response!
  12. Hey hey
    caethyril said:
    Cae_OnUseEffects

    I was wondering if there is a way to use popups to show State Names when they're added to a battler? Also as an feature request for the plugin, the ability to add Icons
  13. Puppet Knight said:
    I was wondering if there is a way to use popups to show State Names when they're added to a battler? Also as an feature request for the plugin, the ability to add Icons
    Not as-is. Like I recently mentioned, my custom popups aren't super sophisticated: they were implemented with the idea of showing damage-related indicators, e.g. crits and elemental weakness/resistance. An array of added state IDs is stored on the action result, but my plugin checks its custom popup show conditions at Game_Action#executeDamage, which happens before effects get applied (see Game_Action#apply). :kaoslp:

    It would be possible to rework my original design into something more flexible, e.g. check the popup conditions also when the popups are created, and add JS support for the popup text. I don't have any plans to do so at the moment, though.

    I found this plugin by triacontane, looks like it has a setting for "add state" popups:
    I don't think it has anything for drawing icons, though.
  14. caethyril said:
    I found this plugin by triacontane, looks like it has a setting for "add state" popups:


    Thank you! i'll take a look
  15. I was using Cae_OnUseEffects and found a weird... bug?

    Basically if I setup a skill like the one below, it won't be used. However when I make the skill do "HP Damage" (but not really since in the action sequence CE I ignore it) the skill gets used. Is it some weird compatibility issue with VisuStella Battlecore?
    Screenshot (47).png
  16. @Hamoody - huh. What happens if you add a new effect, e.g. Add State: {any state} 0%?

    I'm guessing VisuStella (or whatever plugin is using that <Custom Action Sequence> notetag) is removing the Common Event effect. So my plugin sees a skill with no valid effects or formula, and thinks "OK, it can't be used".
  17. caethyril said:
    @Hamoody - huh. What happens if you add a new effect, e.g. Add State: {any state} 0%?

    I'm guessing VisuStella (or whatever plugin is using that <Custom Action Sequence> notetag) is removing the Common Event effect. So my plugin sees a skill with no valid effects or formula, and thinks "OK, it can't be used".
    Sorry for taking a while to reply, got busy yesterday.

    I added the new effect you mentioned and the skill ends up working again. Kind of a weird bug but at least there's a workaround lol
  18. Hey, i am experiencing some strange behaviour when using Cae_DashOpts. When changing the value from the dash speed parameter to <1, the player character moves significantly slower when moving left or up. Moving right or down works fine. Diagonal movement also works fine.

    I am using FOSSIL, Cross Engine and Tyruswoo's MZ Patch for AltimitMovement.

    Nothing pops up in the console.

    Any idea what could be causing this?
  19. @Jenai - I just did 3 tests with only 1 plugin, Cae_DashOpts: I set its Dash Extra Speed parameter to 0.1, then 0.5, then 0.9. For all of these, the player's walking and dashing speeds seemed unaffected by move direction.

    I guess it's a plugin conflict, maybe with Altimit Movement. That's for pixel movement, right? I haven't checked its code, but it might not support fractional speeds: left/up moves decrease X/Y, so if the plugin rounds its distances down then movement in those directions could be slower, particularly if the plugin doesn't track remainders.

    To check, you can turn off all other plugins, save your project to apply Plugin Manager changes, then test. Sometimes conflicts can be fixed by changing the load order: click+drag to rearrange the plugin list in the Plugin Manager. Cae_DashOpts does not change much, so I suggest putting it near the bottom of the list.
  20. There are so many good plugins here! Thanks!

    The flip face plugin is really good! It should come with RM by default, it works really well with the Galv Message Style plugin

    1750697540179.png

    1750697563166.png