[SOLVED]Run a common event at new game?

Please help, I need a way to run a common event called "Initialize Variables" at game start. What this common event does is simply sets the corresponding values for variables that I want at game start.

It needs to be run when the player has entered the map AND has to be compatible with Yami_SkipTitle.js because I am going to be using this for bugtesting purposes and thus will always load the game at different maps from start.

Edit1:
I am considering a way to do it by having a switch turned ON at game start so that it will act as trigger for the common event if set as Parallel process then turn it of once it has ran. But since all switches are turned OFF by default at game start, I can't do that.

Edit2:
OrangeOverlay plugin seems to set switches 1-4 on at the start, so I probably need a plugin that do domething similar like that as well for it to work.

Please don't recommend Yanfly's Button common events as I'm using that already but am lazy always pushing buttons at game start. ;_;

Edit3:
If you guys think this post doesn't belong here and need to be moved to JS plugins requests, please do so. Because I'm not sure but there may already be a plugin that exists to do what I want.
You don't need a common event. Just put it in a map event, set to Parallel Process, and turn on a self switch at the end. Give the event a second page conditioned by that self switch, to ensure it only runs once.

edit - if you're going to change your starting point, then maybe yes, put it in a common event, and make the map event do a Call Common Event command. There's really no way to make a common event run unless you call it from a map event, or turn on a switch if it's a parallel process event ... apart from making a little plugin that turns the switch on when a new game is started. That's just one of the joys of testing, if you want to jump around all over the place.

You could have a "testing" map that has the event to set all your variables, and at the end transfer you to the real map you want to start on. But you're still going to have to change it each time you want a new map.
There's really no way to make a common event run unless you call it from a map event, or turn on a switch if it's a parallel process event ... apart from making a little plugin that turns the switch on when a new game is started.

Yes, you're exactly right. Since I'm gonna be jumping from one map to another. But if possible I don't want to create a map event for each map I'll be testing.
Can you recommend a plugin that turns a switch on at game start? Like the one that OrangeOverlay does at start?
I don't know of any. You will have to write one for yourself.

Code:
var temp_DataManager_createGameObjects = DataManager.createGameObjects;
DataManager.createGameObjects = function() {
  temp_DataManager_createGameObjects.call(this);
  $gameSwitches.setValue(x, true);
}

where x is the id of the switch you want to turn on (without any leading zeros).

Save that as a .js file in your plugins folder, add via the plugin manager, and turn it on.

Make sure you turn the switch back off again right at the end of the common event.
WORKS! And best of all, fully compatible with Yami_SkipTitle.js. Tried it when starting from different maps.
Thank you very much Shaz!, reporting this thread as SOLVED.
While Testplaying Press F9 than a menu opens where you can manipulate all switches and variables.
Simply turn switch1 to On and continue game, now your common event runs.
Should work easy and flawless in Testmode.
While Testplaying Press F9 than a menu opens where you can manipulate all switches and variables.
Simply turn switch1 to On and continue game, now your common event runs.
Should work easy and flawless in Testmode.
Umm...well technically you're right, but that's not exactly the solution I was after.
See, I want to run a common event called "Initialize Variables" at game start. And by that I mean immediately as soon as the map appears.
Without having to press anything on the keyboard at all (similar to what Yanfly's ButtonCommonEvents does, or the F9 Developer mode I think.) or having to apply an event that does turn on a switch for it in each map that I want to test, which is almost a hundred now.

It's to make bugtesting less tiresome.
Edit: I missread you, answer deleted. Sorry my english lacks sometimes.
Edit: I believe i missread you, ignore my answer in that case.

Than simply use the standard Event Editor for that.
1. No Autorun Events Active on start Map. (Those are for cutscenes, only 1 can be active at a Time, the player cant move and they prevent other normal Paralell Events from running)

2. Create Event1, Trigger: Paralell
3. Eventcode: Manipulate all your Variables here.
4a. Erase Event (It will be reexecuted when map is reentered)
or
4b. Turn also a Switch On and create a 2nd Eventpage and as Pagecondition use that Switch.

Before you even see the Map, all Variables will be changed.
I dont see a reason why this isnt working.

Yes, of course that will work too, but if you think about it, I would need to copy paste that Parallel event that I made on the first map to the other 100 maps each time I want to change my start point and run that common event. So I'll pass on that method thank you. ;_;
Yes, of course that will work too, but if you think about it, I would need to copy paste that Parallel event that I made on the first map to the other 100 maps each time I want to change my start point and run that common event. So I'll pass on that method thank you. ;_;
If you only want that common event to initialize some variables, you can try LinkedVariables.js from Shaz.

Original thread: https://forums.rpgmakerweb.com/threads/solved-run-a-common-event-at-new-game.105507/