Calling a Game_Interpreter function from within Game_Actor

I need to be able to launch a plugin command from within a Game_Actor function.  I figure the easiest way is simply setting up the parameters as Game_Interpreter would arrange them, and then call the interpreter's pluginCommand function.


The problem is, there are many interpreters, and I would need to be able to identify and access which one initiated the Game_Actor function.  Game_Troop has an interpreter, as does Game_Map, Game_Common_Event, and every Game_Event object that's currently active.  Any one of them could have called the Game_Actor function. Is there a way to identify which one it was?


I could say "if I'm in battle, then I'll use $gameTroop's interpreter, otherwise I must be on the map so I'll use $gameMap's interpreter"?  I think that would work, but if the plugin being called referred to anything within the interpreter context (like the event id), and I ran the command from the wrong interpreter, it would not work.  This means it would limit what plugins could be used, so I'd rather not go that way if possible.
Did you ever get an answer to this question Shaz? I've got a possibly similar problem. $gameParty.gainItem($dataItems[itemID],n) is NOT the same as calling the command from an event. The former directly calls gainItem directly, where as the latter calls Game_Interpreter.prototype.command126, which then calls gainItem. Yet I have not been able to figure out how to call game interpreter commands from script. This failure is causing me huge grief in making treasure popups work properly...
No, your problem is not the same as mine.

I am trying to call the Game_Interpreter's pluginCommand function, and have it run by a Game_Interpreter object (plugins are inside the Game_Interpreter class, so if it ran as anything else it wouldn't be able to access them).

You are simply calling the same Game_Party command that the Game_Interpreter calls, and you're using fewer steps to do it. If you have the correct arguments, your call will work exactly like the event command. In your case, you don't want to call the Game_Interpreter function - you want to bypass it altogether. In my case, I specifically wanted to call the Game_Interpreter function, but had trouble getting hold of the correct interpreter to use.

I suggest if you've got the command in a script call (not in a plugin call) and it's not doing what you want it to do, just post a new thread with a screenshot of your call, and I think you'll be told what the problem is really quickly.
Thanks for this! I'll post it as a new thread, and then suggest that the answer also show up in the RMMV script calls so that everyone can benefit.
it probably already is.

Yep, it's right there on line 12. You know you have to replace dataID with the item's id, don't you? No leading zeros. And replace n with however many items you want to add (or a negative number if you want to take them away).
I posted my request on a new thread, defining it carefully: https://forums.rpgmakerweb.com/inde...ty-gainitem-vs-event-change-items-id-n.76574/
Note, the item in line 12 is the problem. It is not actually the same command as what you get in the referenced event, and so provides different behaviours in RMMV from the referenced command.

Original thread: https://forums.rpgmakerweb.com/threads/calling-a-game_interpreter-function-from-within-game_actor.73973/