YEP Plugin 199 - Call Plugin Comand does not works...

Hi all!
I'm tring to use the plugin by Yanfly to call the command of another Yanfly's plugin (Call Event);

I put in my script editor:

CallPluginCommand('CallEvent 2, Map 2');

But it does not works...

If I call by Command Function the same command/args works....

It's normal?

Thank you
I think you are in the wrong section and should ask in the plugin support section

Also which plugin are you talking about ?

Can you provide a link of the two plugins you're talking about ?
If one of yanfly's plugins behaves strangely, that is usually caused by either wrong configuration or wrong plugin order.
please start with screenshots of your plugin order so we can see what other plugins you have installed and if they are in the correct order.
If one of yanfly's plugins behaves strangely, that is usually caused by either wrong configuration or wrong plugin order.
please start with screenshots of your plugin order so we can see what other plugins you have installed and if they are in the correct order.

Ops! It's possible! I've a lot of plugins (builded by myself too) so i'll create a new project test without other plugins to make more simple to read it!
I'll post the screenshot or (if you have a link to the correct order I can reorder its by myself)

TY!
Here is the screen! TY!
Please post links to the plugin.

That doesn't look like a normal script command, but who knows - maybe it's right. What do you mean "call by command function"?

Are all your Yanfly plugins in the right order?
@Nortas as I guessed your plugins are in the wrong order.
yanfly's plugins have to be in exactly the order they are listed on his website, top to bottom.
and on your screenshot several are in the wrong order.
Please post links to the plugin.

That doesn't look like a normal script command, but who knows - maybe it's right. What do you mean "call by command function"?

Are all your Yanfly plugins in the right order?
I mean if i use the Command button in the Editor and I put the comand "CallEvent 2 Map 5" the event with ID 2 in the map 5 (not the same map from i call) is executed!

But I need to call that command by script call so I'm using another Yanfly's plugin called "CallPluginCommand " where by script you can easy call another plugin command using this sintax:

CallPluginCommand (myCommand myArg1 myArg2 etc);

But It does not works!

Now I'll try to reorder all plugins as suggested and I'll tell you if that resolve!!! 🙂

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

Sorry for wrong section!

So...I've removed some plugin from my test project and now (i suppose) they are correctly ordered!

But the problem is already there 🙁
There is no "Command" button in the editor. There is a Script button and a Plugin Command button.

Please post links to the plugin, and show a screenshot of your event so we can see how you're calling it.
Yes It's Plugin Command button (sorry)!
I'll try to be more detailed!

Plugins are those::

Call Event

Script Call Command

In the image attached you can see how I call plugins command.

I've an hypothesis:

The Call Event Plugin load the Map Data loading the text of the Map's Json file.
So If I'm in MAP 01 and I want to call the Event 1 of the MAP 2 the plugin load the text of MAP002.json and clone the Event properties in the Event in MAP 01 that launch the plugin command.

The problem maybe is that JS does not have a "wait read code" system so all lines of code are executed regardless of whether the previous one has finished and since the loading of the data map need "time" this does not happen before the other code is executed.

Now the question is: Why calling by Plugin Command Button works and Calling the same functions by script nope?!?

I checked how Yanfly bypassed the problem of "long loading" and I seen in the line about 146 He used a recursive function that "loop" until the necessary variables are populated

The function is this:
Code:
Game_Interpreter.prototype.processCallEvent = function() {
  if ($callEventMap) {
    this.insertCallEventData(this._callEvent_EventId, this._callEvent_PageId);
  } else {
    this.wait(1);
    this._index--;
  }
};

But there is a thing I not understand (and I think is the key of all)....Yanfly reiterated the function by the this._index--; where "this" is a GameInterpreter object...

why decreasing the index the CALL EVENT function is executed again?

Another thing:

I need to do this because i need to copy the event's pages (contained in the $dataMap object populated by the JSON load) array from an object GameEvent placed in a map to another GameEvent object placed in my map.

I hope I have been a little clearer now.
Thanks again for your help and sorry for my english but I'm writing from Italy :'D

Cya!

Original thread: https://forums.rpgmakerweb.com/threads/yep-plugin-199-call-plugin-comand-does-not-works.120554/