MV Plugin Support: How to Refer to the Actor ID of the Character Who Called the Common Event from Yanfly Main Menu Actor Events?

Hello all! I've hit a bit of a stumbling block in my main menu efforts, and was hoping someone might be able to provide some guidance so I don't end up brute-forcing the result.

Game Concept: Etrian Odyssey esq setup, where the player can recruit their own guild of characters (around 30~ or so).

My goal: Create an option in the Main Menu that selects a party member, runs a common event that they checks their class before displaying/taking them to a specific map for leveling skills for them and their specific class [I am not using the skill purchase plugin because I'm utilizing a system to upgrade skills using the skill mastery plugin as well, and I wanted to try an alternative method anyway].

The Plugins utilized for this:
View attachment 316016
  • The button has been set up (currently showing false for some other testing). Actors have been set up to call the correct common event, and I have verified that it functions (i.e. a simple 'Hello World' message being printed).
The Question: When utilizing the above, how can I refer to the actor who triggered the common event? Is it possible when utilizing menus? I.e. I select the 'Consumption' option in the menu and 'Jessie' who would be Actor 4 in my game - is there some call I can make to grab that id value in the common event that was just triggered?

My Worst Case Scenario: I generate 30 clones of the same common event, point each actor to a unique one, write some code to store variables and go from there. That just hurts my coding soul to do, however, so I thought I'd ask in case I was missing an obvious answer.

Thank you!
The plugin doesn't have that functionality.

However, it's pretty easy to add!

Open the plugin in a text editor, and go to line 105.

Add a line after it that says:
Code:
$gameVariables.setValue(42, actor.actorId());
Replace the number 42 with the ID of the variable you want to use.

Then you can use the regular conditional branches inside your event to check what number variable 42 is equal to, and that's the ID of the actor selected.
Darn on it not having that functionality, but oh! Thank you very much for the advice! That works absolutely perfectly for me!
Usually when you select an actor like that, the engine sets them as the party's "menu actor". If that's the case here, then you could store their ID in a variable at the start of your event:
  • Control Variables -> Script: $gameParty.menuActor().actorId()

I don't know how the Actor Events plugin works...perhaps it's only a utility plugin. In case it helps, I posted a way to set up a "party chat" command here with only Main Menu Manager:
Caethyril said:
Important plugin parameters for the party chat menu item:
  • Ext: 1
  • Main Bind: this.commandPersonal.bind(this)
  • Actor Bind: this.callCommonEvent.call(this)
Just change the Ext number to the ID of your "party chat" common event. Then in the common event itself:
  • Control Variables > Set > Script > $gameParty.menuActor()._actorId
    (This stores the selected actor's ID in a variable.)

  • Then use Conditional Branch > Variable to separate out the possible party members' replies.

Original thread: https://forums.rpgmakerweb.com/threads/plugin-support-how-to-refer-to-the-actor-id-of-the-character-who-called-the-common-event-from-yanfly-main-menu-actor-events.171434/