Hello,
I'm using RPG Maker MZ and VisuStella's plugins and looking for a way to display different images/videos depending on the selected language. VisuStella's Message Core makes it possible to translate text and it works fine but my game has an intro movie and several images with text that cannot be translated in this manner.
So I considered making a conditional branch with a script call that could do that.
I tried all these and they don't work.
Is there a different script code I should use, or is this doomed from the start?
~~EDIT~~
Here's the solution:
1. Create a small plugin - LocalizationHelper.js:
2. Ensure Image Files Exist in the Correct Folders. Here are my paths:
img/pictures/English
img/pictures/Polish
3. Create an event and use a script call to show the image:
Change "YourImageName.png" to the name of your file.
Hope this helps!
I'm using RPG Maker MZ and VisuStella's plugins and looking for a way to display different images/videos depending on the selected language. VisuStella's Message Core makes it possible to translate text and it works fine but my game has an intro movie and several images with text that cannot be translated in this manner.
So I considered making a conditional branch with a script call that could do that.
I tried all these and they don't work.
◆Conditional Branch: Script: $gameSystem.language() === 'en' ◆Text: Showing English Image ◆Show Picture: #1, "Image_English", Upper Left (0,0), (100%,100%), 255, Normal ◆: Else ◆Conditional Branch: Script: $gameSystem._locale === 'en' ◆Text: Showing English Image (_locale) ◆Show Picture: #1, "Image_English", Upper Left (0,0), (100%,100%), 255, Normal ◆ : Else ◆Conditional Branch: Script: $gameVariables.value(ID) === 'en' ◆Text: Showing English Image (variable) ◆Show Picture: #1, "Image_English", Upper Left (0,0), (100%,100%), 255, Normal ◆ : Else ◆Text: No Match Found ◆ ◆ ◆◆Is there a different script code I should use, or is this doomed from the start?
~~EDIT~~
Here's the solution:
1. Create a small plugin - LocalizationHelper.js:
/*: * @plugindesc Localization Helper for Dynamic Image Paths * @target MZ */(function() { window.getLocalizedImagePath = function(imageName) { const locale = ConfigManager.textLocale || 'en'; // default to 'en' if not set return `/${locale}/${imageName}`; };})();2. Ensure Image Files Exist in the Correct Folders. Here are my paths:
img/pictures/English
img/pictures/Polish
3. Create an event and use a script call to show the image:
var imagePath = getLocalizedImagePath("YourImageName.png");$gameScreen.showPicture(1, imagePath, 0, 0, 0, 100, 100, 255, 0);Change "YourImageName.png" to the name of your file.
Hope this helps!