Jump to content

VegaS™

Forum Moderator
  • Posts

    656
  • Joined

  • Last visited

  • Days Won

    187
  • Feedback

    100%

Posts posted by VegaS™

  1. (2.5) Questions & Answers specific rules

    • Don't modify your thread (or reply to it) to mark it solved, and not explain the solution to the issue.

    For these who wants this, there're two simple methods:

    •  1. Disable for all maps.

    This is the hidden content, please

    • 2. Disable for a specific map.
    # Search in CANNOT_SEE_INFO_MAP_DICT for:
    		"metin2_map_devilsCatacomb" : False,
    # Add after:
    		"metin2_your_map_name" : False,
    • Metin2 Dev 17
    • Lmao 1
    • Good 4
    • Love 3
    • Love 14
  2. On 12/2/2019 at 3:33 PM, ManiacRobert said:

    Why while statement lol

    The while is with a scope, he wanted to make for each player an specific position, not random position.

    @jeddawee You could atleast to post the FWarpToPosition from party.cpp, i see that you use the struct without the first argument as lMapIndex like dungeon.cpp, if you use another struct and not the one from dungeon.cpp, just send me a pm and let's don't make a spam topic.

    This is the hidden content, please

     

    • Metin2 Dev 3
    • Love 1
  3. 2 hours ago, filipw1 said:

    My guess is that string formating wasn't a thing when they did that code, so they coded it just to work somewhat good. 

    The function NumberToSecondaryCoinString which i posted is recent in their root, format string exists since Python 2.6, 11 years ago. Who stop them to use it? Nobody, they do a lot of things in a hard-way, they don't use many builtin functions which doing the same thing even in 2019, they prefer to do it manually in a hard way , they like old ways.

    Btw, i don't see the reason why we talk about this since we talked about 'refactoring', which means advantages include improved code readability and reduced complexity, doesn't matter what they had before.

    I think it's enough for today, let's don't talk about this anymore here, i'll update the gist link when i've time with these functions modified, thanks for support.

    • Metin2 Dev 1
    • Love 2
  4. You're right, then let's refactor this shit.

    Ymir method:

    def NumberToMoneyString(n) :
    	if n <= 0 :
    		return "0 %s" % (MONETARY_UNIT0)
    	return "%s %s" % ('.'.join([ i-3<0 and str(n)[:i] or str(n)[i-3:i] for i in range(len(str(n))%3, len(str(n))+1, 3) if i ]), MONETARY_UNIT0)
      
    def NumberToSecondaryCoinString(n, coinType) :
    	if n <= 0:
    		n = 0
    
    	coinTypeString = ""
    	if coinType == shop.SHOP_COIN_TYPE_SECONDARY_COIN:
    		coinTypeString = MONETARY_UNIT_JUN
    	elif coinType == shop.SHOP_COIN_TYPE_BATTLE_POINT:
    		coinTypeString = BATTLE_POINT
    	elif app.ENABLE_10TH_EVENT and coinType == shop.SHOP_COIN_TYPE_10TH_EVENT:
    		coinTypeString = TENTH_COIN
    	else:
    		return "Not Valied"
    
    	return "%s %s" % ('.'.join([ i-3<0 and str(n)[:i] or str(n)[i-3:i] for i in range(len(str(n))%3, len(str(n))+1, 3) if i ]), coinTypeString)

    My method:

    This is the hidden content, please

    236cbaece01052cf31d3764bb32e7124.png

    And yes, Ymir killed the python for no-reason.

    • Metin2 Dev 19
    • kekw 1
    • Dislove 1
    • Good 6
    • Love 1
    • Love 13
  5. 27 minutes ago, filipw1 said:

    I don't get it. You did rewrite bunch of functions except for last 3.

    I didn't rewrote the functions, is the same code, maybe removed unused lines or put them inline.

    Let's take an example, this:

    def GetAlignmentTitleName(alignment):
    	if alignment >= 12000:
    		return TITLE_NAME_LIST[0]
    	elif alignment >= 8000:
    		return TITLE_NAME_LIST[1]
    	elif alignment >= 4000:
    		return TITLE_NAME_LIST[2]
    	elif alignment >= 1000:
    		return TITLE_NAME_LIST[3]
    	elif alignment >= 0:
    		return TITLE_NAME_LIST[4]
    	elif alignment > -4000:
    		return TITLE_NAME_LIST[5]
    	elif alignment > -8000:
    		return TITLE_NAME_LIST[6]
    	elif alignment > -12000:
    		return TITLE_NAME_LIST[7]
    
    	return TITLE_NAME_LIST[8]

    We could do it as (just example, ignore the comparation): (without making a dictionary)

    def GetAlignmentTitleName(currentAlignment):
    	for alignmentIndex, alignmentValue in enumerate((12000, 8000, 4000, 1000, 0, -4000, -8000, -12000)):
    		if currentAlignment >= alignmentValue:
    			return TITLE_NAME_LIST[alignmentIndex]
    	return TITLE_NAME_LIST[-1]

    Do you think people will understand it so well what's the index if they don't know what the function does?
    That's why i didn't touch these functions, they've edited (like added alignment grades) and don't know how to extend it.

    Btw, if you want to discuss this, we can go in off-topic category, already is enough.

    • Love 3
  6. 22 minutes ago, hardy89 said:

    thank you

    Some functions would be shorter and more efficient with certain functions ...
    Like

    
    def SecondToHM(time):
      return " ".join(map(str, divmod(time, 60)))

     

    I could rewrite all of the functions and structure but i don't do it because the scope was to clean it not to change all structure, i did this long time ago.. if you saw the date.

    Btw, It's funny how you talk about shorter and efficient functions in python while...

    The code everytime can be improved, i don't like maybe a lot of scripts from metin2, but that doesn't means i've to rewrite them, there's isn't so much performance for a python script, if we don't talk about loops, searching, sort etc, it's fine how is it right now.

    • Love 2
  7. 43 minutes ago, ManiacRobert said:

    we don't search people to "fix" bugs for us, we searching people to create custom systems on their source

    6 hours ago, Lysium said:

    Hello, we want to expand our server, so we are searching for people who can improving / fixing the server

    I think i'm tired or there's something wrong with what're you searching?
    At least a developer has access to a part of source, what you want is an collaborator, different term.
    There was guys smarter and they still suffered, just have careful, even if he's an collaborator, he still can fuck the server, was a friendly advice, just take it right, that's all.

    • Love 3
  8. One advice:

    Some of the big servers did the same mistake like you, making a topic in forum for search a 'dev' and a lot of 'devs' tried to apply for position, the funny fact is that they didn't received any test for showing their experience in programming, the 'interview' was based on words, sending files and bullshits praise of self.

    If you want to find a capable guy to be one of your developer, then you need to have another good guy to give him a test in a specific language of what you need.

    The interview should be based on general knowledge of programming, not to do a small shit system where he can do copy-paste of existing functions from public systems. If he can't do an specific algorithm (to see his logic/mindset) in a live interview, then he's not your man.

    If you don't take my advice then you'll have the same destiny as Aeldra/SG and more..(recently), they added some retard 'devs' and they fucked up their server, then they was thrown out and remained with all of their resources.

    Be careful, metin2 scene is full of bullshit in 2019, now everybody is a developer, there exists so many public/leaked resources which they can take the idea/structure/code and add/change something and put it to sell and voila, let's do a topic in coding category and a website and make money from nothing.

    There're very few people right now which are good but you'll not see them to work for you, because if they're smart enough and have solid experience, they can do a lot of money alone, i don't think you can pay for how much they deserve and also most of the time, they're not available.

    • Love 12
  9. On 11/23/2019 at 8:09 PM, Paikei said:

    uitip.py in root

    No, you can't change the font size for TextBar (/n) in python, just for BigTextBar (/b).

    db58ad32020eada68f47d371302d29e9.gif

    Client\src\eterPythonLib\PythonGraphicModule.cpp

    This is the hidden content, please

    #root/uiTip.py
    #class TipBoard(ui.Bar):
    # Search for:
    		self.width = 370
    # Replace with:
    		self.width = 740
    
    # Search for:
    	STEP_HEIGHT = 17
    # Replace with:
    	STEP_HEIGHT = 34
    
    # Search for:
    		self.SetSize(370, 20)
    # Replace with:
    		self.SetSize(self.width, 40)
    		
    # Search for:
    		self.textBar = TextBar(370, 300)
    # Replace with:
    		self.textBar = TextBar(self.width, 600)
    
    # Search for:
    		self.textBar.SetClipRect(0, y, wndMgr.GetScreenWidth(), y+18)
    # Replace with:
    		self.textBar.SetClipRect(0, y, wndMgr.GetScreenWidth(), y+self.STEP_HEIGHT+2)
    • Metin2 Dev 12
    • Eyes 1
    • Good 2
    • Love 11
  10. On 11/22/2019 at 10:22 PM, Mali61 said:
    
    void CSoundManager::MuteSound(bool b)
    {
    	m_isMuted = !m_isMuted;
    	if (m_isMuted) {
    		StopAllSound3D();
    		for (int i = 0; i < CSoundManager2D::INSTANCE_MAX_COUNT; ++i) {
    			ISoundInstance* pInstance = ms_SoundManager2D.GetInstance(i);
    			if (pInstance) pInstance->Stop();
    		}
    	}
    	if (b) {
    		for (int i = 0; i < CSoundManagerStream::MUSIC_INSTANCE_MAX_NUM; ++i) {
    			TMusicInstance& rMusicInstance = m_MusicInstances[i];
    			for (const auto& dmiss : { MUSIC_STATE_OFF , MUSIC_STATE_FADE_OUT })
    				if (dmiss == rMusicInstance.MusicState)
    					continue;
    			auto pInstance = ms_SoundManagerStream.GetInstance(i);
    			if (pInstance) m_isMuted ? pInstance->Pause() : pInstance->Resume();
    		}
    	}
    	char buf[15];
    	snprintf(buf, sizeof(buf), "Mute %s", m_isMuted ? "Enabled." : "Disabled.");
    	IAbstractChat::GetSingleton().AppendChat(1, buf);
    }

     

    Good idea, thanks for release.

    But here's one thing, C++ doesn't work like this, you did two loops and in the second loop you're trying to continue with the next iteration in the loop of iterator i, but this will not work, you continue the dmiss iterator, not i.

    Basically what you did is:

    for (int i = 0; i < 5; ++i)
    {
    	for (int j = 0; j < 3; ++j)
    		if (j == 2)
    			continue;
    
    	std::cout << i << std::endl;
    }
    // 0 1 2 3 4

    You need something like:

    This is the hidden content, please

    But in your case just for check two values, you don't need nested loops, using a simple condition for state OFF and FADE_OUT it's enough, also you should create StopAllSound2D function and use auto for all references/pointers.

    void CSoundManager::StopAllSound2D()
    {
    	for (uint8_t i = 0; i < CSoundManager2D::INSTANCE_MAX_COUNT; ++i)
    	{
    		const auto pSoundInstance = ms_SoundManager2D.GetInstance(i);
    		if (pSoundInstance)
    			pSoundInstance->Stop();
    	}
    }
    
    void CSoundManager::MuteSound(const bool bFadeIn)
    {
    	m_isMuted = !m_isMuted;
    	if (m_isMuted)
    	{
    		StopAllSound2D();
    		StopAllSound3D();
    	}
    
    	if (bFadeIn)
    	{
    		for (uint8_t i = 0; i < CSoundManagerStream::MUSIC_INSTANCE_MAX_NUM; ++i)
    		{
    			const auto rMusicInstance = m_MusicInstances[i];
    			if (rMusicInstance.MusicState == MUSIC_STATE_OFF || rMusicInstance.MusicState == MUSIC_STATE_FADE_OUT)
    				continue;
    
    			const auto pSoundInstance = ms_SoundManagerStream.GetInstance(i);
    			if (pSoundInstance)
    				m_isMuted ? pSoundInstance->Pause() : pSoundInstance->Resume();
    		}
    	}
    
    	char buf[15];
    	_snprintf(buf, sizeof(buf), "Mute %s.", m_isMuted ? "Enabled" : "Disabled");
    	IAbstractChat::GetSingleton().AppendChat(1, buf);
    }
    • Metin2 Dev 1
    • Love 9
  11. 1 hour ago, xP3NG3Rx said:

    f78dbf8b4a.png

    Thanks girl, i forgot about it, fixed. (i didn't had that problem before, so, i can't test it)

    Btw, isn't the last version, when i'll have some time again, i'll refactor it.

    EDIT:

    He've vnum_range in item_names.txt too, the default version, haven't this.

    I'll update the repository for these who've it too, asap. (even if nobody have it like ??)

    • Metin2 Dev 1
    • Love 1
  12. UPDATE (i don't have so much time at the moment to do a proper documentation, i'll do asap)

    Here's a diff: 

    This is the hidden content, please

    • Read the files with csv library
    • Added output file for logs
    • Fixed index position of duplicate items
    • Support for vnum range
    • more...

    You can drag your files into resource folder and run the .bat

    32607e0afec29e294c33679ad176f5b3.png

    + uploaded on git:

    • Metin2 Dev 5
    • Sad 1
    • Love 6
  13. On 11/20/2019 at 9:44 AM, Helia01 said:

    it turns out instead of the standard mobs it allows you to make all the mobs visually dogs. Who the hell needs it? do you consider this optimization in its purest form?

    OFF: This thing is available in polish servers since 2012, their idea was: "Let's say that we're in Devil's Catacomb and i want my client to be optimized, i enabled this option and all bosses/mobs become a dog, now everything is perfect, no lag anymore, WTF, we did metin2 great again, we're genius."

    ON: Instead of this non-logic thing, you can enable/disable effects from mobs with game option, that's all what you need.

    Inside of Area.cpp -> RenderEffect you could do a simple check for ignore specific type of effects for being rendered, also this change will be in real time, you don't need to close/open client.

    On 11/20/2019 at 11:09 AM, Helia01 said:

    Speaking of effects, do you have any idea how to fix the effects processing so that you don't get a black screen when you minimize and maximize the client?
    All decisions in release which consisted in not stopping rendering of effects at folding seems to me any nonsense.

    I don't think is so hard, inside of loop function related about rendering effects you could do a check if your client is minimized to stop rendering them.

    You could add this before __UpdateEffectList(), inside of void CArea::RenderEffect(). (i didn't test it)

    Hidden Content

      // Stop rendering effects while window is minimized.
      const HWND hWnd = CPythonApplication::Instance().GetWindowHandle();
      const bool isMinimized = static_cast<bool>(IsIconic(hWnd));
      if (isMinimized)
      	return;

    • Love 2
  14. Search for:

    1.                local bonuses = {
    2.                     [1] = {3,40,"Ενέργεια Ζωής "},
    3.                     [2] = {4,40,"Ευφυΐα "},
    4.                     [3] = {5,40,"Δύναμη "},
    5.                     [4] = {6,40,"Ευκινησία "},
    6.                     [5] = {11,20,"Ενέργεια Ζωής & Δύναμη "},
    7.                     [6] = {11,20,"Ευφυΐα & Δύναμη "},
    8.                     [7] = {11,20,"Ευφυΐα & Ευκινησία "},
    9.                     [8] = {11,20,"Δύναμη & Ευκινησία "},
    10.                 }
    11.                 affect.add(567, bonuses[s][1], bonuses[s][2], bonuses[s][3], bonuses[s][4], bonuses[s][5], bonuses[s][6], bonuses[s][7], bonuses[s][8], 60*60*24*365*2)

    Replace with:

    This is the hidden content, please

    • Metin2 Dev 1
    • Love 7
  15. M2 Download Center

    This is the hidden content, please
    ( Internal )

    This is the hidden content, please
    ( GitHub )

    Based idea: https://metin2.dev/board/index.php?/topic/22220-clearspecialsymbols/

    Doing the same thing, but here's my faster version coded in python, with source code, no executable.

    Read the informations from repository, how to use it.

    clearSpecialSymbols.py

    This is the hidden content, please

    clearSpecialSymbols.bat

    python "clearSpecialSymbols.py" %*
    pause

     

    GitHub repository:

    • Metin2 Dev 13
    • Scream 1
    • Good 1
    • Love 10
  16. On 5/24/2019 at 11:49 PM, VegaS™ said:
    
    tmpLoadStepList = tuple(zip(*self.loadStepList))[0]
    for progress in range(tmpLoadStepList[0], tmpLoadStepList[-1] + 1):
    	if progress not in tmpLoadStepList:
    		self.loadStepList.append((progress, lambda: None))
    	
    self.loadStepList.sort()

     

    There's a better version instead of what i did some time ago, which find the differences directly, without check each progress index.

    This is the hidden content, please

    • Metin2 Dev 21
    • Good 2
    • Love 22
×
×
  • 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.