Active Member Helia01 2150 Posted October 25, 2020 Active Member Share Posted October 25, 2020 (edited) Hey M2DEV! Today I will show you how to fix one unpleasant error related to the auto attack. When you attack a monster automatically and for example want to move away from the monster, what do you do? Probably you will turn off the auto attack and try to move away from the monster using the WASD keys? Yes, but it won't work because the target doesn't reset when you try to disable the auto-attack. Before fix: https://metin2.download/picture/7dt9c1gmBnBzM9l6EUhms0I1WQj8m1zh/.gif After fix: https://metin2.download/picture/D63EBDENh0gk26hbM8m41fCA136k5Ar6/.gif Open file: UserInterface\PythonPlayer.h Make "__ClearAutoAttackTargetActorID();" public! Open file: UserInterface\PythonPlayerModulec.cpp We need to create a new method PyObject * playerClearAutoAttackTargetActorID(PyObject* poSelf, PyObject* poArgs) { CPythonPlayer::Instance().__ClearAutoAttackTargetActorID(); return Py_BuildNone(); } add method to s_methods[] { "ClearAutoAttackTargetActorID", playerClearAutoAttackTargetActorID, METH_VARARGS }, Compile bin! Open file: root/uitaskbar.py search elif self.EVENT_MOVE_AND_ATTACK == event: replace this part: elif self.EVENT_MOVE_AND_ATTACK == event: btn = self.mouseModeButtonList[dir].GetChild("button_move_and_attack") func = player.MBF_SMART player.ClearAutoAttackTargetActorID() tooltip_text = localeInfo.TASKBAR_ATTACK pack root file! P.S Please forgive me for my English, I use a GoogleTranslate Edited September 11, 2022 by Metin2 Dev Core X - External 2 Internal 9 4 18 Link to comment Share on other sites More sharing options...
valdirk2 84 Posted October 27, 2020 Share Posted October 27, 2020 Very good, I did it here and it worked well 1 Link to comment Share on other sites More sharing options...
MEKA 9 Posted October 29, 2020 Share Posted October 29, 2020 How exactly do I need to edit PythonPlayer.h? I do but it doesn't work in the game. Link to comment Share on other sites More sharing options...
Active Member Volvox 1517 Posted October 29, 2020 Active Member Share Posted October 29, 2020 19 minutes ago, MEKA said: How exactly do I need to edit PythonPlayer.h? I do but it doesn't work in the game. you open it in Visual Studio and edit it. Then Build new Binary Link to comment Share on other sites More sharing options...
MEKA 9 Posted October 29, 2020 Share Posted October 29, 2020 1 hour ago, V0lvox said: you open it in Visual Studio and edit it. Then Build new Binary i am already doing so but it doesn't work Link to comment Share on other sites More sharing options...
[TiTAN] 33 Posted July 1, 2023 Share Posted July 1, 2023 (edited) Idk if it's ok, but for me this way is more convenient: PythonPlayer.h under DWORD m_dwAutoAttackTargetVID; add bool m_bIsAutoAttack; PythonPlayerInput.cpp Modify if (rkInstMain.IsAttackableInstance(rkInstVictim)) from __OnPressActor like: if (rkInstMain.IsAttackableInstance(rkInstVictim)) { __SetAutoAttackTargetActorID(rkInstVictim.GetVirtualID()); m_bIsAutoAttack = true; } PythonPlayerInputKeyboard.cpp add if (m_bIsAutoAttack) { __ClearAutoAttackTargetActorID(); m_bIsAutoAttack = false; } under void CPythonPlayer::NEW_SetMultiDirKeyState(bool isLeft, bool isRight, bool isUp, bool isDown) { This way you can cancel your auto attacks using keyboard w a s d keys Edited July 1, 2023 by [TiTAN] 1 1 1 Link to comment Share on other sites More sharing options...
Recommended Posts