Active Member Dex 520 Posted December 2, 2020 Active Member Share Posted December 2, 2020 (edited) M2 Download Center This is the hidden content, please Sign In or Sign Up ( Internal ) Hey folks, i was asked if it's possible to change the Field of View ingame through option and i wanted to share with you. This is what this Release looks like: Locale_inc.h Spoiler #define ENABLE_FOV_OPTION PythonApplication.cpp Spoiler search for: m_pyGraphic.SetPerspective(30.0f, fAspect, 100.0, fFarClip); change it like this: #ifdef ENABLE_FOV_OPTION float fFOV = m_pySystem.GetFOVLevel(); m_pyGraphic.SetPerspective(fFOV, fAspect, 100.0, fFarClip); #else m_pyGraphic.SetPerspective(30.0f, fAspect, 100.0, fFarClip); #endif PythonApplicationModule.cpp Spoiler before: #ifdef USE_OPENID PyModule_AddIntConstant(poModule, "USE_OPENID", 1); if (openid_test) PyModule_AddIntConstant(poModule, "OPENID_TEST", 1); else PyModule_AddIntConstant(poModule, "OPENID_TEST", 0); #else PyModule_AddIntConstant(poModule, "USE_OPENID", 0); PyModule_AddIntConstant(poModule, "OPENID_TEST", 0); #endif /* USE_OPENID */ add: #ifdef ENABLE_FOV_OPTION PyModule_AddIntConstant(poModule, "ENABLE_FOV_OPTION", 1); #else PyModule_AddIntConstant(poModule, "ENABLE_FOV_OPTION", 0); #endif PythonSystem.cpp Spoiler search for: void CPythonSystem::SetSoundVolumef(float fVolume) { m_Config.voice_volume = int(5 * fVolume); } add after: #ifdef ENABLE_FOV_OPTION void CPythonSystem::SetFOVLevel(float fFOV) { m_Config.iFOVLevel = fMINMAX(30.0f, fFOV, 120.0f); } float CPythonSystem::GetFOVLevel() { return m_Config.iFOVLevel; } #endif search for: void CPythonSystem::SetDefaultConfig() { memset(&m_Config, 0, sizeof(m_Config)); m_Config.width = 1024; m_Config.height = 768; m_Config.bpp = 32; #if defined( LOCALE_SERVICE_WE_JAPAN ) m_Config.bWindowed = true; #else m_Config.bWindowed = false; #endif m_Config.is_software_cursor = false; m_Config.is_object_culling = true; m_Config.iDistance = 3; m_Config.gamma = 3; m_Config.music_volume = 1.0f; m_Config.voice_volume = 5; m_Config.bDecompressDDS = 0; m_Config.bSoftwareTiling = 0; m_Config.iShadowLevel = 3; add after: #ifdef ENABLE_FOV_OPTION m_Config.iFOVLevel = 30.0f; #endif search for: else if (!stricmp(command, "SHOW_SALESTEXT")) m_Config.bShowSalesText = atoi(value) == 1 ? true : false; add after: #ifdef ENABLE_FOV_OPTION else if (!stricmp(command, "FIELD_OF_VIEW")) m_Config.iFOVLevel = atoi(value); #endif search for: fprintf(fp, "USE_DEFAULT_IME %d\n", m_Config.bUseDefaultIME); fprintf(fp, "SOFTWARE_TILING %d\n", m_Config.bSoftwareTiling); fprintf(fp, "SHADOW_LEVEL %d\n", m_Config.iShadowLevel); add after: #ifdef ENABLE_FOV_OPTION fprintf(fp, "FIELD_OF_VIEW %.1f\n", m_Config.iFOVLevel); #endif PythonSystem.h Spoiler search for: typedef struct SConfig { DWORD width; DWORD height; DWORD bpp; DWORD frequency; bool is_software_cursor; bool is_object_culling; int iDistance; int iShadowLevel; add after: #ifdef ENABLE_FOV_OPTION FLOAT iFOVLevel; #endif search for: int GetDistance(); int GetShadowLevel(); void SetShadowLevel(unsigned int level); add after: #ifdef ENABLE_FOV_OPTION float GetFOVLevel(); void SetFOVLevel(float fFOV); #endif PythonSystemModule.cpp Spoiler search for: PyObject * systemSetMusicVolume(PyObject * poSelf, PyObject * poArgs) { float fVolume; if (!PyTuple_GetFloat(poArgs, 0, &fVolume)) return Py_BuildException(); CPythonSystem::Instance().SetMusicVolume(fVolume); return Py_BuildNone(); } add after: #ifdef ENABLE_FOV_OPTION PyObject * systemSetFOVLevel(PyObject * poSelf, PyObject * poArgs) { float fFOV; if (!PyTuple_GetFloat(poArgs, 0, &fFOV)) return Py_BuildException(); CPythonSystem::Instance().SetFOVLevel(fFOV); return Py_BuildNone(); } PyObject * systemGetFOVLevel(PyObject * poSelf, PyObject * poArgs) { return Py_BuildValue("f", CPythonSystem::Instance().GetFOVLevel()); } #endif search for: { "GetShadowLevel", systemGetShadowLevel, METH_VARARGS }, { "SetShadowLevel", systemSetShadowLevel, METH_VARARGS }, add after: #ifdef ENABLE_FOV_OPTION { "GetFOVLevel", systemGetFOVLevel, METH_VARARGS }, { "SetFOVLevel", systemSetFOVLevel, METH_VARARGS }, #endif uisystemoption.py Spoiler search for: self.tilingModeButtonList = [] # self.ctrlShadowQuality = 0 add after: if app.ENABLE_FOV_OPTION: self.changeFOV = 0 search: self.tilingModeButtonList.append(GetObject("tiling_cpu")) self.tilingModeButtonList.append(GetObject("tiling_gpu")) self.tilingApplyButton=GetObject("tiling_apply") add: if app.ENABLE_FOV_OPTION: self.changeFOV = GetObject("fov_bar") search: self.ctrlMusicVolume.SetSliderPos(float(systemSetting.GetMusicVolume())) self.ctrlMusicVolume.SetEvent(ui.__mem_func__(self.OnChangeMusicVolume)) self.ctrlSoundVolume.SetSliderPos(float(systemSetting.GetSoundVolume()) / 5.0) self.ctrlSoundVolume.SetEvent(ui.__mem_func__(self.OnChangeSoundVolume)) add: if app.ENABLE_FOV_OPTION: self.changeFOV.SetSliderPos(float(systemSetting.GetFOVLevel()) / 5.0) self.changeFOV.SetEvent(ui.__mem_func__(self.OnChangeFOV)) search: def OnChangeSoundVolume(self): pos = self.ctrlSoundVolume.GetSliderPos() snd.SetSoundVolumef(pos) systemSetting.SetSoundVolumef(pos) add: if app.ENABLE_FOV_OPTION: def OnChangeFOV(self): pos = self.changeFOV.GetSliderPos() systemSetting.SetFOVLevel(int(pos / 0.008)) uiscript/systemoptiondialog.py Spoiler { "name" : "fov_mode", "type" : "text", "x" : 30, "y" : 210, "text" : uiScriptLocale.OPTION_FOV, }, { "name" : "fov_bar", "type" : "sliderbar", "x" : 110, "y" : 210, }, locale_xx/xx/locale_interface.txt Spoiler OPTION_FOV Field of View UPDATE SHOP_SIGN: PythonApplication.cpp Spoiler search in void CPythonApplication::RenderGame() : m_pyGraphic.SetPerspective(30.0f, fAspect, 100.0, fFarClip); replace with: #ifdef ENABLE_FOV_OPTION float fFOV = m_pySystem.GetFOVLevel(); m_pyGraphic.SetPerspective(fFOV, fAspect, 100.0, fFarClip); #else m_pyGraphic.SetPerspective(30.0f, fAspect, 100.0, fFarClip); #endif search: s.SetPerspective(30.0f,fAspect, 100.0f, fFarClip); replace with: #ifdef ENABLE_FOV_OPTION float fFOV = CPythonSystem::Instance().GetFOVLevel(); s.SetPerspective(fFOV, fAspect, 100.0f, fFarClip); #else s.SetPerspective(30.0f,fAspect, 100.0f, fFarClip); #endif Kind Regards, .Dex Edited August 25, 2022 by Metin2 Dev Core X - External 2 Internal 67 1 1 3 14 4 57 Link to comment Share on other sites More sharing options...
LykosRuleZ 3 Posted December 2, 2020 Share Posted December 2, 2020 This is so funny, i was developing this one me too lmao! Also is cool to see i was doing that correctly. Good job! 1 Link to comment Share on other sites More sharing options...
Rusef 25 Posted December 2, 2020 Share Posted December 2, 2020 (edited) I implemented the system, but i've come across a small bug: https://metin2.download/picture/qvd8NirWQbEG09RX55f8vtfLbjYLF6f9/.gif i would be glad if you can help me Edited September 4, 2022 by Metin2 Dev Core X - External 2 Internal 4 1 4 2 Link to comment Share on other sites More sharing options...
Silencio 3 Posted December 3, 2020 Share Posted December 3, 2020 (edited) 12 hours ago, Rusef said: I implemented the system, but i've come across a small bug: https://metin2.download/picture/7fe60CcxRzbkgSG7J2ZZcFuP6t3uD26r/.gif i would be glad if you can help me Well, clearly you have to modify your items coords and window height in the systemoptiondialog.py Edited September 4, 2022 by Metin2 Dev Core X - External 2 Internal 2 Link to comment Share on other sites More sharing options...
MentaLL 12 Posted December 3, 2020 Share Posted December 3, 2020 (edited) 1 hour ago, Silencio said: Well, clearly you have to modify your items coords and window height in the systemoptiondialog.py Lol, he's talking about the offlineshop name. Anyway i have the same bug too and now i handling to fix these as soon as possible and share the fix. Edited December 3, 2020 by MentaLL 1 mindset Link to comment Share on other sites More sharing options...
Rusef 25 Posted December 5, 2020 Share Posted December 5, 2020 (edited) @Dex @MentaLL https://metin2.download/picture/qvd8NirWQbEG09RX55f8vtfLbjYLF6f9/.gif any solution? thanks! Edited September 4, 2022 by Metin2 Dev Core X - External 2 Internal 5 2 1 Link to comment Share on other sites More sharing options...
lastone122 16 Posted December 6, 2020 Share Posted December 6, 2020 (edited) @Rusef@MentaLL Fix for the shop name should be in PythonApplication.cpp This line is there twice. m_pyGraphic.SetPerspective(30.0f, fAspect, 100.0, fFarClip); You need to replace in void CPythonApplication::RenderGame() and also in void CPythonApplication::UpdateGame() Edited December 6, 2020 by lastone122 1 4 Link to comment Share on other sites More sharing options...
MentaLL 12 Posted December 6, 2020 Share Posted December 6, 2020 1 hour ago, lastone122 said: @Rusef@MentaLL Fix for the shop name should be in PythonApplication.cpp This line is there twice. m_pyGraphic.SetPerspective(30.0f, fAspect, 100.0, fFarClip); You need to replace in void CPythonApplication::RenderGame() and also in void CPythonApplication::UpdateGame() Not working. mindset Link to comment Share on other sites More sharing options...
Active Member Dex 520 Posted December 6, 2020 Author Active Member Share Posted December 6, 2020 @Rusef @MentaLL just updated the main topic with the fix. 1 Link to comment Share on other sites More sharing options...
lastone122 16 Posted December 6, 2020 Share Posted December 6, 2020 1 hour ago, MentaLL said: Not working. It does. At least for me, but im using mine version. Did not try this one, but i was facing the same problem and this was the solution Link to comment Share on other sites More sharing options...
Dianz 0 Posted November 18, 2022 Share Posted November 18, 2022 [[ Picture-Deleted-By-ASIKOO-Broken-Link ]] What's the problem ? Link to comment Share on other sites More sharing options...
Recommended Posts