Efekt Kontrol Eklentisi | Effect Control Plug-in

  • Konbuyu başlatan Konbuyu başlatan Admin
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 0
  • Görüntüleme Görüntüleme 69

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Selam arkadaşlar yakın zamanda benim çok işime yarayan sizlerinde işinize yarayacağını düşündüğüm bir eklentiyi sizinle paylaşmak istiyorum.

Bu eklenti ile kolayca python üzerinden efektlerinizi kontrol ettirip koşul sunabilirsiniz.

Kodlar bana ait değildir. Sorunsuzca kullanıyorum.

Yapılabilecek şeylerin sınırı yok x efekt üstünde yoksa y itemini kullanamazsın yada bu yolla premium market arama vb itemler yapabilirsiniz

Kod:
Locale_inc.h -> ekle #define ENABLE_AFFECT_CHECK -------------------------------------------------------- PythonApplicationModule.cpp -> Arat     PyModule_AddIntConstant(poModule, "CAMERA_STOP",            CPythonApplication::CAMERA_STOP); --> Altına ekle #ifdef ENABLE_AFFECT_CHECK     PyModule_AddIntConstant(poModule, "ENABLE_AFFECT_CHECK", 1); #else     PyModule_AddIntConstant(poModule, "ENABLE_AFFECT_CHECK", 0); #endif -------------------------------------------------------- PythonNetworkStreamPhaseGame.cpp -> Arat PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_NEW_AddAffect" ÜSTÜNE ekle -> #ifdef ENABLE_AFFECT_CHECK     CPythonPlayer::instance().AddAffect(rkElement.dwType, kAffectAdd.elem); #endif --> tekrar arat PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_NEW_RemoveAffect" --> Üstüne Ekle #ifdef ENABLE_AFFECT_CHECK     CPythonPlayer::instance().RemoveAffect(kAffectRemove.dwType, kAffectRemove.bApplyOn); #endif -------------------------------------------------------- PythonPlayer.cpp --> arat void CPythonPlayer::ClearSkillDict() --> ÜSTÜNE EKLE #ifdef ENABLE_AFFECT_CHECK void CPythonPlayer::AddAffect(DWORD dwType, TPacketAffectElement kElem) {     int iAffIndex = GetAffectDataIndex(dwType, kElem.bPointIdxApplyOn);     if (iAffIndex != -1)     {         m_mapAffectData.at(iAffIndex) = kElem;     }     else     {         m_mapAffectData.push_back(kElem);     } } void CPythonPlayer::RemoveAffect(DWORD dwType, BYTE bApplyOn) {     for (TAffectDataVector::iterator it = m_mapAffectData.begin(); it != m_mapAffectData.end(); ++it)     {         TPacketAffectElement elem = *it;         if (elem.dwType == dwType && (bApplyOn == 0 || bApplyOn == elem.bPointIdxApplyOn))         {             m_mapAffectData.erase(it);             break;         }     } } int CPythonPlayer::GetAffectDataIndex(DWORD dwType, BYTE bApplyOn) {     int ret = -1, i = 0;     for (TAffectDataVector::iterator it = m_mapAffectData.begin(); it != m_mapAffectData.end(); ++it, ++i)     {         TPacketAffectElement elem = *it;         if (elem.dwType == dwType && (bApplyOn == 0 || bApplyOn == elem.bPointIdxApplyOn))         {             ret = i;             break;         }     }     return ret; } TPacketAffectElement CPythonPlayer::GetAffectData(DWORD dwType, BYTE bApplyOn) {     TPacketAffectElement ret;     memset(&ret, 0, sizeof(TPacketAffectElement));     for (TAffectDataVector::iterator it = m_mapAffectData.begin(); it != m_mapAffectData.end(); ++it)     {         TPacketAffectElement elem = *it;         if (elem.dwType == dwType && (bApplyOn == 0 || bApplyOn == elem.bPointIdxApplyOn))         {             ret = elem;             break;         }     }     return ret; } #endif --> Tekrar Arat void CPythonPlayer::ClearSkillDict() --> Altında Bul __ClearAutoAttackTargetActorID(); --> Üstüne Ekle #ifdef ENABLE_AFFECT_CHECK     m_mapAffectData.clear(); #endif -------------------------------------------------------- PythonPlayer.h --> Arat DWORD    GetTargetVID(); --> Altına Ekle #ifdef ENABLE_AFFECT_CHECK     protected:         typedef std::vector<TPacketAffectElement> TAffectDataVector;         TAffectDataVector    m_mapAffectData;     public:         void    AddAffect(DWORD dwType, TPacketAffectElement kElem);         void    RemoveAffect(DWORD dwType, BYTE bApplyOn);         int        GetAffectDataIndex(DWORD dwType, BYTE bApplyOn);         TPacketAffectElement GetAffectData(DWORD dwType, BYTE bApplyOn); #endif -------------------------------------------------------- PythonPlayerModule --> Arat void initPlayer() --> Üstüne ekle #ifdef ENABLE_AFFECT_CHECK PyObject * playerCheckAffect(PyObject* poSelf, PyObject* poArgs) {     DWORD dwType;     if (!PyTuple_GetUnsignedLong(poArgs, 0, &dwType))         return Py_BadArgument();     BYTE bApplyOn;     if (!PyTuple_GetByte(poArgs, 1, &bApplyOn))         return Py_BadArgument();     int iAffIndex = CPythonPlayer::Instance().GetAffectDataIndex(dwType, bApplyOn);     return Py_BuildValue("b", iAffIndex != -1); } #endif --> Arat         { "GetPKMode",                    playerGetPKMode,                    METH_VARARGS }, --> Altına Ekle #ifdef ENABLE_AFFECT_CHECK         { "CheckAffect",                            playerCheckAffect,                            METH_VARARGS }, #endif

