InsaneMonster
Hosted Project: W3RR
- Joined
- Jul 20, 2011
- Messages
- 547
WARNING: This tutorial can be applied only to Warcraft 3 Reforged!
GOAL
To show how to localize Warcraft 3 Reforged dialogues. Dialogues are the entities used to play sound with linked facial animation, as explained in this other tutorial:
How to: Warcraft 3 Reforged Animated Portraits
KNOWLEDGE REQUIRED
- How to create and edit animated portraits in Warcraft 3 Reforged World Editor (OPTIONAL)
- How to localize Warcraft 3 Reforged maps' strings
- Basic knowledge of the Trigger Editor
- Basic knowledge of the Object Editor
- Warcraft 3 Reforged World Editor
TABLE OF CONTENT
- BACKGROUND (OPTIONAL)
- CREATE DIALOGUES ITEMS
- ASSIGN ITEMS PROPERTIES TO DIALOGUES
BACKGROUND (OPTIONAL)
This section provides insights into why this workaround is necessary with respect to the usual localization capabilities offered by Warcraft 3 Reforged.
To localize assets in Warcraft 3 Reforged is as easy as selecting the appropriate locale in the Asset Manager. To localize strings is just slightly more complex, requiring first to export the map native strings and then import back each localized version as war3map.wts files with the Asset Manager, setting the appropriate locale as per every other asset.
There are, however, some problems with dialogues.
The really bad news is that dialogues texts don't show up in the .wts file exported by the editor (dialogues are throughly explained in this tutorial about animated portraits in Reforged)
Some may say: "Wait, Blizzard's official campaigns dialogues texts do show up!" and you would be right.
Problem is, to make such dialogues Blizzard used something called the Dialogue Editor, which is a cut feature in the editor released to public, our editor, probably because it was very unstable. The functions we all use to set up dialogues texts don't add any string to the .wts file.
"So we are doomed!" many would say.
No, we just need to find a good workaround. First of all, we need to understand when a localized asset, in this case the .wts file, is loaded. This is done before the map is initialized, when the engine checks for the current locale in the settings and it loads all the assets accordingly.
"So, if we can use our dialogues functions with strings already localized, it could work?" you might ask, and the answer is yes.
Now, we need to think about something that has many text fields in which we can store all the dialogue information (speaker name and spoken text) and that is for sure available in the .wts file. This information will be transferred at runtime to the dialogue through the functions we all use and love. I think the best choice for this very something are items.
The tutorial that follows is about just that.
CREATE DIALOGUES ITEMS
This section show how to create dialogue items with the format I use in Warcraft 3 Re-Reforged. It should give you an idea on how these items are defined.
This will be very short, for it's very easy. Basically, I use the dialogue sound variable name as the item name. Then I use the description as the dialogue spoken text and, finally, the basic tooltip as speaker name.
ASSIGN ITEMS PROPERTIES TO DIALOGUES
This section show how to use dialogues GUI functions to assign the localized strings stored in the items to the dialogues at runtime.
As it's possible to see in each and every Warcraft 3 Re-Reforged map, for each additional (not already inserted into the map in Blizzard's default campaigns) dialogue the following is used, during initialization of the map:
The first custom script loads the facial animation for the dialogue, as explained here.
The second action creates the item with the same name of the dialogue sound. Then, speaker name and dialogue text (or spoken text) are assigned from the item properties, which are localized already at the time of executing this (indeed, remember that localized assets are loaded before initialization).
Finally, the item is removed, making this system completely transparent to the player.
CONCLUSIONS
You can now localized your animated portaits. I know it's a workaround, but it works quite well and it provides a minimum overhead. Hopefully, one day we will have the dialogue editor and stuff like this could be deprecated.
Hope you liked the tutorial, have fun localizing these dialogues!
Attachments
Last edited: