MV Add more action window to yanflys Item core?

Hello!
As always Iam not sure how easy or not it is to realise, but I wanted to give it a try.

I use Yanflys Item Core and it has the action windows, where the extra window pop up, when you select an Item to ask what you wanna do with it. (like use, upgrade something like that)

But I would like to add a second "Use" Option and dont know how.
So when I select an item i could decide if I wanna select "Use" (make normaly what Items says) or select "Take" use an Common Event. (I want that you can take the item out of your bagpack to hold in your hands)

I hope its kinda clear what I want to say and hope I just missed an easy solution.

Thank you!
There are plugins to actually do that. Galv's Actor Equip Items has item slots you have to equip to before that actor can use items in battle.

If that's not what you're looking for, what does "hold in your hands" mean?
There are plugins to actually do that. Galv's Actor Equip Items has item slots you have to equip to before that actor can use items in battle.

If that's not what you're looking for, what does "hold in your hands" mean?
I dont think its what I meant. I dont want to use it in battle.

I also use the plugin to hold items (there Icons) up over the character if wanted. Also an Yanfly Plugin.
So when the character has the item over his head, it has it in his hands (like in harvest moon, where you have to hold your items over your head to use them)

So I would like the possibility to have a second "use" in yanflys item core, which acitvates an common event (this common event would be that the character get the item out of the backpack and hold it over his head to use it)

To put something inside the backpack is not the problem, but get it out would be.
Okay. It would help if you linked to the plugins you're talking about (see the section guidelines) or at least used the names 😉

I don't know which Yanfly plugin puts item icons over the character's head, which means I can't check how the plugin puts it there.
Okay. It would help if you linked to the plugins you're talking about (see the section guidelines) or at least used the names 😉

I don't know which Yanfly plugin puts item icons over the character's head, which means I can't check how the plugin puts it there.
Sorry, I didn't think that plugin would be needed, cause I just wanted the second action window "use" to activate an common event.

So like... ignore the whole "put it over my head".
I just need a second action window when selecting an item that activates common event X
🙂
Sigh.

So if putting the Yanfly balloon on is what you actually want to do, using a common event is not a good approach - how is that common event going to know which item you've selected?

I just spent the last 15 minutes figuring out which plugin you were talking about and writing this to add a Hold command to Yanfly's Item scene that will display the image from Yanfly's Icon Balloons.

If that's not what you want, you can replace the line with setIconBalloon with the script call for a common event, but it's not going to run until you exit out of the menu unless you find another plugin that provides an event interpreter inside the menu.

If that is what you want, I don't understand why you wouldn't simply explain that specifically and provide the plugins you're using instead of dodging and ignoring the question.

Code:
Window_ItemActionCommand.prototype.addCustomCommandsA = function() 
{
    this.addCommand("Hold", "hold");
};

var Use.CreateActionWindow = Scene_Item.prototype.createActionWindow;
Scene_Item.prototype.createActionWindow = function()
{
    Use.CreateActionWindow.call(this);
    this._itemActionWindow.setHandler("hold", this.onActionHold.bind(this);
};

Scene_Item.prototype.onActionHold = function()
{
    $gamePlayer.setIconBalloon(this._itemActionWindow._item.object().iconIndex);
    this._itemActionWindow.hide();
    this._itemActionWindow.deactivate();
    this._itemWindow.activate();
};
Edit:
@ATT_Turan I tried your code but it somehow just did, that its not pop up the action windows and straight up just use the item in normal way...
And still sorry I didn't show the plugin... just don't wanted to make more work 🙁

--

Iam really sorry, I dont want to make you angry.
Its this plugin http://www.yanfly.moe/wiki/Icons_on_Events_(YEP)

I didn't show the plugin I use, because as you said: the plugin doesn't exactly know which item I use. I would have tried to put the selected item into an variable (which I use for "you hold item id in your hand") so I can tell the plugin: Iam holding the item I stored in this variable.

I use the plugin with common events, so I thought asking to run a common event would be the most easiest part, then asking a (for me) even more complicated thing.

So like yes... I would need to show a second use command "Take" which stores the item id in Variable 342 and run the common event 40 or make these steps in the screenshot, so that the character holds the item in his hands AND variable 342 knows what Item ID is stored.

Iam very sorry, I was just thinking I dont ask for all of this.
1714593009229.png

Original thread: https://forums.rpgmakerweb.com/threads/add-more-action-window-to-yanflys-item-core.168241/