Kod:
if app.ENABLE_AFFECT_CHECK and player.CheckAffect(long(chr.NEW_AFFECT_SAVAS), 0) == False:             self.PopupMessage(localeInfo.SAVAS_ITEM_NULL) ## Siz buraya chat de koyabilirsiniz. Bu efekt üzerinde yoksa demektir bu kod.             return

Efekt Kontrol Eklentisi, Metin2 özel sunucularında oyun deneyimini zenginleştirmek ve kontrol edilebilir hale getirmek amacıyla geliştirilmiş güçlü bir C++ tabanlı sistemdir. Bu eklenti sayesinde geliştiriciler, oyuncuların sahip olduğu görsel efektleri, ses efektlerini ve bazı özel durum efektlerini daha iyi yönetebilir. Özellikle Metin2 PvP sistemlerinde efekt kontrolü, performans optimizasyonu ve kullanıcı deneyimi açısından büyük önem taşır.

Bu sistem, Martysama ve benzeri Metin2 geliştirme platformlarında sıklıkla karşılaşılan ihtiyaçlardan biridir. Oyuncuların yoğun战斗 sırasında çok sayıda efektin ekranda oluşması, FPS düşüşlerine ve oyun akışının bozulmasına neden olabilir. Efekt Kontrol Eklentisi ile bu tür durumlar önlenebilir. Geliştiriciler, belirli efektlerin ne zaman ve nasıl çalışacağını ayarlayabilir. Örneğin, PvP savaşlarında kan efekti gösterilip gösterilmeyeceği, özel yeteneklerin efektlerinin ses seviyesi gibi parametreler ayarlanabilir.

Sistem, hem client hem de server tarafında değişiklikler içerir. Client tarafında UIscript dosyalarında efekt ayarları için arayüz oluşturulur. Bu arayüz sayesinde oyuncular kendi tercihlerine göre efektleri açıp kapatabilir. Server tarafında ise Python veya C++ ile yazılmış fonksiyonlar sayesinde efektlerin çalışıp çalışmaması belirlenir. Bu sayede server src üzerinde daha fazla kontrol sağlanır.

Efekt Kontrol Eklentisi, aynı zamanda Metin2 server src üzerinde geliştirme yapanların işini kolaylaştırır. DB Core ile entegre çalışarak, efekt tercihleri oyuncuların karakter veritabanında saklanabilir. Böylece her karakterin kendi efekt ayarları olur ve sunucu yeniden başlatıldığında bu ayarlar korunur. Bu sistem, Metin2Dev toplulukları tarafından da desteklenmektedir ve birçok kaynak kod paylaşımında bu tür eklentilerin kullanımı görülmektedir.

Py GUI ve Python GUI araçları kullanılarak yönetim paneli geliştirilebilir. Bu panel sayesinde adminler, sunucudaki efektleri merkezi olarak yönetebilir. Sistem ayrıca, oyun içinde aktif olan efekt sayısını izlemek ve buna göre sistemsel kararlar almak için loglama sistemleriyle entegre çalışabilir. Bu sayede Metin2 compile işlemi sırasında efekt kontrol modülü doğrudan projeye dahil edilebilir.

Sonuç olarak Efekt Kontrol Eklentisi, Metin2 özel sunucularında hem performans hem de kullanıcı deneyimi açısından önemli bir rol oynar. Doğru uygulandığında, oyuncular daha akıcı ve istedikleri gibi özelleştirilebilir bir oyun deneyimi yaşarlar. Geliştiriciler ise server src üzerinde daha fazla esneklik kazanırlar. Bu tür sistemler, Metin2 PvP sistemlerinin kalitesini artırmada kilit rol oynar.


The Effect Control Plugin is a powerful C++ based system developed to enrich and make controllable the gaming experience in Metin2 private servers. This plugin allows developers to better manage visual effects, sound effects, and certain special condition effects that players possess. Particularly in Metin2 PvP systems, effect control is highly important for performance optimization and user experience.

This system is one of the common needs encountered on development platforms like Martysama and similar Metin2 development sites. During intense combat situations, multiple effects appearing on screen can cause FPS drops and disrupt gameplay flow. These issues can be prevented with the Effect Control Plugin. Developers can configure when and how specific effects operate. For example, whether blood effects are shown during PvP battles, or the volume levels of special ability sounds can be adjusted.

The system includes modifications on both the client and server sides. On the client side, an interface for effect settings is created within UIscript files. Through this interface, players can enable or disable effects according to their preferences. On the server side, functions written in Python or C++ determine whether effects should run. This allows for greater control over the server src.

The Effect Control Plugin also simplifies work for those developing on Metin2 server src. Integrated with the DB Core, player preference settings for effects can be stored within character databases. Thus, each character maintains its own effect settings, which persist even after server restarts. This system is supported by Metin2Dev communities, and many shared source codes include implementations of such plugins.

An administrative panel can be developed using Py GUI and Python GUI tools. This panel allows admins to centrally manage effects in the game. The system can also integrate with logging mechanisms to track active effects in-game and make systemic decisions accordingly. This allows the effect control module to be directly included into projects during Metin2 compilation processes.

In conclusion, the Effect Control Plugin plays a crucial role in both performance and user experience in Metin2 private servers. When applied correctly, players enjoy a smoother and customizable gaming experience. Developers gain more flexibility over server src. Such systems play a key role in enhancing the quality of Metin2 PvP systems.​
 

Şuan Bu Konuyu Görüntüleyen Kullanıcılar (Toplam : 0, Üye : 0, Misafir : 0)

Benzer konular

Geri
Üst Alt