Jump to content

Multi-Language System NPCs + Compact NPC system


grenat50

Recommended Posts


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.01
  • Content Count:  69
  • Reputation:   79
  • Joined:  02/20/20
  • Last Seen:  

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:

 

Quote

 

enum lang_types {
    LANG_RUS = 0x01,
    LANG_SPN = 0x02,
    LANG_GRM = 0x04,
    LANG_CHN = 0x08,
    LANG_MAL = 0x10,
    LANG_IDN = 0x20,
    LANG_FRN = 0x40,
    LANG_POR = 0x80,
    LANG_THA = 0x100,
    LANG_MAX
};

#ifndef LANG_ENABLE
    // Multilanguage System.
    // Define which languages to enable (bitmask).
    // 0xFFF will enable all, while 0x000 will enable English only.
    #define LANG_ENABLE 0xFFF
#endif

 

 

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 ?

 

Edited by grenat50
  • Upvote 1
  • Like 3
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...