Honorable Member xP3NG3Rx 19751 Posted May 15, 2018 Honorable Member Share Posted May 15, 2018 M2 Download Center This is the hidden content, please Sign In or Sign Up ( Internal ) Hello. Today I'd like to share this little stuff what I reversed from the official binary a month ago. This will fix the positions of textails(name position changes by every update packet on the main character), and also the position of the emotions when you are on a mount . I've made a little demonstration video where you can see a private server without the fix, my fixxed version and the official aswell. 1. Client/bin/playersettingmodule.py Spoiler 1. Add the following code above of the loadGameDataDict declaration: # SetRaceHeight def __LoadRaceHeight(): try: lines = open("race_height.txt", "r").readlines() except IOError: return for line in lines: tokens = line[:-1].split("\t") if len(tokens) == 0 or not tokens[0]: continue vnum = int(tokens[0]) height = float(tokens[1]) chrmgr.SetRaceHeight(vnum, height) 2. Add the following line below of the dict or extend it however you want: loadGameDataDict.update({"RACE_HEIGHT": __LoadRaceHeight,}) 2.1 extension: "RACE_HEIGHT" : __LoadRaceHeight, 2. Client/bin/introLoading.py Spoiler 1. Paste the following line below of the self.__LoadNPC() in the DEBUG_LoadData function: self.__LoadRaceHeight() 2. Add the following line below of the self.loadStepList definition in the LoadData function: self.loadStepList+=[(98, ui.__mem_func__(self.__LoadRaceHeight)),] 2.1 or extend it: (98, ui.__mem_func__(self.__LoadRaceHeight)), 3. Add the following function after the __LoadNPC function or anywhere you want: def __LoadRaceHeight(self): playerSettingModule.LoadGameData("RACE_HEIGHT") 3. Place the race_height.txt from the official client into the yours and pack it in the root. 4. Client/UserInterface/PythonCharacterManagerModule.cpp Spoiler 1. Add the new function to the module: PyObject * chrmgrSetRaceHeight(PyObject* poSelf, PyObject* poArgs) { int iRaceIndex; if (!PyTuple_GetInteger(poArgs, 0, &iRaceIndex)) return Py_BadArgument(); float fRaceHeight = 0.0f; if (!PyTuple_GetFloat(poArgs, 1, &fRaceHeight)) return Py_BadArgument(); CRaceManager::Instance().SetRaceHeight(iRaceIndex, fRaceHeight); return Py_BuildNone(); } And to the methodlist: { "SetRaceHeight", chrmgrSetRaceHeight, METH_VARARGS }, 5. Client/GameLib/RaceManager.h Spoiler 1. Add these new functions as public: void SetRaceHeight(int iVnum, float fHeight); float GetRaceHeight(int iVnum); 2. And define the new map which will stores the informations as protected: std::map<int, float> m_kMap_iRaceKey_fRaceAdditionalHeight; 6. Client/GameLib/RaceManager.cpp Spoiler 1. Add the new functions anywhere you want: void CRaceManager::SetRaceHeight(int iVnum, float fHeight) { m_kMap_iRaceKey_fRaceAdditionalHeight.insert(std::map<int, float>::value_type(iVnum, fHeight)); } float CRaceManager::GetRaceHeight(int iVnum) { std::map<int, float>::iterator it = m_kMap_iRaceKey_fRaceAdditionalHeight.find(iVnum); if (m_kMap_iRaceKey_fRaceAdditionalHeight.end() == it) return 0.0f; return it->second; } 7. Client/UserInterface/InstanceBase.h Spoiler 1. Paste the following definition of function below of the definition of GetDistance as public: float GetBaseHeight(); 8. Client/UserInterface/InstanceBase.cpp Spoiler 0. Add to the includes: #include "../gamelib/RaceManager.h" 1. Add the function anywhere you want: float CInstanceBase::GetBaseHeight() { CActorInstance* pkHorse = m_kHorse.GetActorPtr(); if (!m_kHorse.IsMounting() || !pkHorse) return 0.0f; DWORD dwHorseVnum = m_kHorse.m_pkActor->GetRace(); if ((dwHorseVnum >= 20101 && dwHorseVnum <= 20109) || (dwHorseVnum == 20029 || dwHorseVnum == 20030)) return 100.0f; float fRaceHeight = CRaceManager::instance().GetRaceHeight(dwHorseVnum); if (fRaceHeight == 0.0f) return 100.0f; else return fRaceHeight; } 9. Client/UserInterface/InstanceBaseEffect.cpp Spoiler 1. Replace the fTextTailHeight definition of variable in the AttachTextTail function with this: float fTextTailHeight = GetBaseHeight() + 10.0f; 2. Replace the following in the SetEmoticon function: v3Pos.z += float(m_GraphicThingInstance.GetHeight()); With this: v3Pos.z += float(GetBaseHeight() + m_GraphicThingInstance.GetHeight()); Twice!!! The are two times this line, replace both of them! 10. Client/UserInterface/PythonTextTail.cpp Spoiler 1. Replace the following code in the RegisterChatTail function: TTextTail * pTextTail = RegisterTextTail(VirtualID, c_szChat, pCharacterInstance->GetGraphicThingInstancePtr(), pCharacterInstance->GetGraphicThingInstanceRef().GetHeight() + 10.0f, c_TextTail_Chat_Color); With this: TTextTail * pTextTail = RegisterTextTail(VirtualID, c_szChat, pCharacterInstance->GetGraphicThingInstancePtr(), pCharacterInstance->GetGraphicThingInstanceRef().GetHeight() + pCharacterInstance->GetBaseHeight() + 10.0f, c_TextTail_Chat_Color); 11. Client/GameLib/ActorInstance.cpp Spoiler 0. Add the following to the includes: #include "RaceManager.h" 1. Replace the whole GetHeight function with this: float CActorInstance::GetHeight() { DWORD dwRace = GetRace(); float fRaceHeight = CRaceManager::instance().GetRaceHeight(dwRace); if (fRaceHeight == 0.0f) { fRaceHeight = CGraphicThingInstance::GetHeight(); CRaceManager::instance().SetRaceHeight(dwRace, fRaceHeight); } return fRaceHeight; } I hope you like it, and if you find any problem just let me know in this topic. 80 1 1 1 3 20 4 94 Link to comment Share on other sites More sharing options...
Салом 20 Posted May 15, 2018 Share Posted May 15, 2018 good job Link to comment Share on other sites More sharing options...
Active Member hachiwari 138 Posted May 16, 2018 Active Member Share Posted May 16, 2018 Awesome, man. Link to comment Share on other sites More sharing options...
Active Member Exygo 1097 Posted May 16, 2018 Active Member Share Posted May 16, 2018 I've modified def __LoadRaceHeight for my own purpose, here it is in case someone needs it: Spoiler def __LoadRaceHeight(): directory = "npcheight.txt" try: lines = open(directory, "r").readlines() except IOError: return #import dbg for line in lines: try: # to avoid problems .. (paranoia) tokens = line[:-1].split("\t") #dbg.TraceError("__LoadRaceHeight tokens %s" % (str(tokens))) if len(tokens) <= 1 or not tokens[0]: continue if tokens[0].find("#") != -1: continue if tokens[1].find("#") != -1: tokens[1] = tokens[1].split("#")[0].replace("\s","") if tokens[1].find("#") != -1: continue vnum = int(tokens[0]) height = float(tokens[1]) #dbg.TraceError("__LoadRaceHeight %d %s" % (vnum,tokens[1])) chrmgr.SetRaceHeight(vnum, height) except: import dbg dbg.TraceError("I could not read the lines of %s" % directory) I wanted to use comment tags inside the .txt file Spoiler # horse 20030 220.00 20101 220.00 20102 220.00 20103 220.00 20104 220.00 20105 220.00 20106 220.00 20107 220.00 20108 220.00 20109 220.00 # shop 30000 150.00 # mount 20212 0.01 # uff.. the mounts need to have 0.01 29212 0.01 # dragon 2493 300.00 EDIT: iI think I was too sleepy at 4 AM when I wrote this reply, I didn't think I could modifty it into a dictionary def __LoadRaceHeight(): Dict = npcheight.NPC_HEIGHT for k,v in Dict.items(): chrmgr.SetRaceHeight(k, v) NPC_HEIGHT = { # horse 20030 : 220.00, 20101 : 220.00, 20102 : 220.00, 20103 : 220.00, 20104 : 220.00, 20105 : 220.00, 20106 : 220.00, 20107 : 220.00, 20108 : 220.00, 20109 : 220.00, # shop 30000 : 150.00, # mount 20212 : 0.01, # uff.. the mounts need to have 0.01 29212 : 0.01, # dragon 2493 : 300.00, } 7 https://www.youtube.com/channel/UCQ8mAeda9TWq6SsTzB53emw/videos Link to comment Share on other sites More sharing options...
Honorable Member Tatsumaru 5331 Posted May 16, 2018 Honorable Member Share Posted May 16, 2018 (edited) I have 4 errors: 16> InstanceBase.cpp (48): error C2653: "CRaceManager": not a class name or namespace name 16> InstanceBase.cpp (48): error C2228: left ".GetRaceHeight" must be of type struct/union 16> InstanceBase.cpp (48): error C3861: "instance": id was not found 198 IntelliSense: name followed by '::' must be a class or namespace name Can anyone help? Edited August 25, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
metin2team 766 Posted May 16, 2018 Share Posted May 16, 2018 (edited) 2 hours ago, Tatsumaru said: I have 4 errors: 16> InstanceBase.cpp (48): error C2653: "CRaceManager": not a class name or namespace name 16> InstanceBase.cpp (48): error C2228: left ".GetRaceHeight" must be of type struct/union 16> InstanceBase.cpp (48): error C3861: "instance": id was not found 198 IntelliSense: name followed by '::' must be a class or namespace name Can anyone help? #include "../gamelib/RaceManager.h" Edited August 25, 2022 by Metin2 Dev Core X - External 2 Internal 1 2 Link to comment Share on other sites More sharing options...
Mandi 2 Posted May 19, 2018 Share Posted May 19, 2018 Works perfectly! Thank you! Link to comment Share on other sites More sharing options...
Meruem 12 Posted May 21, 2018 Share Posted May 21, 2018 good has worked for me, since I do not get This function v3Pos.z += float(m_GraphicThingInstance.GetHeight()); Link to comment Share on other sites More sharing options...
Premium TAUMP 854 Posted May 21, 2018 Premium Share Posted May 21, 2018 (edited) 4 hours ago, Meruem said: good has worked for me, since I do not get This function v3Pos.z += float(m_GraphicThingInstance.GetHeight()); Edited August 26, 2022 by Metin2 Dev Core X - External 2 Internal 1 Link to comment Share on other sites More sharing options...
avertuss 48 Posted May 24, 2018 Share Posted May 24, 2018 Idk why but my client getting crash after login without errors in syserr when i have added python side. Link to comment Share on other sites More sharing options...
metin2team 766 Posted May 24, 2018 Share Posted May 24, 2018 49 minutes ago, avertuss said: Idk why but my client getting crash after login without errors in syserr when i have added python side. are you sure that you packed the text file in your root package? On 5/15/2018 at 11:47 PM, xP3NG3Rx said: 3. Place the race_height.txt from the official client into the yours and pack it in the root. 1 1 1 1 Link to comment Share on other sites More sharing options...
Tryn 98 Posted May 26, 2018 Share Posted May 26, 2018 I think there are some "bugs". If u mount for example the power mounts the texttail is floating miles above you. Also if you're not riding a mount the texttail above them ("XZY's Horse") is also miles above them. Maybe you can take a look for this "bugs". But nice release anyway. Thanks P3ng3r Link to comment Share on other sites More sharing options...
PeaceMaker 121 Posted May 27, 2018 Share Posted May 27, 2018 i added some new values to race_height.txt such as mounts as the name appears in the air but it dosent work , had to add them in source not sure if the race_height.txt is even working Link to comment Share on other sites More sharing options...
3bd0 182 Posted May 29, 2018 Share Posted May 29, 2018 On 5/28/2018 at 2:43 AM, PeaceMaker said: i added some new values to race_height.txt such as mounts as the name appears in the air but it dosent work , had to add them in source not sure if the race_height.txt is even working yup same here, tried adding values and changing existing values, I even tried to delete all the data, and nothing changes in game. Link to comment Share on other sites More sharing options...
Premium Dr3Ame3r 33 Posted June 26, 2018 Premium Share Posted June 26, 2018 La 26.05.2018 la 21:57, Tryn a spus: I think there are some "bugs". If u mount for example the power mounts the texttail is floating miles above you. Also if you're not riding a mount the texttail above them ("XZY's Horse") is also miles above them. Maybe you can take a look for this "bugs". But nice release anyway. Thanks P3ng3r La 29.05.2018 la 12:28, 3bd0 a spus: yup same here, tried adding values and changing existing values, I even tried to delete all the data, and nothing changes in game. Use what exygo posted. If you want the dictionary in the same file, you'll have to modify Dict = npcheight.NPC_HEIGHT to Dict = NPC_HEIGHT Open instancebase.cpp and search for-> if ((dwHorseVnum >= 20101 && dwHorseVnum <= 20109) || (dwHorseVnum == 20029 || dwHorseVnum == 20030)) return 100.0f; Make a new case under it and put your mounts vnums, in my case it is: if ((dwHorseVnum >= 20110 || dwHorseVnum <= 20266)) return 50.0f; Then, enter PlayerSettingModule.py and use Exygo's dict as this for mounts-> 20110 : 160.00, 20111 : 160.00, 20112 : 160.00, 20113 : 160.00, 20114 : 160.00, 20115 : 160.00, ............... 20266 : 160,00, 1 Link to comment Share on other sites More sharing options...
Ultor 1 Posted April 24, 2019 Share Posted April 24, 2019 I put this system in but it doesn't do anything why it can be? Link to comment Share on other sites More sharing options...
cBaraN 109 Posted October 18, 2019 Share Posted October 18, 2019 (edited) I got rid of this problem before YMIR (Now Webzen). Edited August 25, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
glosteng4141 192 Posted January 7, 2020 Share Posted January 7, 2020 Build Error. The code section of Metin2Dev is very bad. When you copy and paste "?" adding signs. Wretched. Please do not enter your codes here. Use an additional site. Can someone tell me why you're giving this crap ActorInstance.cpp PhytonCharacterManagerModule.cpp / Also{ "SetRaceHeight", chrmgrSetRaceHeight, METH_VARARGS }, Add - (No Image) RaceManager.cpp RaceManager.h Also All #include attached. Link to comment Share on other sites More sharing options...
Bronze .Avenue™ 790 Posted June 21, 2021 Bronze Share Posted June 21, 2021 (edited) I don't know if it should be like this, but this looks really wrong to me. I'm using the latest race_height.txt from DE That's also not how it supposed to be.. Checked already twice, I did it correctly. Edited August 18, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Active Member Helia01 2150 Posted June 22, 2021 Active Member Share Posted June 22, 2021 (edited) 17 hours ago, .Avenue™ said: I don't know if it should be like this, but this looks really wrong to me. I'm using the latest race_height.txt from DE That's also not how it supposed to be.. Checked already twice, I did it correctly. Open file playersettingmodule.py and Replace this part. def __LoadRaceHeight(): try: lines = pack_open("race_height.txt", "r").readlines() except IOError: import dbg dbg.LogBox("__LoadRaceHeight: load text file error!") app.Abort() for line in lines: tokens = line[:-1].split("\t") if len(tokens) == 0 or not tokens[0]: continue vnum = int(tokens[0]) height = float(tokens[1]) chrmgr.SetRaceHeight(vnum, height) This should help. Probably a file race_height.txt it wasn't read. Edited August 18, 2022 by Metin2 Dev Core X - External 2 Internal 2 3 7 Link to comment Share on other sites More sharing options...
Silviu97 0 Posted October 26, 2021 Share Posted October 26, 2021 good Link to comment Share on other sites More sharing options...
Active+ Member blaxis 281 Posted January 17, 2022 Active+ Member Share Posted January 17, 2022 (edited) Thx for sharing. What is problem? Edited August 17, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Zarkaplay 0 Posted December 8, 2022 Share Posted December 8, 2022 (edited) Sometimes when I enter in the game the name is displayed ok and sometimes it's displayed too low. Edited December 9, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Premium ragem0re 155 Posted January 20 Premium Share Posted January 20 On 12/8/2022 at 9:29 PM, Zarkaplay said: Sometimes when I enter in the game the name is displayed ok and sometimes it's displayed too low. I've got exactly the same issue. Did you found a solution? 1 Link to comment Share on other sites More sharing options...
rares2017 31 Posted March 16 Share Posted March 16 On 1/20/2024 at 4:39 PM, ragem0re said: I've got exactly the same issue. Did you found a solution? Same Link to comment Share on other sites More sharing options...
Recommended Posts