Caethyril's MZ Plugins

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,061
Reaction score
1,484
First Language
EN
Primarily Uses
RMMZ
Hmm...once I turn off the VisuStella Core plugin, it works fine. That's something many people will use, so you might want to check on that.
Oh, good to know!
I'm not sure where VisuStella is adjusting the window height (their plugins are all obfuscated so I can't really check), but it seems their Core Engine has its own parameters for that. In the Plugin Manager, find the following parameter:
  • Menu Layout Settings > Scene_Title > JS: X, Y, W, H (directly under Command Window Settings)
The default value is this:
JavaScript:
const offsetX = $dataSystem.titleCommandWindow.offsetX;
const offsetY = $dataSystem.titleCommandWindow.offsetY;
const rows = 3;
const width = this.mainCommandWidth();
const height = this.calcWindowHeight(rows, true);
const x = (Graphics.boxWidth - width) / 2 + offsetX;
const y = Graphics.boxHeight - height - 96 + offsetY;
return new Rectangle(x, y, width, height);
Change the rows = 3 part to rows = 4.
Edit @SimProse: actually it looks like I just had the plugin order wrong, sorry! Try this instead (click + drag to rearrange the Plugin Manager list, you can load other plugins between them if you like):
  • VisuMZ_0_CoreEngine
  • Luna_Quit2Desktop
  • Cae_TitleMenu
Basically, just make sure my plugin is loaded after other title-screen plugins. Unless you don't need any of the Cae_TitleMenu features other than menu rows, in which case you now know you can do that with VisuStella's Core Engine instead~ :kaophew:

Edit 2 @Raith: just released Cae_PictureTouch v1.4! There's now a Disable on Trigger plugin parameter that you can turn on to help avoid mass-queuing events: it makes binds disable themselves after triggering. You can then re-enable the bind in its event or script using the new Enable/Disable Bind plugin command (or the script equivalent, see the plugin help).

It seems to be working OK, but let me know if you find any problems with it~ :kaothx:
 
Last edited:

RK DracoRoy

Fire Emblem RPG Gamer
Veteran
Joined
Jun 29, 2017
Messages
258
Reaction score
73
First Language
English
Primarily Uses
RMMV
I got one idea based on the Consume Eval. So in regards to skills and items, you could put in the same conditions like in Consume Eval, so the skill / item can only select those who pass the condition.

Can be an option to either grey out or hide if none passes.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,061
Reaction score
1,484
First Language
EN
Primarily Uses
RMMZ
@RK DracoRoy kinda like Yanfly's Selection Control from MV, right? It's a little different, in that consumption is based on the item (remove it from inventory), but the target is based on menu/battler selection. I'm surprised VisuStella hasn't released something with an equivalent feature...or maybe I've just overlooked it. :kaoslp:

Either way, I was planning on upgrading ConsumeEval to include other skill/item effects at some point, e.g. subskills, so I'll look into it~ :kaothx:

(I haven't released anything lately because I've been spending less time on RM, plus I've been hopping between several different plugins rather than just one. Will hopefully have something to show this month, though!)
 

RK DracoRoy

Fire Emblem RPG Gamer
Veteran
Joined
Jun 29, 2017
Messages
258
Reaction score
73
First Language
English
Primarily Uses
RMMV
Right! I meant to say a plugin that handles selection but with how the conditions can be written like Consume Eval.
Code:
<SelectEval: (target.isStateAffected(x))>
I can definitely wait a while though and I understand that. Lately, I'm slowly trying to port most of my database work from MV to MZ. I'm enjoying this engine so far.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,061
Reaction score
1,484
First Language
EN
Primarily Uses
RMMZ
@RK DracoRoy OK I've just released Cae_OnUseEffects, which covers a variety of stuff for items & skills including subskills, target/selection restriction, hide/disable/consume conditions, etc. The conditions are slightly different from Cae_ConsumeEval: you need to use return, e.g.
Code:
<consumable: return user.level < 10;>
Hopefully I've ironed out all the bugs...the target restriction stuff in particular took me a while to get working properly. :kaoslp:

I also removed Cae_ConsumeEval from the opening post (it's still in the drive folder) since this new plugin should cover that. :kaopride:
 

RK DracoRoy

Fire Emblem RPG Gamer
Veteran
Joined
Jun 29, 2017
Messages
258
Reaction score
73
First Language
English
Primarily Uses
RMMV
Thanks, @caethyril. I'm going to going to be trying this out soon when I get back and let you know of anything.

And I saw Javascript parameters referencing Hit and Avoid. I had an idea for this which I'll explain later with how the subskills and target scopes go.

--------
Update
--------
I looked at the JS parameters of Hit and Evade and played around with these. I thought maybe I could do some kind of accuracy - evade formula in JS parameter form and this went pretty well.

JS: Hit Rate
------------
Code:
// Accuracy (This is calculated before Evade Rate)

return 1.00 // Accuracy is set to 1 so they'll never miss but before evade is calculated. They'll always perform their evade motion as a result.

JS: Evade Rate
----------------
Code:
// Variables

const attacker = this.subject();
const defender = target;
const skill = this.item();

// Skill Success Rate

let skillHitRate = skill.successRate * 0.01;

// User's Hit Rate

let userPhysicalHitRate = attacker.hit;
let userMagicalHitRate = attacker.hit;
let userCertainHitRate = 1.00;

// Target's Evade Rate

let targetPhysicalEvadeRate = defender.eva;
let targetMagicalEvadeRate = defender.mev;
let targetCertainEvadeRate = 0;

// Final Result

if (this.isCertainHit()) {
return 1 - (skillHitRate * (userCertainHitRate - targetCertainEvadeRate))
} else if (this.isMagical()) {
return 1 - (skillHitRate * (userMagicalHitRate - targetMagicalEvadeRate))
} else {
return 1 - (skillHitRate * (userPhysicalHitRate - targetPhysicalEvadeRate))
}

About the problem, any items with target filter conditions returning false aren't shown in battle. Skills are fine, still shown but greyed out as intended.
 
Last edited:

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,061
Reaction score
1,484
First Language
EN
Primarily Uses
RMMZ
About the problem, any items with target filter conditions returning false aren't shown in battle. Skills are fine, still shown but greyed out as intended.
Yep, that was an oversight; the default behaviour is to hide unusable items in battle. I updated the plugin to v1.1 (same link), which should fix that. I added a bunch of new features too, mostly more formulae like crit rate/damage, counter/reflection rates, etc. The plugin help now lists hit/evasion/crit/etc formulae equivalent to the defaults, for reference purposes~ :kaopride:

Also, um...the code example is neat, and helped give me ideas for some of the v1.1 stuff, but could you put the part between "===============" in a spoiler? At least for me, the max-width code boxes push the right-hand forum sidebar (Latest Posts etc) off-screen, and make the post area uncomfortably wide. In case you're unsure how, typing [spoiler]text[/spoiler] gives this:
text
Thanks! :kaothx:
 

RK DracoRoy

Fire Emblem RPG Gamer
Veteran
Joined
Jun 29, 2017
Messages
258
Reaction score
73
First Language
English
Primarily Uses
RMMV
Yep, that was an oversight; the default behaviour is to hide unusable items in battle. I updated the plugin to v1.1 (same link), which should fix that. I added a bunch of new features too, mostly more formulae like crit rate/damage, counter/reflection rates, etc. The plugin help now lists hit/evasion/crit/etc formulae equivalent to the defaults, for reference purposes~ :kaopride:

Also, um...the code example is neat, and helped give me ideas for some of the v1.1 stuff, but could you put the part between "===============" in a spoiler? At least for me, the max-width code boxes push the right-hand forum sidebar (Latest Posts etc) off-screen, and make the post area uncomfortably wide. In case you're unsure how, typing [spoiler]text[/spoiler] gives this:
text
Thanks! :kaothx:
I took those two parts in quotations out.

I'll play around with a bit more on this update later like Critical rate and other things when I return.

But I notice that when I set the visible but not selectable items to true, the top parameter, it works but it unfortunately shows items that are set to Menu Screen and Never.

I tried this to see would it hide the items set under "Menu" or "Never", but they still show.
Code:
<show condition: return ($gameParty.inBattle())>
 
Last edited:

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,061
Reaction score
1,484
First Language
EN
Primarily Uses
RMMZ
(I think you misunderstood: I was asking for you to put the code boxes in a spoiler, i.e. everything between the first ===== and the second one. Don't worry, though, it's not super important~ :))

I notice that when I set the visible but not selectable items to true, the top parameter, it works but it unfortunately shows items that are set to Menu Screen and Never.
Oh wow, how did I miss that? :kaoswt: Luckily it looks like it was an easy fix, the plugin is v1.2 now, same link. Thanks for letting me know about it! :kaojoy:

If you wanted to do this with a condition, I think one of these might work:
Code:
<show condition: return !$gameParty.inBattle();>
<show condition: return user.isOccasionOk(item);>
Better to have it work as intended, though!
 

RK DracoRoy

Fire Emblem RPG Gamer
Veteran
Joined
Jun 29, 2017
Messages
258
Reaction score
73
First Language
English
Primarily Uses
RMMV
@caethyril This updated guide helps since there's other action formulas and I'll know what to put in for them to work as intended.

So about the "Miss" text, i did put in multiple ones like "Well! | Try Again!" It works randomly, but there's instances where you'll see them bunched up together. I was wondering if "Critical" could show as a text popup for critical damage since MZ uses text and not the picture itself, like above the damage value.

And I've updated the earlier post with the spoiler tags!

--------------------
Update

Using an item with the consumable tag crashes with a length undefined error.
I used this <consumable: return target.paramBase(2) < 50> and even your example led to the crash.

And earlier, I thought there was an additional problem (not a crash), because I got items that permanently grows user's stats and I have <target filter: *same script as the consumable*>.

I didn't want to use "target.atk" because I'm wanting to reference the base stats themselves without anything equipped. I thought paramBase would even include values that permanently grow (under Skills -> Effects -> Other -> Grow)
 

Attachments

Last edited:

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,061
Reaction score
1,484
First Language
EN
Primarily Uses
RMMZ
O-K, sorry for the delay, but OnUseEffects v1.3 is out now~
  • I fixed the "length of undefined" error, just me being clumsy. It was something that applied to checking certain formulae (consumable, crit damage, or get substitute) outside of battle. Thanks for the error report & screenshot, very helpful! :kaothx:

  • The counter-hit/reflection order options (not the cnt/mrf formulae, the other stuff) have been marked experimental because...well, they seem to work, but I can't get the damage to always pop up in-sync. I think I'd need a more invasive approach (i.e. complete override) to get it working as I want, but decided to avoid trying that for now because it was delaying the update. :kaoslp:

  • "Hide Zero Damage Popups" has been replaced with a formula, for more flexibility.

  • There's now an option to increase the width of text popups, should help to avoid the squishing. Speaking of text popups...

  • You can set up custom "extra" popups with scripted conditions, e.g. "Crit!" when you land a critical hit. They'll appear above the damage. There are some examples present by default~

  • There's an <effect conditions> notetag now, so you can put a bunch of effects on an item/skill and script when each one should or shouldn't apply. :kaojoy:
And earlier, I thought there was an additional problem (not a crash), because I got items that permanently grows user's stats and I have <target filter: return target.paramBase(2) < 50>.

I didn't want to use "target.atk" because I'm wanting to reference the base stats themselves without anything equipped. I thought paramBase would even include values that permanently grow (under Skills -> Effects -> Other -> Grow)
Actually, the paramBase method for actors returns a value taken directly from their class at their current level. If you want to check permanent additions, try this instead:
Code:
<target filter: return target._paramPlus[2] < 50;>
I.e. only allow targets with less than 50 permanent bonus to their ATK? In case it helps, I recently gave a brief explanation of the various (default) components of basic parameter calculation in this post (includes some supporting core script excerpts):
The thread is about MV, but the same principles apply for MZ.

As an aside: I'm aware that valid targets for items used via the menu aren't visually distinguishable from invalid targets...that's default behaviour and I haven't attempted to tackle it (yet?).
 

Junebgt12

Warper
Member
Joined
Oct 12, 2020
Messages
1
Reaction score
0
First Language
Tagalog
Primarily Uses
RMMZ
Caethyril's RMMZ Plugins
Updated 2020-10-27: General - Cae_OnUseEffects v1.3
Looking for RPG Maker MV plugins? Click here!

Features :kaohi:
I've made some plugins for RPG Maker MZ! Here's a list of them with brief feature descriptions.
  • The dates are when each plugin was last updated.
  • For plugins marked script, JavaScript knowledge is strongly recommended.
  • "See also" lists similar and/or alternative plugins; these are not guaranteed to be compatible.
Plugins:
  • General (19) – standalone plugins for various purposes.
    [*]
  • Extensions (0) – plugins that add features to other people's plugins.
    Nothing here yet! :kaophew:
  • Fix/Patch (1) – patches for unexpected behaviour seen in code by other authors.
    • v1.0 CaeF_RestoreRouteFix 2020-08-21 - patches oversight in core scripts (details here)
      When an auto move route is restored, one command will no longer be skipped.
    [*]
All of the above can be viewed and downloaded here:
Suggestions for improvements or additional features are welcome!

How to Use :kaopride:
  1. Download the plugin file (e.g. Cae_BattleMessages.js).
    Google Drive has a download button in the top-right (arrow pointing down into an open box).
  2. Place it in your project's folder, under js/plugins.
  3. Open your project in RPG Maker MZ.
  4. Go to Tools > Plugin Manager.
  5. Double-click an empty line to add a new plugin.
  6. Select the plugin from the Name list.
To edit the values of any of the parameters displayed to the right of the drop-down, double-click them in the list. The more complicated plugins have details for use in their help description; you can view this help via the Plugin Manager. Additional notes:
  • Avoid renaming my plugins.
    (Renamed plugins won't see their plugin parameters.)
  • Save your project after making changes in the Plugin Manager.
    (Plugin changes are only applied to the game after saving.)

Troubleshooting :kaoback:
If you experience problems with any of these plugins that you want to report, please post in this thread! Information that can be helpful:
  • Instructions stating how to reproduce the problem in a new project.
    (If I can't reproduce the problem, I probably can't help you.)
  • A screenshot of the console when the unexpected behaviour occurs.
    (You can open the console by pressing F8 during test-play.)
Alternatively, you can make a thread in JavaScript/Plugin Support.

Terms of Use :kaothx:
These plugins are all free to use, modify, and redistribute!
For the standalone plugins ("General" category), these conditions apply:
  1. None of the original plugin header may be removed.
  2. Credit should be given to Caethyril for the original work.
Happy RPG Making~! :kaoluv:
Thank you cant wait to try it...
 

defective42

Villager
Member
Joined
Sep 25, 2020
Messages
7
Reaction score
4
First Language
English
Primarily Uses
RMMZ
Using Cae_ChoiceShuffle I get Syntax Error Unexpected Identifier at startup, before the title screen. Even with all other plugins off. MZ
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,061
Reaction score
1,484
First Language
EN
Primarily Uses
RMMZ
Using Cae_ChoiceShuffle I get Syntax Error Unexpected Identifier at startup, before the title screen. Even with all other plugins off. MZ
I just tested to be sure and I can't seem to reproduce this error. Are you certain you downloaded it correctly? There is a download button, it looks like an arrow pointing down into an open box. I've seen people try to copy+paste before and end up missing (or adding!) stuff, which causes the plugin to break. >_<

Otherwise, can you post a screenshot of the error message? There's typically a lot of handy diagnostic info there, including line numbers etc. You can either use a snipping/screenshot app, or press Alt+PrtSc to screenshot the active window then paste it into an image editor (e.g. MS Paint), save, and attach to post. :kaothx:
 

defective42

Villager
Member
Joined
Sep 25, 2020
Messages
7
Reaction score
4
First Language
English
Primarily Uses
RMMZ
Hmmm, must have copy and pasted before, because the download works perfectly now. Thanks.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Evil7 added!


I did a bit of a remake on one of the maps, also I made a particle for jumping into the portal, and one for traveling through the portal. I'll probably add more sparkles later to embellish it. :LZSwink:
Polished the animation and added details :kaojoy:
Ami
What do you think about the Wood Bridge inside of Volcano?
Yet another gaming question, i'm currently playing Last of Us 2 and want to get another game to play next but can't decide between Ghost of Tsushima, Miles Morales & Jedi Fallen Order. After the latest mandalorian i AM on a star wars kick, but i also LOVED the last spiderman game that prequels Miles Morales. Ghost of Tsushima is the bottom of my list but i heard it was AWESOME. Just want a good story & fun gameplay.

Forum statistics

Threads
105,677
Messages
1,015,496
Members
137,353
Latest member
vongolavxv
Top