Fufi_Saintz

Villager
Member
Joined
May 14, 2020
Messages
25
Reaction score
4
First Language
Italian
Primarily Uses
Other
Hi everybody,

what is the easier way to trigger an event by selecting "Quit game" in the Game menu? To make that somethig happens between hitting "Quit game" and going back to the Main menu?
I found many solutions, but nothing really easy.
Thanks in advice!
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,763
Reaction score
8,970
First Language
German
Primarily Uses
RMMV
you'll need a plugin for changing either the menu command or the function for quitting, there is no way around that with pure eventing.

and if you're with a plugin anyway, it might be easier to tell what should happen and program it directly into the plugin instead of going to an event.
 

Fufi_Saintz

Villager
Member
Joined
May 14, 2020
Messages
25
Reaction score
4
First Language
Italian
Primarily Uses
Other
I have another plugin that change the language in the game (Samuel Divinium's DynamicLanguage plugin). I just want the game to go back to the original language when quitting and going back to the menu.
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
4,861
Reaction score
1,868
First Language
Dutch
Primarily Uses
RMMV
than change how GameEnd works by adding a common event,
reset the language to default, than return, depending on how
the language plugin works, and how to alter the gameEnd that
works for you.
 

Fufi_Saintz

Villager
Member
Joined
May 14, 2020
Messages
25
Reaction score
4
First Language
Italian
Primarily Uses
Other
than change how GameEnd works by adding a common event,
reset the language to default, than return, depending on how
the language plugin works, and how to alter the gameEnd that
works for you.

Problem is that I do not exactly know how to "change how GameEnd".
I just had to give a plugin command, that's all.
Thanks as always, you all already are in my game's credits.
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
4,861
Reaction score
1,868
First Language
Dutch
Primarily Uses
RMMV
if you want a plugin command rather than a common event,
it should be altered how it functions, because it's not possible at
default.

do you have any gameEnd plugins that you use?
if not, I can add a option to run a common event before closing,
so you can set the language to default when going to title scene.

I think there was also a comfirm window before closing, which
can be altered too, but I cannot recall the plugin though.

EDIT:
if you create a common event to make it back to default language or
other things as well along the way, paste this into a file and save it as .js

JavaScript:
Scene_GameEnd.prototype.commandToTitle = function() {
    this.fadeOutAll();
    $gameTemp.reserveCommonEvent(ID);
    SceneManager.goto(Scene_Title);
};

change ID to the number of your common event that you want to run.
this overwrite the GameEnd ToTitle command.

if you have another one, you can set the "$gameTemp.reserveCommonEvent(ID)"
into that plugin for the GameEnd if not for Game Over if that return to title as well.

but I dont think you want to set it back to default language if you have
multiple if they want to keep their language that way.
 
Last edited:

Fufi_Saintz

Villager
Member
Joined
May 14, 2020
Messages
25
Reaction score
4
First Language
Italian
Primarily Uses
Other
No, I have no GameEnd plugins. I'll try your ASAP, I'll tell you how is it.
Thanks!

EDIT: nope, it doesn't work. Or, maybe, I did something wrong. I:
- created a common event containing just the plugin command I need, number is 109
- copy-and-pasted your code in a file called GameEnd.js, and changed ID to 109 (do I have to put 0109 instead?)
- put the GameEnd.js file in the plugin directory, and set the plugin ON in the game.
But when I quit the game and go back to the main screen, language is set to 2nd (it has to be the 1st).
Am I doing it right?
Thanks!

if you want a plugin command rather than a common event,
it should be altered how it functions, because it's not possible at
default.

do you have any gameEnd plugins that you use?
if not, I can add a option to run a common event before closing,
so you can set the language to default when going to title scene.

I think there was also a comfirm window before closing, which
can be altered too, but I cannot recall the plugin though.

EDIT:
if you create a common event to make it back to default language or
other things as well along the way, paste this into a file and save it as .js

JavaScript:
Scene_GameEnd.prototype.commandToTitle = function() {
    this.fadeOutAll();
    $gameTemp.reserveCommonEvent(ID);
    SceneManager.goto(Scene_Title);
};

change ID to the number of your common event that you want to run.
this overwrite the GameEnd ToTitle command.

if you have another one, you can set the "$gameTemp.reserveCommonEvent(ID)"
into that plugin for the GameEnd if not for Game Over if that return to title as well.

but I dont think you want to set it back to default language if you have
multiple if they want to keep their language that way.
 
Last edited:

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
4,861
Reaction score
1,868
First Language
Dutch
Primarily Uses
RMMV
I dont know what's going on though, this mostly run the script.
it is possible that there need another function added.

but in order to reset it directly, do you have a link to the plugin?
and screenshot of your common event setup?
 

Fufi_Saintz

Villager
Member
Joined
May 14, 2020
Messages
25
Reaction score
4
First Language
Italian
Primarily Uses
Other
I dont know what's going on though, this mostly run the script.
it is possible that there need another function added.

but in order to reset it directly, do you have a link to the plugin?
and screenshot of your common event setup?
Do you mean a link to the localization/change language plugin I use in the game? There it is: https://forums.rpgmakerweb.com/index.php?threads/dynamic-language-change.53458/#post-527582
I know it isn't the best localization plugin out there, but it is the first I learned to use in my project (I had to change language at some point in the game, automaticlly, not by player's choice).
Here I attach also an image of the plugin made with your code, and another one of the Common event setup (very minimal).
Also: I tried the plugin command in another event, just to be sure it works, in the map, and it works.
I sure the problem is in something I did.
 

