RPG Maker Event Trigger Question

Since I can’t make a new post on the RPG maker forums (and I do not, for the LIFE of me, want to endorse their shitty practices with the new forum), figure I’d see if anyone here has an idea, and I don’t need to beat around the bush with my question.

I want to have food items that make characters gain weight, but I want them usable as items in the inventory. My idea was ‘Use item X on Actor 1 and increase a specific variable on Actor 1’ as an event trigger, but I’m wondering if that’s possible and if it’s doable in the conditional branch as a script? And if it is, is it possible to also have the same item pick up ‘if Actor 2, increase Variable for Actor 2 instead’.

((Also hoping this is the correct place to put this))

Take what I have with a grain of salt since I don’t actually own RPGMaker. But from what I know, this is plugin territory since I don’t know of a way to control variables dynamically like that with item effects, or access the target actor id in a common event item effect handler.

You could use a plugin like this:

(function() {
    const Game_Action_apply = Game_Action.prototype.apply;
    Game_Action.prototype.apply = function(target) {
        if (target.isActor()) {
            $gameTemp._lastItemTargetActorId = target.actorId();
        }

        Game_Action_apply.call(this, target);
    };
})();

Then you could access that as $gameTemp._lastItemTargetActorId in a JS section in the common event, or even save it to a variable like:

let actorId = $gameTemp._lastItemTargetActorId;
$gameVariables.setValue(1, actorId); // 1 is the variable id you want to save the actor id to.

Then, you could use branching or do something smarter with JS to map the actor id to the variable id you want to update.

EDIT:
I’m assuming that you’re using RPGMaker MV here.

I don’t know what engine you are using but I put together a ramshackle little thing that I saw an example of on this site. This is RPG Maker MZ and I made these variables(Actor to gain weight, WG from item, Vera’s Weight) and plugged them into the two common events and the item associated with the event to trigger every time that food is eaten to add weight to the character and check what weight stage they are at. To have it work on more teammates you need to make another --WG Effect-- but tie it to a different party member. Sorry for the bad english in the common events. The items was what I did the wg was from an example.

I found the example for the --WG Effect–, there was a page on the wiki here:

RPG Maker is also full of tricks, if you plan on not using the level function or if you don’t utilize one of the stats you can rename them and use them as your variable for tracking. For example you can take the “Luck” stat, on Database Terms rename it to something else and use a generic Luck level up stat change to keep track of any actor’s status. This should work on most RPG Maker versions.

Which RPGMaker engine? I can speak for MV and MZ, and if I understood your meaning correctly, this is possible. By default, you can have items used on specific actors if you have more than one actors in your party. For example, a healing potion requires a targeted Actor to heal, the action itself has a target that can be either the whole party or just a specific actor defined on the event. If the actor isn’t part of the team at that point or is not planned to be a part of the party at all, it may be better to keep their stats as a separate variable (though this really depends on the scope of your project).

Go ahead, open a few other games in your editor. You can see what they have done and implement it for yourself.

what I’m using is MV, so it’s probably the same as the one you posted.