MV YEP Weapon Unleash conflicting with Custom Translation Engine

Hello!

Since I'm not a programmer, I don't know how to solve this issue.

Generally speaking, Yanfly plugins seem allergic to any sort of translation plugin. On this occasion, I'm using Weapon Unleash, which allows me to reassign the default attack and guard commands to the skill of my choice, based on what weapon or shield the character is using.

All great so far.

However, if you dare to change language, neither the Attack and Defend skills nor the weapons and shields' names will be translated. In battle, it leaves a nice frankenstein menu of translated and untranslated commands.

WeaponUnleash_cuteness.png


Is there anything that can be done for this plugin to stop causing trouble with the translation? I don't even know why this is happening.

Thank you for reading! Any help will be appreciated.

PS: This is Weapon Unleash http://www.yanfly.moe/wiki/Weapon_Unleash_(YEP)
I don't know if I can attach it to this thread since it's a paid plugin...

Edit: The translation plugin is vgperson's Custom Translation Engine https://vgperson.com/posts.php?p=cteguide
what translation plugin are you using to replace the skill names? There are two sides to an incompatibility issue regarding two plugins. a link to that one too would help
what translation plugin are you using to replace the skill names? There are two sides to an incompatibility issue regarding two plugins. a link to that one too would help
Oh, sorry! I'm using vgperson's Custom Translation Engine https://vgperson.com/posts.php?p=cteguide

