MV Plugin Conflict [Solved]

problem:
Can anyone tell me the reason why Galv Tool Plugin would conflict with Yanfly Item Core. I went as far as changing everything that had to do with items in Galvs plugin to work with the weapons instead of items... The problem is the script call Galv.TOOLS.equipTool(id); It won't work as long as I'm using the Yanflys Item Core. Its the only script call that won't work.

general inquiry:
Alot of the time and I mean ALOT I want to use game variables for plugins params but I've come to realize I need to change the js file to do that. My inquiry is how to do that in general so I can change plugins moving forward. If its not to much to ask can someone demonstrate it on Galv Visual Novel Choices. I want to use game variable for the X and Y positions, but to place it in the param not the functions.
Sorry, I can't help with Yanfly since I don't have those files.

For your general inquiry, try:
Galv.VNC.x = $gameVariables.value(id) ?? Number(PluginManager.parameters('Galv_VisualNovelChoices')["Command X"]);

That will use a $gameVariable of your chosen id, unless the variable is not set (undefined), then it will use the Plugin parameter.
Sorry, I can't help with Yanfly since I don't have those files.

For your general inquiry, try:
Galv.VNC.x = $gameVariables.value(id) ?? Number(PluginManager.parameters('Galv_VisualNovelChoices')["Command X"]);

That will use a $gameVariable of your chosen id, unless the variable is not set (undefined), then it will use the Plugin parameter.
That won't work, because $gameVariable.value(id) never returns undefined, so it will never use the plugin parameter. It would return 0 instead:

JavaScript:
Game_Variables.prototype.value = function(variableId) {
    return this._data[variableId] || 0;
};

In this particular case, you'd want to directly use $gameVariables._data[id] instead.
The compatibility issue is probably being caused by independent items. I'm assuming your tools are equipment. If you haven't turned independent items off, their IDs will be generated starting at 3000, and Galv's plugin will be looking for tools based on the original item ID.
Mercy please smh. The independent items is what caused the problem. thank you for that as for the inquiry.

Galv.VNC.x = $gameVariables.value(id) ?? Number(PluginManager.parameters('Galv_VisualNovelChoices')["Command X"]);
Galv.VNC.y = $gameVariables.value(id) ?? Number(PluginManager.parameters('Galv_VisualNovelChoices')["Command Y"]);

Im assuming I have to do one for X and Y: The variables will be set to a number at the start of the game so wouldn't the undefined/0 problem be non existent and would this work? If not:

EDIT: It did not work. trying the other now Where would I put it?


Game_Variables.prototype.value = function(variableId) {
return this._data[variableId] || 0;
};



Unknown.jpeg

How can I disable the cancel button of X? I want to keep Esc. X causes problems. Honestly don't need it in the menus.
Mercy please smh. The independent items is what caused the problem. thank you for that as for the inquiry.

Galv.VNC.x = $gameVariables.value(id) ?? Number(PluginManager.parameters('Galv_VisualNovelChoices')["Command X"]);
Galv.VNC.y = $gameVariables.value(id) ?? Number(PluginManager.parameters('Galv_VisualNovelChoices')["Command Y"]);

Im assuming I have to do one for X and Y: The variables will be set to a number at the start of the game so wouldn't the undefined/0 problem be non existent and would this work? If not:

EDIT: It did not work. trying the other now Where would I put it?


Game_Variables.prototype.value = function(variableId) {
return this._data[variableId] || 0;
};



View attachment 215432

How can I disable the cancel button of X? I want to keep Esc. X causes problems. Honestly don't need it in the menus.
You don't need to put that Game_Variables.prototype.value function anywhere. That's part of the game engine. I was just showing it to autodidact to explain why his solution had an error. The corrected version of his solution would be this:

JavaScript:
Galv.VNC.x = $gameVariables._data[id] ?? Number(PluginManager.parameters('Galv_VisualNovelChoices')["Command X"]);

In case you didn't realize it, I'll also mention that you need to replace id with the actual number id of the game variable that you want to use. And yes, you'd need one for Y as well as X.

However, I still don't think that is going to work the way you hope it will. It's not going to allow you to change the X and Y position at run time, if that's what you're hoping to do. But posting Galv's script here the way you did is against his Terms of Service, and the extent at which we can help you edit his code without breaking his Terms of Service is also limited, so I'm kinda reluctant to give you much more advice than that. Plus I don't use this plugin, so I can't test any advice I'd give you anyway.

How can I disable the cancel button of X? I want to keep Esc. X causes problems. Honestly don't need it in the menus.

JavaScript:
Input.keyMapper[88] = "";
You don't need to put that Game_Variables.prototype.value function anywhere. That's part of the game engine. I was just showing it to autodidact to explain why his solution had an error. The corrected version of his solution would be this:

JavaScript:
Galv.VNC.x = $gameVariables._data[id] ?? Number(PluginManager.parameters('Galv_VisualNovelChoices')["Command X"]);

In case you didn't realize it, I'll also mention that you need to replace id with the actual number id of the game variable that you want to use. And yes, you'd need one for Y as well as X.

However, I still don't think that is going to work the way you hope it will. It's not going to allow you to change the X and Y position at run time, if that's what you're hoping to do. But posting Galv's script here the way you did is against his Terms of Service, and the extent at which we can help you edit his code without breaking his Terms of Service is also limited, so I'm kinda reluctant to give you much more advice than that. Plus I don't use this plugin, so I can't test any advice I'd give you anyway.



JavaScript:
Input.keyMapper[88] = "";
I see and I didn't realize it broke his terms! I removed the script and put the link to his plugin instead. I did put the id in I just used the wrong example. Yes I want to change the positions at runtime so every time the choice box opens I can reposition it if need be. The plugin has the initial X,Y set by params and I want to use a game variable there. I realized that It has to be coded that way and wanted to know how to do that generally because there are many plugins that just don't offer that flexibility and not sure why. I'm just going to assume its involved and maybe for what this plugin is repositioning it doesn't make all that sense but I think it'll be a good feature.

Also setting the button to. "" means I won't be able to use it outside the menu either right? so upon closing my menus by common event just set it back to "x" or "X" right however if I use esc to close I have to find that part of code in the core js and put it there somewhere about?

ugh can of worms... I just don't want X to push the scene when a menu is open... Is that in the core js somewhere where I can erase that?

Original thread: https://forums.rpgmakerweb.com/threads/plugin-conflict-solved.144688/