$gameParty.gainItem vs Event Change Items : [id] + n

Hi all, I'm having trouble getting MOG's treasure popup to work in certain circumstances. When I use an event's Change Items command (or weapons, or armour, or gold) it works perfectly.

However, when I try to add items using the $gameParty.gainItem command, MOG's treasure popup ignore it. That's because the event command calls Game_Interpreter.prototype.command126, and it is in the modified MOG's command126 (or 127 or 128) that the popup is called (after command126 calls gainItem).

MOG did this because these commands indicate the source event, whereas gainItem does not (or appears to not).

So, I want a script call that lets me access command126, and not just gainitem because I need to pass the event id so my treasure popups show up over the events in question (and therefore look good).

Hope this makes sense, and hope you all can help.

Thanks!
link to the plugin?

MOG's plugin obviously overwrites the Game_Interpreter version and adds extra functionality (the popup, no doubt). So you can't just call the $gameParty command directly, because that won't include the things that MOG has added.

Show us your event that's calling the command so we can see how you're setting things up, and add a link to the plugin.
Please give a link to the plugin you're writing about. We can't help you without that, because that script call would have to go within that plugin.

Basically script commands ignore all other conditions and cannot be redirected to add more options, while event commands check for requirements and can be redirected to add other functions. That is a disadvantage of the script commands that you always have to keep in mind if you're using them.
Here's the treasure popup: https://atelierrgss.wordpress.com/rmv-treasure-popup/

Not sure how to show you the event - basically any event that uses $gameParty.gainItem will give my character the item, but not operate the popup.

DD
You can do this in a script call instead of using the event command if you want it to work with the plugin without having to make any changes.

Code:
var itemId = ID OF ITEM YOU WANT;
var incDec = 0 FOR INCREASE, 1 FOR DECREASE;
var constVar = 0 FOR CONSTANT, 1 FOR VARIABLE;
var value = CONSTANT VALUE OR VARIABLE ID;
$gameMap._interpreter._params = [itemId, incDec, constVar, value];
$gameMap._interpreter.command126();

Obviously I've only specified the variables to explain what the params are, you could just as easily do

Code:
$gameMap._interpreter._params = [id of item, 0/1, 0/1, value];
Thank you Trihan - this provides the functionality I need, and works! You, Shaz, and Andar have been most helpful!
Glad to be of assistance. 🙂

Original thread: https://forums.rpgmakerweb.com/threads/gameparty-gainitem-vs-event-change-items-id-n.76574/