arlinamid 1131 Posted March 26, 2021 Share Posted March 26, 2021 (edited) For Acce you have to enabled in motion in 2 files. ActorInstanceAttach.cpp in function CActorInstance::AttachAcce insert this code at the end of the function. if (CGrannyLODController* pLODController = m_LODControllerVector[CRaceData::PART_ACCE]) { if (CGrannyModelInstance* pWeaponModelInstance = pLODController->GetModelInstance()) { CGraphicThing* pItemGraphicThing = pItemData->GetModelThing(); if (std::shared_ptr<CGrannyMotion> pItemMotion = pItemGraphicThing->GetMotionPointer(0)) { pWeaponModelInstance->SetMotionPointer(pItemMotion); } } } https://metin2.download/picture/gQvc4889g7IDu1d4mkKV439kWUkEPC5p/.png and the ThingInstance.cpp in function CGraphicThingInstance::SetMotion you have to add case CRaceData::PART_ACCE: https://metin2.download/picture/HB3r8PlsvrJj2Jd5Q722hhwSPV3788gG/.png I hope i can help, before this you have to add all of the tutorial part. Edited September 11, 2022 by Metin2 Dev Core X - External 2 Internal 18 2 2 2 8 4 13 Best regards, Arlinamid Link to comment Share on other sites More sharing options...
Tiburon 22 Posted April 9, 2021 Share Posted April 9, 2021 I will try it thank you very much brother thanks for taking the time to answer me 1 Link to comment Share on other sites More sharing options...
Ace 3252 Posted August 7, 2021 Share Posted August 7, 2021 (edited) I baked everything in a .rar file. Control it and if you want you can add to your thread. If you do not agree with this, I delete the link on metin2dev and keep it to myself. This is the hidden content, please Sign In or Sign Up (Download) included are the codes of: arlinamid & Distraught Please check the files and check whether they are correct. I took everything from the thread and didn't add anything new. I am not responsible for any damage to your server. Edited May 27 by Ace add wings, change the style of text presentation. 103 1 1 1 29 4 40 Spoiler Ymir Entertainment was founded in 1999 in Seoul, Korea and is currently headed by Byoung Gwan Kim as CEO. The company started developing its first 2D online game Metin the same year it was founded. The game was commercially launched in Korea a year later and received a prize from the Korean Ministry of Information and Communication in December of the same year. Following the success of their flagship game Ymir Entertainment immediately started work on the game’s sequel Metin 2, which went into Closed Beta in Korea in May 2004. The game was officially launched in Korea and China in March 2005 before being launched in Asia, Europe and North America in the years that followed. In January 2011 all of the company’s shares were bought by Webzen Inc., a Korean game giant known for their popular MMORPG, MU Online. The company was also awarded Gameforge’s Global Best Partner of the Year in 2011. Source: https://mmos.com/publishers/ymir-entertainment Thank you ymir and F*** you Gameforge, 2011 you ruined it. Link to comment Share on other sites More sharing options...
Management Karbust 4884 Posted September 24, 2021 Management Share Posted September 24, 2021 (edited) I keep getting this error in Debug mode: std::shared_ptr<CGrannyMotion> CGraphicThing::GetMotionPointer(int iMotion) { assert(CheckMotionIndex(iMotion)); //line 131 if (iMotion >= m_pgrnFileInfo->AnimationCount) return NULL; if (m_motions.empty()) return NULL; return m_motions.at(iMotion); } Any idea? Thank you Edited August 17, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Premium flatik 190 Posted September 30, 2021 Premium Share Posted September 30, 2021 (edited) On 9/24/2021 at 5:30 PM, Karbust said: I keep getting this error in Debug mode: std::shared_ptr<CGrannyMotion> CGraphicThing::GetMotionPointer(int iMotion) { assert(CheckMotionIndex(iMotion)); //line 131 if (iMotion >= m_pgrnFileInfo->AnimationCount) return NULL; if (m_motions.empty()) return NULL; return m_motions.at(iMotion); } Any idea? Thank you There is an error message because the weapon has no animation. try: std::shared_ptr<CGrannyMotion> CGraphicThing::GetMotionPointer(int iMotion) { if (!CheckMotionIndex(iMotion)) return nullptr; if (m_motions.empty()) return nullptr; return m_motions.at(iMotion); } Edited August 17, 2022 by Metin2 Dev Core X - External 2 Internal 1 c++latest, latest libs... Link to comment Share on other sites More sharing options...
Management Karbust 4884 Posted September 30, 2021 Management Share Posted September 30, 2021 3 hours ago, flatik said: There is an error message because the weapon has no animation. try: std::shared_ptr<CGrannyMotion> CGraphicThing::GetMotionPointer(int iMotion) { if (!CheckMotionIndex(iMotion)) return nullptr; if (m_motions.empty()) return nullptr; return m_motions.at(iMotion); } I just made it like this, since it only throws the assert on DEBUG... std::shared_ptr<CGrannyMotion> CGraphicThing::GetMotionPointer(int iMotion) { #ifdef _DEBUG if (!CheckMotionIndex(iMotion)) return NULL; #else assert(CheckMotionIndex(iMotion)); #endif if (iMotion >= m_pgrnFileInfo->AnimationCount) return NULL; if (m_motions.empty()) return NULL; return m_motions.at(iMotion); } Link to comment Share on other sites More sharing options...
Honorable Member Distraught 5905 Posted October 1, 2021 Honorable Member Share Posted October 1, 2021 8 hours ago, Karbust said: I just made it like this, since it only throws the assert on DEBUG... std::shared_ptr<CGrannyMotion> CGraphicThing::GetMotionPointer(int iMotion) { #ifdef _DEBUG if (!CheckMotionIndex(iMotion)) return NULL; #else assert(CheckMotionIndex(iMotion)); #endif if (iMotion >= m_pgrnFileInfo->AnimationCount) return NULL; if (m_motions.empty()) return NULL; return m_motions.at(iMotion); } Asserts are only compiled in debug builds anyway. Putting that extra check there only in debug mode and not even asserting is the worst case. It just hides errors during the development process but they can appear on live. Link to comment Share on other sites More sharing options...
MyAnubis 4 Posted October 18, 2021 Share Posted October 18, 2021 Error rebuild mode debug : error C2232: '->std::vector<std::shared_ptr<CGrannyMotion>,std::allocator<std::shared_ptr<CGrannyMotion>>>::empty' ThingInstance.cpp Link to comment Share on other sites More sharing options...
Adyscz5 0 Posted November 15, 2021 Share Posted November 15, 2021 nice thx Link to comment Share on other sites More sharing options...
Spînu 0 Posted December 24, 2021 Share Posted December 24, 2021 (edited) https://metin2.download/picture/koZZKDNKx8HIXBRJlGJ61Ja6HsAU4Gan/.gif WHY? Edited September 4, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Wintersun 87 Posted January 10, 2022 Share Posted January 10, 2022 (edited) Hello, I'm facing an error when trying to compile the binary (VS 22) after following this guide. I've searched and searched for a solution but, my knowledge here is very limited to none. Here is ActorInstanceAttach.cpp (only the block modified following this guide): https://pastebin.com/hEsyTbrz Here is the error: https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif What am I doing wrong? (The binary compiled without problems before applying the modifications) Thanks! Edit: Solved. For anyone else who haves the error above, just add This in ActorInstanceAttach.cpp: if (std::shared_ptr<CGrannyMotion> pItemMotion = pItemGraphicThing->GetMotionPointer(0)) instead of: if (CGrannyMotion* pItemMotion = pItemGraphicThing->GetMotionPointer(0)) (from the part wrote by Distraught) Works like a charm. Edited August 25, 2022 by Metin2 Dev Core X - External 2 Internal 1 Link to comment Share on other sites More sharing options...
Fredek 0 Posted February 2, 2022 Share Posted February 2, 2022 Thanks! This is what I was looking for. Link to comment Share on other sites More sharing options...
jumk999 0 Posted February 28, 2022 Share Posted February 28, 2022 work with VS 2013? Link to comment Share on other sites More sharing options...
razor93 12 Posted March 4, 2022 Share Posted March 4, 2022 (edited) On 3/26/2021 at 8:55 AM, arlinamid said: For Acce you have to enabled in motion in 2 files. ActorInstanceAttach.cpp in function CActorInstance::AttachAcce insert this code at the end of the function. if (CGrannyLODController* pLODController = m_LODControllerVector[CRaceData::PART_ACCE]) { if (CGrannyModelInstance* pWeaponModelInstance = pLODController->GetModelInstance()) { CGraphicThing* pItemGraphicThing = pItemData->GetModelThing(); if (std::shared_ptr<CGrannyMotion> pItemMotion = pItemGraphicThing->GetMotionPointer(0)) { pWeaponModelInstance->SetMotionPointer(pItemMotion); } } } https://metin2.download/picture/gQvc4889g7IDu1d4mkKV439kWUkEPC5p/.png and the ThingInstance.cpp in function CGraphicThingInstance::SetMotion you have to add case CRaceData::PART_ACCE: https://metin2.download/picture/HB3r8PlsvrJj2Jd5Q722hhwSPV3788gG/.png I hope i can help, before this you have to add all of the tutorial part. no working for me 26 minutes ago, razor93 said: no working for me sloved : ActorInstanceAttach.cpp: if (std::shared_ptr<CGrannyMotion> pItemMotion = pItemGraphicThing->GetMotionPointer(0)) change: if (CGrannyMotion* pItemMotion = pItemGraphicThing->GetMotionPointer(0)) Spoiler Edited September 11, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
razor93 12 Posted March 4, 2022 Share Posted March 4, 2022 (edited) On 11/30/2020 at 7:47 PM, Distraught said: if (CGrannyLODController* pLODController = m_LODControllerVector[dwPartIndex]) { if (CGrannyModelInstance* pWeaponModelInstance = pLODController->GetModelInstance()) { CGraphicThing* pItemGraphicThing = pItemData->GetModelThing(); if (CGrannyMotion* pItemMotion = pItemGraphicThing->GetMotionPointer(0)) { pWeaponModelInstance->SetMotionPointer(pItemMotion); } } } Add the code above to the end of void CActorInstance::AttachWeapon(DWORD dwParentPartIndex, DWORD dwPartIndex, CItemData * pItemData) function in ActorInstanceAttach.cpp and ThingInstance.cpp in the function bool CGraphicThingInstance::SetMotion(DWORD dwMotionKey, float blendTime, int loopCount, float speedRatio) modify std::for_each(m_LODControllerVector.begin(), m_LODControllerVector.end(), SetMotionPointer); to for (int i = 0; i < m_LODControllerVector.size(); ++i) { switch (i) { case CRaceData::PART_WEAPON: case CRaceData::PART_WEAPON_LEFT: break; default: SetMotionPointer(m_LODControllerVector[i]); break; } } and add these to the includes #include "../GameLib/GameType.h" #include "../GameLib/RaceData.h" to make it work when the weapon is equipped. its working. Thank you so munch Edited August 26, 2022 by Metin2 Dev Core X - External 2 Internal 1 1 Link to comment Share on other sites More sharing options...
Premium CORKY 253 Posted March 19, 2022 Premium Share Posted March 19, 2022 Unfortunately the link for the animated weapon expired. If somebody is kind enough, would you please give an updated one here? Thanks! 1 1 Link to comment Share on other sites More sharing options...
Wintersun 87 Posted April 1, 2022 Share Posted April 1, 2022 On 3/19/2022 at 5:54 PM, dumita123 said: Unfortunately the link for the animated weapon expired. If somebody is kind enough, would you please give an updated one here? Thanks! Try the backup made by Ace: This is the hidden content, please Sign In or Sign Up Look here for that weapon. 26 1 1 1 1 3 11 Link to comment Share on other sites More sharing options...
adv1453 60 Posted April 14, 2022 Share Posted April 14, 2022 Anyone have it for vs2013? Link to comment Share on other sites More sharing options...
Premium Speachless 759 Posted April 23, 2022 Premium Share Posted April 23, 2022 This line pkThingInst->Deform(); makes some buildings to become very big after a teleport (depends what was the last map you were in). Not adding this fixed the problem without affecting the animation of the wings. Link to comment Share on other sites More sharing options...
Premium Ulthar 3098 Posted August 15, 2022 Premium Share Posted August 15, 2022 (edited) I dont know why, but its not working for me Compiled without any error in vs2022, but the attached sashes with animations still without animation as before the edits Weapon is good, but sash isnt https://metin2.download/picture/sjbb1YNr9u0HbOH60t0pYLh8L4rruPQx/.gif EDIT fixed Problem was: This part: if (CGrannyLODController* pLODController = m_LODControllerVector[CRaceData::PART_SASH]) { if (CGrannyModelInstance* pWeaponModelInstance = pLODController->GetModelInstance()) { CGraphicThing* pItemGraphicThing = pItemData->GetModelThing(); if (std::shared_ptr<CGrannyMotion> pItemMotion = pItemGraphicThing->GetMotionPointer(0)) { pWeaponModelInstance->SetMotionPointer(pItemMotion); } } } will go to: void CActorInstance::AttachSash(CItemData * pItemData, float fSpecular) (in actorinstanceattach.cpp) Instead of: void CActorInstance::AttachWeapon(DWORD dwParentPartIndex, DWORD dwPartIndex, CItemData * pItemData) Edited August 7, 2023 by Ulthar Core X - External 2 Internal 1 Ulthar Link to comment Share on other sites More sharing options...
123fbalp123fb 28 Posted August 27, 2022 Share Posted August 27, 2022 (edited) Thanks for sharing. I have tried to add many times for wing animations but I always get an error. I couldn't do it. Is there anyone who can do it if I give my clean files? (scale sash added) clean source codes required; This is the hidden content, please Sign In or Sign Up This is the hidden content, please Sign In or Sign Up =============================================================== Errors I get while adding; @ Tatsumaru @ B4RC0D3 Edited September 4, 2022 by Metin2 Dev Core X - External 2 Internal 8 1 2 1 3 Link to comment Share on other sites More sharing options...
duffisk2w 8 Posted October 30, 2022 Share Posted October 30, 2022 thx bro Link to comment Share on other sites More sharing options...
petmen021 0 Posted October 31, 2022 Share Posted October 31, 2022 (edited) Its not work for Visual Studio 2013? I get "Sharder_ptr" and "std" errors... and etc Edited October 31, 2022 by petmen021 Hát van ilyen Link to comment Share on other sites More sharing options...
Premium CORKY 253 Posted October 31, 2022 Premium Share Posted October 31, 2022 3 minutes ago, petmen021 said: Its not work for Visual Studio 2013? I get "Sharder_ptr" and "std" errors... and etc #include <memory> add it inside the header files that you receive the error. 1 Link to comment Share on other sites More sharing options...
petmen021 0 Posted October 31, 2022 Share Posted October 31, 2022 (edited) 52 minutes ago, dumita123 said: #include <memory> add it inside the header files that you receive the error. Thanks now get error Quote LODController.h(213): error C2664: 'void CGrannyLODController::ChangeMotionPointer(const std::shared_ptr<CGrannyMotion>,int,float)' : cannot convert argument 1 from 'const CGrannyMotion *' to 'const std::shared_ptr<CGrannyMotion>' 3> Constructor for class 'std::shared_ptr<CGrannyMotion>' is declared 'explicit' Quote 1>..\..\source\EterGrnLib\ModelInstanceMotion.cpp(101): warning C4244: 'argument' : conversion from 'float' to 'granny_int32x', possible loss of data I dont know why.. All error this "explicit" Edited October 31, 2022 by petmen021 Hát van ilyen Link to comment Share on other sites More sharing options...
Recommended Posts