Possible Edit to Yanfly's Button Comment Event Plugin?

Hello all!

I was wondering if there is a way to possibly edit the Yanfly Button Common Event plugin to achieve the effect I want. Or if there's a better solution for this, that would also be awesome!

My game has multiple actors in the party that the player can switch between. Each actor has an ability to help traverse the map. As the player gathers more characters, they're able to unlock more areas of the map with the different actor abilities. For example, one character can use the hookshot (from Legend of Zelda).

My current setup is to use Yanfly's Button Common Event plugin to call a common event to trigger the hookshot ability. But if I want to have a different character use the same button, the plugin doesn't allow me to dynamically set the common event that say, button "f" calls.

If I wanted to have "f" be the button that calls actor's special map traversal abilities, how would I go about doing that?

For example:
If Actor 1:
Then Special Ability Variable = 1
If Actor 2:
Then Special Ability Variable = 2
.
.
.
If Special Ability Variable = 1:
Then assign Common Event 14 to YEP_Button_Common_Event_Plugin "f"
If Special Ability Variable = 2:
Then assign Common Event 15 to YEP_Button_Common_Event_Plugin "f"



Is that even possible without a tremendous amount of work? Is this the best way to accomplish this?

Thank you for your time if you see this!
Hello all!

I was wondering if there is a way to possibly edit the Yanfly Button Common Event plugin to achieve the effect I want. Or if there's a better solution for this, that would also be awesome!

My game has multiple actors in the party that the player can switch between. Each actor has an ability to help traverse the map. As the player gathers more characters, they're able to unlock more areas of the map with the different actor abilities. For example, one character can use the hookshot (from Legend of Zelda).

My current setup is to use Yanfly's Button Common Event plugin to call a common event to trigger the hookshot ability. But if I want to have a different character use the same button, the plugin doesn't allow me to dynamically set the common event that say, button "f" calls.

If I wanted to have "f" be the button that calls actor's special map traversal abilities, how would I go about doing that?

For example:
If Actor 1:
Then Special Ability Variable = 1
If Actor 2:
Then Special Ability Variable = 2
.
.
.
If Special Ability Variable = 1:
Then assign Common Event 14 to YEP_Button_Common_Event_Plugin "f"
If Special Ability Variable = 2:
Then assign Common Event 15 to YEP_Button_Common_Event_Plugin "f"



Is that even possible without a tremendous amount of work? Is this the best way to accomplish this?

Thank you for your time if you see this!
You would just make the common event do a conditional check on the actor id of the party leader. You might want to check Hakuen Studio party map plugin that will run scripts every time you change the party leader

For example:
If Actor 1:
Then Special Ability Variable = 1
If Actor 2:
Then Special Ability Variable = 2
Why can't you do literally that?

I don't see the point of the variable, just put the entire event that should happen after the If (that is, in a Conditional Branch).

Then you do the same for each other potential party leader.

You could make them all separate common events, use those Conditional Branches and then Call Common Event, but there's not really much reason to take up multiple common event IDs.
You would just make the common event do a conditional check on the actor id of the party leader.

You could make them all separate common events, use those Conditional Branches and then Call Common Event

Oh, that's a much better way to think about that, I don't know why I hadn't thought of that before. I must have been too segmented in my thinking. Thank you both!

And the reason I'm separating out the common events is because some of them are quite long and I had thought putting them all together would become quite messy.

So I'll just have 'f' assigned to say, Common Event 14 and have that be:

If Party Leader = Actor ID 1:
Then call Common Event 'X'
If Party Leader = Actor ID 2:
Then call Common Event 'Y'
and so on


Again, thank you both!
This thread is being closed due to being solved. If you need it reopened, report it to let us know why. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/possible-edit-to-yanflys-button-comment-event-plugin.163143/