For the record, I don't tend to have translation issues with other plugins, but Yanfly's always give me trouble.
Before YEP Weapon Unleash, I was using one of the official plugins called Weapon Skill, which does a similar thing (albeit it's more limited), and that one didn't interfere with the translation.
Maybe we need more details.
From your screenshot, which skill/commands are replaced by which? And what should they look like?
so, seeing as how theres a bit of setup needed to actually make sure this works and im am as lazy as i am, ill take a quick shot first and ask you if it works. try adding this as a plugin directly beneath the yanfly one

Code:
Window_ActorCommand.prototype.addAttackCommand = function() {
    Yanfly.WUL.Window_ActorCommand_addAttackCommand.call(this);
    var index = this.findSymbol('attack');
    if (index < 0) return;
    var name = CTE.getData("skills-"+this._actor.attackSkillId(), "name");
    this._list[index].name = name;
};
Window_ActorCommand.prototype.addGuardCommand = function() {
    Yanfly.WUL.Window_ActorCommand_addGuardCommand.call(this);
    var index = this.findSymbol('guard');
    if (index < 0) return;
    var name = CTE.getData("skills-"+this._actor.guardSkillId(), "name");
    this._list[index].name = name;
};

to actually test it myself i need to set up language files
Maybe we need more details.
From your screenshot, which skill/commands are replaced by which? And what should they look like?
Both Attack and Defend appear in the wrong language. This is what tends to happen: if you start the game in language A and change to language B, even if you changed it from the main menu before starting a new game, those commands will remain in language A while everything else will be sucessfully translated into B.



Here are some details that might help:

1-This bug affects both the "Attack" and "Defend" commands, whether or not they're being replaced by a different skill through a Weapon Unleash code. It doesn't affect the rest of the skills.

2-This bug affects weapons and armour as well. It doesn't affect normal items.

3-If I start the game in language A and change it to B, the battle commands will remain untranslated as I said, even if I F5 to restart. However, if I completely quit the game and start it again, the commands will translate to the language that was set when the game started. So the key seems to be at the very start.

4-Weapons and armour, however, won't be translated if I continue from a save file, no matter how many times I quit the game. They will forever stay in the language you first started the game with.




so, seeing as how theres a bit of setup needed to actually make sure this works and im am as lazy as i am, ill take a quick shot first and ask you if it works. try adding this as a plugin directly beneath the yanfly one

Code:
Window_ActorCommand.prototype.addAttackCommand = function() {
    Yanfly.WUL.Window_ActorCommand_addAttackCommand.call(this);
    var index = this.findSymbol('attack');
    if (index < 0) return;
    var name = CTE.getData("skills-"+this._actor.attackSkillId(), "name");
    this._list[index].name = name;
};
Window_ActorCommand.prototype.addGuardCommand = function() {
    Yanfly.WUL.Window_ActorCommand_addGuardCommand.call(this);
    var index = this.findSymbol('guard');
    if (index < 0) return;
    var name = CTE.getData("skills-"+this._actor.guardSkillId(), "name");
    this._list[index].name = name;
};

to actually test it myself i need to set up language files
Ohh, thank you for the code! That was close to working.
I stated above that these two battle commands will stay in the language the game is using when it starts. Your code seems to work and make it switch from one language to the other when changing language.

The problem is that the Spanish version (which is the original, thus the one I'm using in the Database), turns the commands into "null" (?)

WeaponUnleash_cuteness2.png


For some reason, the English version, which takes its translation from an external txt file, is displaying the names correctly.
WeaponUnleash_cuteness3.png


(There's also the problem of weapons and armour, which are also untranslated.)
This should work.
JavaScript:
Window_ActorCommand.prototype.addAttackCommand = function() {
  Yanfly.WUL.Window_ActorCommand_addAttackCommand.call(this);
  if (!ConfigManager.isBaseLanguage()) {
    var index = this.findSymbol('attack');
    if (index < 0) return;
    if (CTE.dataExists("skills-"+this._actor.attackSkillId(), "name")) {
      this._list[index].name = CTE.getData("skills-"+this._actor.attackSkillId(), "name");
    }
  }
};
Window_ActorCommand.prototype.addGuardCommand = function() {
  Yanfly.WUL.Window_ActorCommand_addGuardCommand.call(this);
  if (!ConfigManager.isBaseLanguage()) {
    var index = this.findSymbol('guard');
    if (index < 0) return;
    if (CTE.dataExists("skills-"+this._actor.guardSkillId(), "name")) {
      this._list[index].name = CTE.getData("skills-"+this._actor.guardSkillId(), "name");
    }
  }
};
This should work.
good catch.

4-Weapons and armour, however, won't be translated if I continue from a save file, no matter how many times I quit the game. They will forever stay in the language you first started the game with.
when you say it affects weapons and armor, does it affect them in every menu? or just certain ones? Id imagine that that would be caused between either the equip core plugin or the item core plugin. if you are using either of them, disable them and check to see if the equipment names change.
EFGRFGHGFH IT'S WORKING. It's working aaaaaah ;w;
Thank you very much, both of you! You're lifesavers!

I've also tried disabling Item Core as suggested, and that seems to solve the issue of weapons and armour not translating! I was using item core against my will, actually, just for another plugin that depends on it. But I've come up with a much better alternative, so I don't need it any longer.

Thank you again. I'm so relieved.
Sorry to bother again! I must bump this thread since I don't know how to touch the code myself... ;_;

The code I was given works great and makes the chosen language display property. That's very good, as the translation issue was a huge one. However, there is a small problem.

Upon testing a certain character, I've just noticed that the "Attack" and "Defend" commands, while perfectly translated, don't reflect the skill names from the "Skills" section in the editor. Rather, they seem to display the generic names chosen in the "Terms" section for Attack and Defend.

So, if a character uses a custom guard skill that has its own name, the name displayed will be the default "Defend" from the Terms section. Is there a way for the command to properly display the skill's name instead?

Thank you in advance, and I apologise for causing any inconvenience.

EDIT: Just in case, this is the code I'm using, provided by utunnels.
JavaScript:
Window_ActorCommand.prototype.addAttackCommand = function() {
  Yanfly.WUL.Window_ActorCommand_addAttackCommand.call(this);
  if (!ConfigManager.isBaseLanguage()) {
    var index = this.findSymbol('attack');
    if (index < 0) return;
    if (CTE.dataExists("skills-"+this._actor.attackSkillId(), "name")) {
      this._list[index].name = CTE.getData("skills-"+this._actor.attackSkillId(), "name");
    }
  }
};
Window_ActorCommand.prototype.addGuardCommand = function() {
  Yanfly.WUL.Window_ActorCommand_addGuardCommand.call(this);
  if (!ConfigManager.isBaseLanguage()) {
    var index = this.findSymbol('guard');
    if (index < 0) return;
    if (CTE.dataExists("skills-"+this._actor.guardSkillId(), "name")) {
      this._list[index].name = CTE.getData("skills-"+this._actor.guardSkillId(), "name");
    }
  }
};
its a little unclear
Upon testing a certain character
So, if a character uses a custom guard skill
is it that a specific character uses the attack and defend term, or is it that all characters use the terms and not the skill names?
when you use the attack skill anyways, does it use the right skill?
Oh, sorry! All the characters use the terms and not the skill names. They also use the proper skill, even if the skill name is replaced by the default name from the Terms editor.

I wouldn't normally mind, as most characters use the default "Attack" and "Defend" names, so there'd be no problem.

But there's one character who changes his guard skill depending on the shield he has equipped. So just because of him alone, I need the battle commands to display the skill names if possible.

If it's not possible, I'll find other ways to show that his guard has changed.
They also use the proper skill, even if the skill name is replaced by the default name from the Terms editor.
ok, thats strange.
so, random shot in the dark before anything else - take the plugin we've provided, make it the last one in your list, save the project, and test it. if that doesnt work, then can you share a screenshot of your plugin list?

alternatively, if you disable both the translation plugin and our plugin, does the problem still happen?

the plugin should be getting the name of the attack/defend skill directly. so if the name isnt showing up in the command list but the correct skill is being played anyways you might have a plugin that also affects the name within the command list. it doesnt look like the translation plugin would be the cause.

Original thread: https://forums.rpgmakerweb.com/threads/yep-weapon-unleash-conflicting-with-custom-translation-engine.172059/