MZ How to replicate the item ui in battle, for another skill?

The subject is pretty poor, sorry. Also using my friends account (and computer) with her permission here, too, as she's not well enough to ask this herself.

Issue:

I have a class that I want to be 'good at using items'.

So in battle, if this actor chooses, they can use an item, and then get to take a regular attack/skill/guard after the item use.

If they use attack/skill/guard first, that's the turn done. They missed the window.

If they use an item - they are locked out of using a second item (to prevent chaining potions, for example) so the options are attack/skill/guard/etc.

So the possible combos, for one turn:

item+action,
or,
action.


I've been mulling over how to do this.

I have a bunch of visustella plugins, so modifying the battle menu to use a skill (that looks like the item command) instead of usual 'item' to call a common event seems like the way to go.

The common event handles the +1 action, and locking out item use after. (states)

Where I need help:

I'm stumped on how to get the item window to display, from the common event? I have a dreaded feeling this is 'create a plugin' work, but I'm hoping there's a script call that might replicate the item window in battle, but the docs I've skimmed through so far... no joy.

Anyone got a bit more experience in this area than me that might be able to shed light?
Any change to any UI will require a plugin.

But it might be that for this case you don't need to request one.

What you describe is similar to what has been done by yanfly's instant cast in MV, and Visustella is supposed to have transferred most of yanfly's plugins to MZ.

I don't know the MZ plugins, but I suggest searching them for an 'Instant cast' plugin.
Those usually allow for specific skills to be used during action selection and a follow-on regular skill.
The timing is a bit different than your idea and it might require modifications, but skills and items are basically the same for the engine.
So this might be an easier way to handle things.
I actually did something very similar to this recently… though unlike you, I didn't disable chaining potions (but using two potions ends the turn). I don't know if it'll work for you in MZ using VisuStella, but I could posted it if you want to give it a try. That said, I'd recommend checking first if there's something in VisuStella that already handles this.
Yeah, I'm in that sort of area. I'm picking through the JS (Not too skilled here...)
Battle_scene has the item window stuff, it'll be messy to call that up and include all of the validation that goes with it (being able to target, cancel, etc etc) that's just headache.

I'm using STB by visustella too, so I'm in the process of writing a plugin.

My idea currently:
listen for endAction, check if specific actor, check if action is item use, check for a lock state.

if no lock state, apply that. push actor back into STB queue right away.

if has lock state, do nothing. (lock state will last 1 action/turn whichever...)

should allow item + item, item + action, or just action.



......in theory. Just gotta find if such stuff exists somewhere in the code/plugins.
I actually did something very similar to this recently… though unlike you, I didn't disable chaining potions (but using two potions ends the turn). I don't know if it'll work for you in MZ using VisuStella, but I could posted it if you want to give it a try. That said, I'd recommend checking first if there's something in VisuStella that already handles this.
If it was chaining skills, visustella has that handled. It's because I want to alter how the item use selection works - I've found nothing so far in visustella's stuff that'll deal with that. (not saying it doesn't exist, mind you, I am terrible at remembering what features were where with the plugins!)

I think their workaround would be to just have a skill that uses items as the skill cost, and apply +1 turn/+1 state to that.

But that adds clutter to my skill window. 🙂
The way I handled it was to add an extra action (as if from an Action+ 100% trait) when you use an item, but only if it's the first item that actor has used in the current turn. But it was a bit tricky because then you also have to remove the action if they cancel – otherwise, they could build up infinite actions by repeatedly selecting an item and then cancelling.

In other words, I didn't have to change anything about how selecting an item works. I just added a hook so that, after selecting an item, it goes back to select another action instead of moving to the next actor (or ending the turn).

Original thread: https://forums.rpgmakerweb.com/threads/how-to-replicate-the-item-ui-in-battle-for-another-skill.182660/