Attachments

  • Plugin code.jpg
    Plugin code.jpg
    128.3 KB · Views: 3
  • Common event.jpg
    Common event.jpg
    165 KB · Views: 3

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
4,861
Reaction score
1,868
First Language
Dutch
Primarily Uses
RMMV
Link doesn't work there, but it seems there need to be
some extra functions added that alter the default.

I forgot a common event cannot be run if the switch is OFF,
but only works that is targetted by items, weapons, events etc.

so it need to turn on the switch before closing it and it turns off
either inside the event or by the plugin (not that it doesn't matter
while it will be off after that.

I cannot check the plugin to set it to default, so I cannot help
you further, because this could be the easiest solution to get it
to work. so maybe someone else (better coder) can give you
the best approach or solution.

the main solution what you can try, inside of the plugin command.
set ID to 109 inside the plugin, and set a choice list of 3 parts,
yes, no, maybe and leave the rest blank inside empty, see if it
will trigger it, if not, than a function must be added, but I dont know
how to make a subwindow as comfirm to target that common event,
otherwise it continue the game.
 

Fufi_Saintz

Villager
Member
Joined
May 14, 2020
Messages
25
Reaction score
4
First Language
Italian
Primarily Uses
Other
Last edited:

Fufi_Saintz

Villager
Member
Joined
May 14, 2020
Messages
25
Reaction score
4
First Language
Italian
Primarily Uses
Other
Isn't there a possibility to put in your code the ability to turn the Common event switch on?
That could fix the problem, right?
OR:
Is it possible to launch the language plugin command inside your GameEnd plugin?
This could be another solution.
Please forgive me if I'm saying silly things, I a m not a programmer, just trying to be helpful...
 
Last edited:

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
4,861
Reaction score
1,868
First Language
Dutch
Primarily Uses
RMMV
so far I see it, default switch = always true, so in order to make it work
to default language is that the switches aren't persistent, so far I can
understand is that if you restart the game, it is automatically resetted
to default language.

if this IS not the case, the only thing I see, is to replace the switches
as he set in the plugin on gameEnd function, so the switches you use
to false, and 1 is ON as default.

if it can change in the option menu or during gameplay,, that might be
the the only way.

I dont know if that is the best way, but I do know, there are some other
ways to deal it with.

do you have a techDemo so I can test a few things out?
otherwise, it need to wait till tomorrow, but I think a better coder
have applied by than hopefully.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,646
Reaction score
15,735
First Language
English
Primarily Uses
RMMV
@Fufi_Saintz please remove all those plugins from your earlier post, and provide a link to the plugin thread instead.

I've moved this thread to Plugin Requests. Thank you.

 

Fufi_Saintz

Villager
Member
Joined
May 14, 2020
Messages
25
Reaction score
4
First Language
Italian
Primarily Uses
Other
do you have a techDemo so I can test a few things out?
otherwise, it need to wait till tomorrow, but I think a better coder
have applied by than hopefully.

Hello, sorry for not posting anything in the last days, I've benn quite busy.
@ShadowDragon I just prepared the demo, Is it right if I share a Google link with you via private message? Please let me know and I'll do it asap
An many, many thanks
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
4,861
Reaction score
1,868
First Language
Dutch
Primarily Uses
RMMV
sure, go ahead, than I cn see what can be done once I figure it out.
 

Latest Threads

Latest Profile Posts

People laughed at me when I said that Activision Blizzard would get bought up by another company if they didn't fire their execs. Now their value has dipped so much Microsoft is willing to buy the company, likely followed by some heavy terminations if they want to purify the current toxic image of Activision Blizzard.
Pro tip: don't be this person.1642536788532.png
ok hear me out here: if the only way my brain can describe things is like with colors is this normal? Like I've described a smell as "dark green and fuzzy" and a taste as "dark blue" like is this a normal thing that happens to people or am I just going insane?? o.0
I'm sitting here, programming, when suddenly, in the distance, I hear a deep booming shout, "Dovahkiin". In an instant, my mind and body is pulling me away, my fingers twitch and notepad++, almost by itself, turns off. The Steam starts to rise and a big green play button appers and I am teleported to Skyrim, because, I am, the Dragonborn! 200 hours played last three weeks, omg o_O

Forum statistics

Threads
118,483
Messages
1,116,288
Members
155,468
Latest member
mikethebravesfan
Top