pluggin for call common event on specific action

I realize that for my game, a lot of thing can be done without parallele event if I wat able to put code when player move and when event move. So I look for a pluggin that will call common event when player move and another event when event move.

Like this for exemple, without a parralele event, I will be able to only check if player was in front of an objet while he moving and not 1000x by second.


Thanks for your help.
At 60fps, you would only check a maximum of 60 times per second, not 1000.

If you think about it, how many tiles can a player or event move in a second? Not very many - certainly not 60. You could put a Wait 6 frames at the start of the parallel event and then it will only check 10 times per second, which would still be more than enough.

You don't call plugins from scripts. I think what you are asking for is what is the script command to call a common event, and where do you put it, to have the player and every event call the common event after taking a step.

You're really not gaining anything by this approach. Better to put more thought into the design of your parallel event, or get rid of the common event and script it into Game_Character.
I calculate that I will gain some performance a easy reading code.
Parralle event will have to check for each event of the map if they have moving, that heavy...
If I get able to run common event only when player or event move by a plugging, that will only run appropriate code.
I think its better in long term developpement.


EDIT:
Of course, if that make @this@ do no refer to the event, that can be a trouble...


EDIT2:

Im happy I manage to get able to create a working plugging by myself:

Code:
/*:
 * @plugindesc v1.00 Allows a common event to run on player move of a executeMove, without creating an autorun.
 * @help
 * =====================================================================
 * Terms of Use
 * =====================================================================
 * Free for use in non-commercial and commercial games just give credit.
 * If commercial, a free copy of the game is awesome but optional.
 * =====================================================================
 * @param DefaultEvent
 * @desc Enter the Commont event id to run each time player move
 * @default 0
 */

(function() {

 var PlugginParam = PluginManager.parameters('MoveToCommonEvent');
 var defaultCommonEvent = Number(PlugginParam['DefaultEvent']);

 Game_Player.prototype.executeMove = function(direction) {
  this.moveStraight(direction);

   if (Number(defaultCommonEvent) > 0) {
    $gameTemp.reserveCommonEvent(defaultCommonEvent);
   }
 };

})();

But I still unable to find out how to apply same thing to any event.
Thansk for your help.

Original thread: https://forums.rpgmakerweb.com/threads/pluggin-for-call-common-event-on-specific-action.75387/