Jump to content
VegaS™

c++ [C++/Py] Metin2 - Extended Alignment System

Recommended Posts

@avertuss 

Your compiler doesn't support this feature (list initialization (since C++11)). 

Replace:

	const std::vector<const std::string> vecTitleName{c_szTitleNameF, c_szTitleNameM};

With:

	std::vector<const std::string> vecTitleName;
	vecTitleName.push_back(c_szTitleNameF);
	vecTitleName.push_back(c_szTitleNameM);

Or:

	const char * c_szTitles[] = {c_szTitleNameF, c_szTitleNameM};
	const std::vector<const std::string> vecTitleName(c_szTitles, c_szTitles + sizeof(c_szTitles) / sizeof(c_szTitles[0]));

 

  • Love 3

Share this post


Link to post
1 hour ago, PeaceMaker said:

so if its female there's an F next to it ? 
or did i get it wrong

Exactly. Might seem a small system at first, but if you think about it many languages could use this to develop systems for better dialogs or information. GJ man :)

  • Love 1

Share this post


Link to post
52 minutes ago, Mind Rapist said:

Exactly. Might seem a small system at first, but if you think about it many languages could use this to develop systems for better dialogs or information. GJ man :)

Yeah but having an F next to Alignment makes no sense xD 

Share this post


Link to post
2 minutes ago, PeaceMaker said:

Yeah but having an F next to Alignment makes no sense xD 

 

Quote

Title names for female are just for test, you can replace them how you want.

In many games the alignment or grades are by specific sex.

Share this post


Link to post
il y a 31 minutes, PeaceMaker a dit :

Yeah but having an F next to Alignment makes no sense xD 

It's for example purposes. You can change it for a lot of things and pretty much whatever you want. This system is really usefull as it changes alignment name based on the sex of the player, which is not especially useful in english but it is in a lot of languages. For example in French "Agressif / Agressive" "Cruel / Cruelle" "Chevalier / Chevaleresse".

  • Love 2

Share this post


Link to post
2 minutes ago, Galet said:

It's for example purposes. You can change it for a lot of things and pretty much whatever you want. This system is really usefull as it changes alignment name based on the sex of the player, which is not especially useful in english but it is in a lot of languages. For example in French "Agressif / Agressive" "Cruel / Cruelle" "Chevalier / Chevaleresse".

Ahh gotcha . im english that's why :D 

  • Love 2

Share this post


Link to post

@VegaS™

Hi Vegas. I updated vs2008 to vs2015 and i have problem with compile.

logs

17>  InstanceBaseEffect.cpp
17>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xmemory0(665): error C2338: The C++ Standard forbids containers of const elements because allocator<const T> is ill-formed.
17>  InstanceBaseEffect.cpp(750): note: see reference to class template instantiation 'std::allocator<_Ty>' being compiled
17>          with
17>          [
17>              _Ty=const std::string
17>          ]
17>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xmemory0(695): error C2535: 'const std::basic_string<char,std::char_traits<char>,std::allocator<char>> *std::allocator<_Ty>::address(const std::basic_string<char,std::char_traits<char>,std::allocator<char>> &) noexcept const': member function already defined or declared
17>          with
17>          [
17>              _Ty=const std::string
17>          ]
17>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xmemory0(689): note: see declaration of 'std::allocator<_Ty>::address'
17>          with
17>          [
17>              _Ty=const std::string
17>          ]
17>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xmemory0(930): error C2535: 'const std::basic_string<char,std::char_traits<char>,std::allocator<char>> *std::_Wrap_alloc<std::allocator<_Ty>>::address(const std::basic_string<char,std::char_traits<char>,std::allocator<char>> &) const': member function already defined or declared
17>          with
17>          [
17>              _Ty=const std::string
17>          ]
17>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xmemory0(924): note: see declaration of 'std::_Wrap_alloc<std::allocator<_Ty>>::address'
17>          with
17>          [
17>              _Ty=const std::string
17>          ]
17>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\vector(450): note: see reference to class template instantiation 'std::_Wrap_alloc<std::allocator<_Ty>>' being compiled
17>          with
17>          [
17>              _Ty=const std::string
17>          ]
17>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\vector(502): note: see reference to class template instantiation 'std::_Vec_base_types<_Ty,_Alloc>' being compiled
17>          with
17>          [
17>              _Ty=const std::string,
17>              _Alloc=std::allocator<const std::string>
17>          ]
17>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\vector(680): note: see reference to class template instantiation 'std::_Vector_alloc<std::_Vec_base_types<_Ty,_Alloc>>' being compiled
17>          with
17>          [
17>              _Ty=const std::string,
17>              _Alloc=std::allocator<const std::string>
17>          ]
17>  InstanceBaseEffect.cpp(750): note: see reference to class template instantiation 'std::vector<const std::string,std::allocator<_Ty>>' being compiled
17>          with
17>          [
17>              _Ty=const std::string
17>          ]

