Automatic closing of the menu - How to solve it? (RMMV)

I don't know if this is the right place to post this. If I was wrong I apologize and that the moderators move it to the correct place.

A few months ago I was looking to solve a problem that seemed quite simple to me and I was confident that it would be easy to find help, but I saw that many people asked to solve this problem and no one answered and they were left without answers.

The problem was that when using an item or ability from the menu that leads to a common event the menu closes automatically because the common event requires the execution of an interpreter, and the interpreter only works on the map, not in the menu. .

After testing and experimenting with different ways to solve this problem, I was able to solve it. My intention with this thread is not to seek help but to contribute my idea to solve this problem for others who have exactly the same problem.

The solution is when creating the common event at the end of everything you should put this script "SceneManager.push(Scene_Item)" without the quotes, this will force you to go back to the item window when the common event ends, but this doesn't solve everything the problem itself because from the item menu when touching the cancel button it will not go to the menu window but it will go directly to the map (which seems a bit annoying to me). For this reason, before putting the script at the end of the common event, you must activate a switch that will activate another common event in parallel process and there place the command "if cancel button is pressed" and place this script "SceneManager.push(Scene_Menu)" without the quotes, this will make it go to the menu window. After this script remember to turn off that switch to turn off that common event.

I will provide screenshots (which are in Spanish which is my natural language) so that you can guide yourself.

1693332616213.png

1693332665763.png

1693332704789.png


The only problem I found with this way is that it produces a small delay when pressing the cancel button returns to the menu window with the common event. Without the common event of menu and item windows entering and exiting there is no delay. If anyone knows a better way to solve this, I would like you to tell me that, by the way, help me also to correct this delay.



I hope I have been of help to others. Greetings to all.
I wrote how to do it using Triacontane's Menu Common Event plugin here. You could use the EIS plugin instead but it has its own problems as I mentioned in the thread.
Post in thread 'looking for EIS Common Event Menu plugin' https://forums.rpgmakerweb.com/inde...-common-event-menu-plugin.160459/post-1375036
Although the plugins are very useful I prefer not to use plugins created by other people for something so simple... Something that I have learned and advise others is to try to use as few plugins as possible, because most of the plugins created by other people were created for their own game which may be incompatible with other plugins. As much as everything seems to be compatible, there are times when something can be incompatible and stop working without us noticing. It has happened to me, for example, that after trying add-ons and realizing that they were compatible, after months I discovered that a state specific started to work badly that is not the way it should work. That's why this menu item doesn't seem necessary to me for someone to make a plugin, I prefer to look for a simple way and the best way is for one to learn to code as well as possible. The game can develop better the more you learn to code.
You asked for a better way to solve it, I gave alternatives. This is an issue that needs a plugin or overwriting/aliasing parts of the core engine because the default behavior is to kick you out to the game map when you call a common event.
Although the plugins are very useful I prefer not to use plugins created by other people for something so simple...

I both understand and appreciate your approach, but what you are asking for is not as simple as you are describing because it requires rewriting parts of the default code.

After all, if it were so simple, wouldn't you have already done it by yourself?

You've put yourself in a weird place by saying that you want something that requires a rewrite of the code but you don't want to use third party plugins.

(To be clear, I understand your point of view because I personally prefer to write my own plugins too).

AquaEcho pointed you to a potential solution, and if you don't want to implement that because it involves 3rd party plugins, then you'll need to teach yourself how to code the solution yourself... Because, by that logic, any code that anyone provides you here via a post is going to be a "plugin created by other people."
Something that I have learned and advise others is to try to use as few plugins as possible, because most of the plugins created by other people were created for their own game which may be incompatible with other plugins.
That is bad advice.

Every plugin I've ever seen advertised/released to the public is designed for public use. I've never come across a plugin released on these forums or anywhere else that had code specific to someone's personal game.

The concept of "use as few plugins as possible" makes sense insofar as you don't want to just install a plugin if you're not using its features...but it does not make sense to be making multiple common events with script calls instead of just sticking that code into a plugin.

I prefer to look for a simple way and the best way is for one to learn to code as well as possible. The game can develop better the more you learn to code.
The point of RPG Maker is that you can make a game without needing to learn how to code. The distribution of plugins is part of that point.
I think I expressed myself wrong when I said that "it is better not to use third-party plugins", what I meant is that if it is possible not to use a third-party plugin and be able to do it with the program itself or with some simple codes and not a long plugin and complex, I would prefer the simplest way to avoid possible incompatibilities with other plugins.

In reality, there are add-ons that, although they admit to being for public use, conflict with other add-ons that are also for public use... to cite an example, I use yanfly add-ons more than anything, but some things that I need are not available in yanfly and I could find it in another person's plugin but to use that plugin it asks me to use the base plugin that would be like the core engine, and that without realizing it conflicts with yanfly's core engine. It took me a long time to realize that there was an error, I don't remember what error it was, but I was surprised that I was able to publish the game on the play store without realizing that small error but that influences the large-scale battle)

It's just because of the risk of inadvertent bugs due to plugin incompatibilities. Although I guess it depends on the size of the game, my game is an open world game that influences many things (after 1 year I told myself that it would have been better to make the game simpler haha), and add so many things, so many options it seems to me that something can escape me without my noticing.

Aquahecho sorry if it seems that I am not thanking you for the help, in fact I thank you with all my heart for your contribution. I just gave a personal opinion with no intention of offending anyone.

Original thread: https://forums.rpgmakerweb.com/threads/automatic-closing-of-the-menu-how-to-solve-it-rmmv.160729/