Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Tutorial] Make a Multi-Language Server (at 80%) (LTD Methode)

Experienced Elementalist
Joined
Apr 1, 2010
Messages
267
Reaction score
134
Hi all !

I will make a tut' because i no have make notting the last 7/8 month in flyff ...

Lot's of work in real life :/ but i be back soon for new ltd ...

SO , you want make a multi-language server ?

No problem with a easy way (but i not explain all atm because i have my own code and i cant release atm)

But it's not at 100% and he need to be clean, but work :p

(and sorry for my english)

Require :

- Soucre Code Flyff with v19 windows system (for have button with text, no picture)
- Visual studio adapted for your source
- Client of all version of flyff you need to translate


In my exemple i make only french / english translate

Tutoriel :

Go to _Common\xUtil.cpp

Find :

PHP:
int GetLanguage()
{
    ASSERT( g_nLanguage >= 0 );
    return g_nLanguage;
}

Change to :
PHP:
int GetLanguage()
{
#ifdef __CLIENT
    return g_Option.m_szLanguage;
#else
    return g_nLanguage;
#endif
}


Now go to _Common\HwOption.cpp

find :
PHP:
#if __VER >= 12 // __UPDATE_OPT
    else if(scan.Token == _T( "VIEWMASK" ))
    {
        m_bViewMask = scan.GetNumber();
    }
#endif

Add after :
PHP:
    // systeme de lang
    else if(scan.Token == _T("Language") )
    {
        m_szLanguage = scan.GetNumber();
    }


Find :
PHP:
    m_nToolTipText = 0;
Add After :
PHP:
    //systeme de langue
#define LANG_USA 1
#define LANG_FRE 8
    m_szLanguage = LANG_USA;
    //


FIND:
PHP:
#if __VER >= 12 // __UPDATE_OPT
    _ftprintf(fp, _T( "VIEWMASK %d\n" ), m_bViewMask );
#endif
Add after :
PHP:
    // systeme de langue
    _ftprintf(fp, _T( "Language %d\n" ), m_szLanguage );


So if you understend ,by default he use Usa language and read the INI for look lang ( just with your patcher make 2 flag for change lang and it's ok :p)

Go To _Common\HwOption.h

Find :
PHP:
TCHAR   m_szAccount[ 64 ];
Add after :
PHP:
int   m_szLanguage;


So yes now it's okey but you not see were change the language ?

I'm comming ... just be cool and look the next

Go to _Common\ProjectCmn.cpp

Ok in your interest make a backup before (because i'm to tired for make a define)

Find :
PHP:
void CProject::LoadStrings()
{
	char* lpszFiles[] = {
		"character.txt.txt",
		"character-etc.txt.txt",
		"character-school.txt.txt",
		"etc.txt.txt",
		"propCtrl.txt.txt",
		"propItem.txt.txt",
		"propItemEtc.txt.txt",
		"propKarma.txt.txt",
		"propMotion.txt.txt",
		"propMover.txt.txt",
		"propQuest.txt.txt",
		"propQuest-DungeonandPK.txt.txt",
		"propQuest-RequestBox2.txt.txt",
		"propQuest-RequestBox.txt.txt",
		"propQuest-Scenario.txt.txt",
		"propSkill.txt.txt",
		"propTroupeSkill.txt.txt",
		"resData.txt.txt",
		"textClient.txt.txt",
		"textEmotion.txt.txt",
		"world.txt.txt",
		"Client\\treeHelp.txt.txt",
		"Client\\tip.txt.txt",
		"Client\\PatchClient.txt.txt",
		"Client\\InstantHelp.txt.txt",
		"Client\\help.txt.txt",
		"Client\\Guide.txt.txt",
#if __VER >= 12 // __MOD_TUTORIAL
		"Client\\tutorial.txt.txt",
#endif
//		"Client\\GameGuard.txt.txt",
		"Client\\faq.txt.txt",
		"World\\WdVolcane\\WdVolcane.txt.txt",
		"World\\WdMadrigal\\wdMadrigal.txt.txt",
		"World\\WdKebaras\\WdKebaras.txt.txt",
		"World\\WdGuildWar\\WdGuildWar.txt.txt",
		"World\\WdEvent01\\WdEvent01.txt.txt",
		"World\\DuMuscle\\DuMuscle.txt.txt",
		"World\\DuKrr\\DuKrr.txt.txt",
		"World\\DuFlMas\\DuFlMas.txt.txt",
		"World\\DuDaDk\\DuDaDk.txt.txt",
		"World\\DuBear\\DuBear.txt.txt",
		"World\\DuSaTemple\\DuSaTemple.txt.txt",
		"World\\DuSaTempleBoss\\DuSaTempleBoss.txt.txt"
#if __VER >= 9	// __JEFF_9
		,"World\\WdVolcane\\WdVolcane.txt.txt"
		,"World\\WdVolcaneRed\\WdVolcaneRed.txt.txt"
		,"World\\WdVolcaneYellow\\WdVolcaneYellow.txt.txt"
#endif	// __JEFF_9
#ifdef __JEFF_11_4
		,"World\\WdArena\\WdArena.txt.txt"
#endif	// __JEFF_11_4
#if __VER >= 12 // __LORD
		,"lordskill.txt.txt"
#endif	// __LORD
#if __VER >= 12 // __SECRET_ROOM
		,"World\\WdHeaven01\\wdheaven01.txt.txt"
		,"World\\WdHeaven02\\wdheaven02.txt.txt"
		,"World\\WdHeaven03\\wdheaven03.txt.txt"
		,"World\\WdHeaven04\\wdheaven04.txt.txt"
		,"World\\WdHeaven05\\wdheaven05.txt.txt"
		,"World\\WdHeaven06\\wdheaven06.txt.txt"
		,"World\\WdHeaven06_1\\wdheaven06_1.txt.txt"
#endif // __SECRET_ROOM
#if __VER >= 13 // __HONORABLE_TITLE
		, "honorList.txt.txt"
#endif	// __HONORABLE_TITLE
#ifdef __AZRIA_1023
		, "World\\WdCisland\\WdCisland.txt.txt"
#endif // __AZRIA_1023
#if __VER >= 14 // __INSTANCE_DUNGEON
		, "World\\DuOminous\\duominous.txt.txt"
		, "World\\DuOminous_1\\duominous_1.txt.txt"
#endif // __INSTANCE_DUNGEON
#if __VER >= 15 // __GUILD_HOUSE
		, "World\\WdGuildhousesmall\\WdGuildhousesmall.txt.txt"		// ¼ÒÇü ±æµåÇϿ콺
		, "World\\WdGuildhousemiddle\\WdGuildhousemiddle.txt.txt"	// ÁßÇü ±æµåÇϿ콺
		, "World\\WdGuildhouselarge\\WdGuildhouselarge.txt.txt"		// ´ëÇü ±æµåÇϿ콺
		, "World\\DuDreadfulCave\\DuDreadfulCave.txt.txt"			// Ãß°¡ Àδø(µå·¡µåÇ® ÄÉÀ̺ê)
		, "World\\DuRustia\\DuRustia.txt.txt"						// Ãß°¡ Àδø(·¯½ºÆ¼¾Æ ÀϹÝ)
		, "World\\DuRustia_1\\DuRustia_1.txt.txt"					// Ãß°¡ Àδø(·¯½ºÆ¼¾Æ ¸¶½ºÅÍ)
#endif // __GUILD_HOUSE
#ifdef __IMPROVE_MAP_SYSTEM
		, "propMapComboBoxData.txt.txt"
#endif // __IMPROVE_MAP_SYSTEM

		, "World\\DuBehamah\\DuBehamah.txt.txt"
		, "World\\WdRartesia\\WdRartesia.txt.txt"
		, "World\\WdArena_1\\WdArena_1.txt.txt"
		, "World\\DuKalgas\\DuKalgas.txt.txt"
		, "World\\DuKalgas_1\\DuKalgas_1.txt.txt"
		, "World\\DuKalgas_2\\DuKalgas_2.txt.txt"
		, "World\\WdColosseum\\WdColosseum.txt.txt"
		#ifdef __V6_JAIL
		, "World\\WdKebaras2\\WdKebaras.txt.txt"
		#endif
	};

	int n = sizeof(lpszFiles) / sizeof(lpszFiles[0]);
	for( int i=0; i<n; ++i )
	{
		CScript s;
		if( s.Load( lpszFiles[i] ) == TRUE )
			s.LoadString();
	}		

	LoadText( "textClient.inc" );
}

remplace by:
PHP:
void CProject::LoadStrings()
{
//PreLoadTxt.inc
    CScript scanner;
    DWORD dwLanguage    = ::GetLanguage();
    CString fileName;
    switch( dwLanguage )
    {
        case LANG_USA:
            {
                fileName = "PreLoadText_USA.inc";
                break;
            }
        case LANG_FRE:
            {
                fileName = "PreLoadText_FRE.inc";
                break;
            }
        default:
            {
                fileName = "PreLoadText.inc";
                break;
            }
    }
    if( scanner.Load( fileName ) == FALSE )
    {
        Error( "%s - Introuvable !",fileName );
        exit(0);
    }
    else
    {
// On Boucle ma grosse ?
        scanner.GetToken();
        while( scanner.tok != FINISHED )
        {
         // COMMON ou CLIENT ou SERVER 

        if ( scanner.Token == "CLIENT")
        {
#ifdef __CLIENT
        scanner.GetToken();
        CString str    = scanner.token;
        CScript s;
        if( s.Load( str ) == TRUE )
        {
            //Error( "%s - lancer !",str );
            s.LoadString();
        }
        else
        Error( "%s - Introuvable !",str );
#endif
        }
        else
        if ( scanner.Token == "SERVER")
        {
#if defined(__DBSERVER) || defined(__WORLDSERVER)
        scanner.GetToken();
        CString str    = scanner.token;
        CScript s;
        if( s.Load( str ) == TRUE )
        {
            //Error( "%s - lancer !",str );
            s.LoadString();
        }
        else
        Error( "%s - Introuvable !",str );
#endif
        }
        else
        if ( scanner.Token == "COMMON")
        {
        scanner.GetToken();
        CString str    = scanner.token;
        CScript s;
        if( s.Load( str ) == TRUE )
        {
            //Error( "%s - lancer !",str );
            s.LoadString();
        }
        else
        Error( "%s - Introuvable !",str );
    }    
            //            if( str.IsEmpty() )
//                str    = "Empty";
        scanner.GetToken(); // next ?
    }
}


    LoadText( "textClient.inc" );
}

Now build your exe

Now you need add into your Resources 2/3 files (PreLoadText_USA.inc, PreLoadText_FRE.inc,PreLoadText.inc) --> i make for you exemple files



and now extract by exemple all .txt.txt of the french client , add "_FRE" after all name and add to your client , make same for your USA client

And now update resources , change lang in INI and run your neuz

So it's work :D

The only problem it's npc :( Npc speak the server language ...

If you like --> use like button :p
 
Last edited:
Experienced Elementalist
Joined
Apr 1, 2010
Messages
267
Reaction score
134
i'm french, if i make video you , can't understend xD.

Or you want make a video ? (if yes you can xD it's not my problem if you say thx to jtb1)

But you can explain what you not understend?

If you not understend the thread :

It's for make a multi-language client without use official system, using one client for all language with same neuz just edit neuz.ini for use other lang :D
 
Last edited:
Back
Top