pluggin for call common event on specific action

XGuarden

Veteran
Veteran
Joined
May 10, 2016
Messages
446
Reaction score
17
First Language
French
Primarily Uses
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.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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.
 

XGuarden

Veteran
Veteran
Joined
May 10, 2016
Messages
446
Reaction score
17
First Language
French
Primarily Uses
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.
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,575
Latest member
akekaphol101
Top