MV Common Event that's called...

... each time a character equips something. Is this possible? Thanks for any suggestion!
Generally, common events only work on the map scene, so you can't really call them on the equip scene. You could reserve a common event though, and it will be executed once you're back to the map scene. Maybe that's what you meant?
There's a Waynee plugin that does it
I can even make you a plugin that does exactly that. I am really not a plugin author and I know a little javascript, but this I can do.

I actually did make a plugin like this once, and I used it in all my projects since. However, mine doesn't trigger a common event after equipment menu opens, but it runs when using transfer. This way I created an autosave. It is the first and the last plugin I ever made.

But the process of making this plugin, would be exactly the same. And most of it I have already done anyway. The only thing I would need and replace, is the piece of code that is used to call the equipment menu.

I don't know if my solution would be any better than the solution AquaEcho suggested. But I can say for sure my solution would be the shortest and focusses only at the point you're asking for. (Which I'm not sure, the other plugins do too.)

I would have to create this plugin first, so let me know if that is what you want. But please, check out the existing solutions first.

(Edit: I'm actually trying to stay away from the forum for a while. I am making an exception here, for you. But I might not see your reply straight away, since I am not on the web as much lately)
Generally, common events only work on the map scene, so you can't really call them on the equip scene. You could reserve a common event though, and it will be executed once you're back to the map scene. Maybe that's what you meant?
This is the correct answer because all events are expected to potentially handle a cutscene which would break things if it happens in an equip scene. It may also be good to clarify if we specifically require a cutscene to play when equipping an armor, or we just want to execute scripts when equipping armor.

EDIT: And if we only just want to execute a script, Waynee's plugin should do the trick
There's a Waynee plugin that does it

Thanks for the suggestion, however what should I put between the tags to call a common event?

<Custom On Equip Eval>
code
</Custom On Equip Eval>

I would have to create this plugin first, so let me know if that is what you want. But please, check out the existing solutions first.

Doing that for now, thanks! Appreciate your offer though.
Thanks for the suggestion, however what should I put between the tags to call a common event?

<Custom On Equip Eval>
code
</Custom On Equip Eval>



Doing that for now, thanks! Appreciate your offer though.
Here's a useful spreadsheet for answering those kind of questions, but in short:
$gameTemp.reserveCommonEvent(id); (replace id with the event's id).
This didn't work (I tried with and without the 😉. Any clue?

Code:
<Custom On Equip Eval>

$gameTemp.reserveCommonEvent(100)

</Custom On Equip Eval>

Also, would it run the common event AFTER equipping the armor in question?
This didn't work (I tried with and without the 😉. Any clue?
Might be worth verifying if the plugin works at all. Try putting console.log("Equip test"); in there, and check if it prints that message in console (F12->console tab).
Also, would it run the common event AFTER equipping the armor in question?
After a quick peek at the plugin, it seems to run custom code after equipping the item.
So my syntax was correct? Should I put the ; at the end or not?
Do you have the Waynee core plugin installed? It also might not trigger a common event until you exit the menu; in which case if you want the effect earlier you would have to put a script in, not a common event
Doing that for now, thanks! Appreciate your offer though.
I didn't notice this was a reply to me, because it looked like a second part some someone elses quote. 😛 I see you did not solve this so far, so maybe this plugin could be an option.

Here is what I would do. And if you know some javascript, you might be able to do this yourself as well:

I make a simple plugin, where I take the piece of code to open the equipment menu (found in one of the .js files in the /js/ folder).

Then I make a replacement for this piece of code, with the exact line of code. Above that line I will save the ID of the weapon in a variable, and after that line I will check if the ID before is different than the ID after.

If they are indeed different, I will trigger a common event.

(Maybe I don't use the right terms, because I am a total javascript noob. But I managed to do the same thing for transfers, so it should not be too hard to convert this to the equipment menu)

---

I noticed you want to trigger the common event when something is equipped. My solution would trigger the common event when the equipment is closed. Is that what you wanted, or do you want it to trigger on top of the equipment menu? Because that would complicate things a bit.
Do you have the Waynee core plugin installed?

Yes.

It also might not trigger a common event until you exit the menu;

Then that defeats the purpose. It's not very hard to trigger a common event once you exit the menu without any need for a plugin.

in which case if you want the effect earlier you would have to put a script in, not a common event

The common event is elaborate. That's why I need a plugin that is able to "read" it whenever an armor is equipped.

I noticed you want to trigger the common event when something is equipped. My solution would trigger the common event when the equipment is closed. Is that what you wanted, or do you want it to trigger on top of the equipment menu? Because that would complicate things a bit.

It needs to be when an armor is equipped.
The common event is elaborate. That's why I need a plugin that is able to "read" it whenever an armor is equipped.



It needs to be when an armor is equipped.
Then you would have to use a plugin like Triacontane's common event in menu and put a conditional statement triggered by equipping armor. That would be more complicated to set up.
It needs to be when an armor is equipped.

I don't think you events (or common events) can run while in the menu.

I don't know what you do with the quotes, but it is really hard to see which quote is mine and which is not, if you talk to multiple people and cut off the header of a quote. 😛 How does that even happen? Haha.

Anyhow, like Aqua said, you might be better off using scripts then. Anything a common event can do, a script can do as well. Even better, as long as you know what you're doing. Using events is easier, but limited.
I don't think you events (or common events) can run while in the menu.
Normally, no, running a common event in a menu will kick you back to the map scene to run it. But there are two plugins- one by EIS and the Triacontane one I mentioned earlier that will allow you to do it. I found the EIS one buggy and Triacontane's one is in Japanese so it'll take some work either way.

I think it all depends on what the common event does, too. If it is full of moveroutes and animations, or message windows, I can imagine this would not work well while a menu is open. Even with a plugin. While calculations with switches and variables and adding items or states might work a lot better.

I honestly don't know, though. Never had the chance to experiment with events while the menu is open 😛
So, impossible to run a common event while sticking to the equip menu?
So, impossible to run a common event while sticking to the equip menu?
No, you can do it with the Triacontane plugin as I mentioned earlier but if you're going to ignore me I'm not going to help
I missed your post actually, I'm going to try it then.

Original thread: https://forums.rpgmakerweb.com/threads/common-event-thats-called.165252/