Map Initialization functions for plugins[Solved]

Hello there game makers, I come here yet again in search of guidance.
In my limited experience with plugins I see that you can write functions and call them via the script call comand, but I also know that you can also extend the game's premade functions to make a propper plugin, so my question is this, which function should I
extend if I want my code to be called each time a player enters a new map?

I am sorry if I am not aware but is there a list detailing what all the existing functions do?


Any suggestions will do,many thanks.
Game_Map.prototype.setup ?
Could work, there are also many .prototype.initialize functions but I guess they are for something else.
I will try it out!
no... initialize is called when every map is created.
.setup, or Game_Player.prototype.performTransfer, is what you want.

you need to poke a line between transfer instructions, so that's either during the transfer process, or right after the destination map is ready.
Game_Map.prototype.setup ?
It works, but only the first time, If I enter the map a second time, the code will not execute
Yess I think transfer will do better, or why not both!?
Saddly this has no effect, am I doing something wrong?:
(function () {
var _Game_Player_transfer=Game_Player.prototype.performTransfer;
Game_Player.prototype.performTransfer = function()
{
_Game_Player_transfer.call(this);
Do_something();
};

})();
Nope I am an idiot, the function works!!!
Thanks your a life savior!

Original thread: https://forums.rpgmakerweb.com/threads/map-initialization-functions-for-plugins-solved.95152/