Hi everyone !
I'm on a project and I thought some of you might be interested in one topic I'm currently working on.
I'm sharing with you 3 different multi-language system I made.
1. Multi-language support + Compact Automatic NPC Structure System
alberta Sample V1.txt
In this file, all npcs are calling one function with an ID per npc, everything or almost everything is defined in this function (texts, menus, commands script, set, conditions, input). The script is then reading a common function-code that will generate the whole npc depending on the numbers ID in front of each line. There is no need of a npc structure anymore with this code. It calculates how many texts the npc should say, when to "next", when to "close", when to show a menu, set a variable, put a if condition, etc... All managed by numbers in the variable. Of course, the system is not fully done but it works. As I wrote on comment, I still need to change the conditions system to be able to read many conditions separately from each other but on the same dialogue. So far, it can read one/many conditions in one sentence and return false(0)/true(1) if the PJ has it. Also, It does need a duplication of menus/menus choices so the script can go on and on infinitely. Still in process.. But it is currently functional if you make sure 2 sub-menus are not displaying at the same time (same text number) in the choice of either menu- case1 or menu case-2 or menu case-3.
I probably also need to create an array table with ID/values for each and put the common code in a different function just to be more clean.
2. Multi-language support + Same old NPC structure alberta Sample V2.txt
In this file, all npcs are calling one function to determine in which language the texts will be. Simpler than the one above, variables names are only t1, t2, t3 etc.... t3a t3b only if there are many texts in the same window npc. It returns to each individual npcs that has the same structure (a for was made when there are many dialogues before a menu to make it compact). I also need to set the variables to 0 before each reading.
3. Multi-Language npcs
alberta.txt
In this file, all npcs are individual from each other, depending on the #langtype, it will display the texts in the same old structure.
Language default is english in case there aren't a translation available in the language associated with #langtype.
#langtype is a variable already existed in rathena, depending on the value of your #langtype (english is default), the messages from msg_conf will appear in the appropriate language that is located in conf/msg_conf. Also, a line has to be changed in src/common/msg_conf.hpp:
When the first system will be fully done, It would be great if someone can create an .exe that can automatically replace "mes" "menu" etc in all npcs at once by a variable$ number that follows a certain direction.
I'm interested to read your feedbacks, impressions, comments, suggestions, perhaps modifications?
If you have enough knowledge and are interested to help, please PM me.
Thank you ?