code

26b7b2645181d2cbe69cccb543d41d26.png

Share this post


Link to post

Yeah, many languages have different ending of the words, but neither every word has the same ending too.
Anyway, the initiation is good.

  • Love 1

Share this post


Link to post

Hi where can i solve that if it polymorph then do not write female rank for male character?

  • Love 1

Share this post


Link to post
On 3/1/2019 at 10:07 AM, Ultor said:

Hi where can i solve that if it polymorph then do not write female rank for male character?

Thanks for report, i commited the fix and now works fine.

59b614c8504d9b7cc8b9eb27002c2836.gif

[hide]

Or check again the base repository.

[/hide]

  • Love 2

Share this post


Link to post

Hi. Do you know why i have that errors when i want compile binary with this system? 

cfe70484c9101e928be7618e1accab9f.png

if i disable this system in locale.inc.h i can compile binary without errors. I'm using vs2015. 

Share this post


Link to post

I have this error

	0303 23:34:25938 :: Traceback (most recent call last):
	0303 23:34:25939 ::   File "introLoading.py", line 207, in LoadData
	0303 23:34:25939 ::   File "introLoading.py", line 294, in __RegisterTitleName
	0303 23:34:25939 :: NameError
0303 23:34:25939 :: : 
0303 23:34:25939 :: global name 'enumerate' is not defined
0303 23:34:25939 :: 
	

and

	0303 23:43:54710 :: <string>:292: Warning: 'yield' will become a reserved keyword in the future
	0303 23:43:54729 :: 
networkModule.py(line:238) SetLoadingPhase
system.py(line:130) __pack_import
	networkModule.SetLoadingPhase - exceptions.SyntaxError:invalid syntax (line 292)
	0303 23:43:54729 :: ============================================================================================================
0303 23:43:54729 :: Abort!!!!
	

 

Function

 

	yield tuple(map(next, titleNamesTuple))
	

 

and 

	for titleNameIndex, (titleNameFemale, titleNameMale) in enumerate(GetTitleNamesTuple(GetTitleData(locale.GENDER_FEMALE), GetTitleData(locale.GENDER_MALE))):
                chrmgr.RegisterTitleName(titleNameIndex, titleNameFemale, titleNameMale)
	

Share this post


Link to post

@dmitry Your problem is in localeInfo.py (korean characters + bad encoding)

Here's your localeInfo.py fixed.

For those who have the same issue, check this reply, you'll find the file rewritted with non-korean shits and a lot of checks useless:

 

  • Love 1

Share this post


Link to post
2 hours ago, VegaS™ said:

@dmitry Your problem is in localeInfo.py (korean characters + bad encoding)

Here's your localeInfo.py fixed.

For those who have the same issue, check this reply, you'll find the file rewritted with non-korean shits and a lot of checks useless:

 

thank u,but i have the same eror in the end of file

Снимок.PNG

 solve that(my bad im dummy,fogot  endl in localeinfo.py)

but now , client off when char is selected and syserr

 

syserr

sloved by update python to 2.7 from 2.2

 

Share this post


Link to post

I have an error in the character's page, we do not see the name of the rank and the points

Share this post


Link to post

Bump, i cant compile client with vs 2017 with this system, but i can compile with vs 2013.

I can compile client with vs 2017 without system.

Share this post


Link to post
On 1/15/2019 at 4:21 AM, VegaS™ said:

 

In many games the alignment or grades are by specific sex.

I agree. I'm guessing that you can have different titles for both sex. For eg: a male char could get 'Warrior' status for 20k align points while a female char would get 'Valkyrie' status for same align points. Simple and efficient @VegaS™ Gj

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.