Merhabalar Değerli Turkmmo Ailesi;
Yeni ve şık herkesin aradığı bir ESC/Ayarlar menü tasarımı.
Sistem İle İlgili Görseller:
Yeni ve şık herkesin aradığı bir ESC/Ayarlar menü tasarımı.
Sistem İle İlgili Görseller:
Metin2 Oyununda ESC Menüsüne Yeni Ayarlar Ekleme Rehberi - C++ Kullanarak
Metin2 özel sunucularında oyuncuların oyun içi deneyimini artırmak için ESC menüsüne yeni ayarlar eklemek oldukça popüler bir özelliktir. Bu rehberde, C++ kullanarak ESC menüsüne nasıl yeni ayarlar ekleyeceğinizi adım adım anlatacağız. Bu işlem, client-side ve server-side düzenlemeler içerir.
Neden ESC Menüsüne Yeni Ayarlar Eklenmeli?
Oyuncuların erişmesini kolaylaştırmak ve oyun içi kontrolleri merkezi bir noktadan yönetmek için ESC menüsüne özel ayarlar eklemek büyük avantaj sağlar. Bu ayarlar; ses seviyesi, PvP modu, grafik ayarları veya özel sunucu kuralları gibi değişiklikleri içerebilir.
Gerekli Araçlar ve Ortamlar[/DOMAIN]
- Metin2 Client Source (C++)
- UISCRIPT (Python GUI)
- Py Root Dosyaları
- Auth ve Game Server Bilgisi
- Temel C++ ve Python Bilgisi
Adım 1: ESC Menü Arayüzünü Hazırlamak
ESC menüsü genellikle uiscript dosyaları ile yönetilir. Python tarafında bir pencere (dialog) oluşturulur ve bu pencere ESC tuşuna basıldığında açılır. Yeni ayarlar için bir buton veya sekme eklemek istiyorsanız, uiinterface.py ve game.py dosyalarında değişiklik yapmanız gerekir.
Adım 2: C++ Tarafında ESC Menü Fonksiyonunu Tanımlamak
ESC menüsü açıldığında çalışacak fonksiyonları C++ tarafında tanımlamak gerekir. Bu işlem genellikle game/src/client/UserInterface/ klasöründe yapılır. Yeni bir sınıf veya fonksiyon tanımlayarak ESC menüsüne özel komutlar atayabilirsiniz.
ESC Menüsüne Tıklama ve Veri Gönderme
ESC menüsünde bir ayar değiştirildiğinde, bu veri sunucuya gönderilerek oyuncunun profiline kaydedilebilir. Bu işlem için network.cpp ve packets.cpp gibi dosyalar üzerinde çalışmak gerekir. Paket tanımlamaları yapılarak sunucu ile istemci arasında haberleşme sağlanır.
Sunucu Tarafında Ayarları Saklamak
ESC menüsünden alınan ayarlar veritabanında saklanmalıdır. GameDB veya AuthDB kullanılarak bu veriler kalıcı hale getirilir. Örneğin, bir oyuncunun PvP modu tercihi, login sırasında kontrol edilip uygulanabilir.
ESC Menüsüne Özel PvP Ayarları Ekleme
Metin2 PvP sistemlerinde, oyuncuların PvP modlarını ESC menüsünden değiştirmesi büyük kolaylık sağlar. Bu tür sistemlerde, C++ tarafında PvP durumu kontrol eden bir fonksiyon tanımlanmalı ve Python tarafında da bu durum arayüze aktarılmalıdır.
Kodlama Örneği: ESC Menüsünde PvP Ayar Butonu
Python tarafında bir buton tanımlanarak bu butona tıklandığında PvP modu değiştirilebilir. Bu işlem için ui.py dosyasında bir buton nesnesi oluşturulur. Bu buton tıklandığında C++ tarafında tanımlanan fonksiyon çağrılır ve sunucuya paket gönderilir.
Otomatik Ayar Yükleme
ESC menüsü açıldığında, oyuncunun önceki ayarları yüklenebilir. Bu işlem için oyuncu giriş yaptığında veritabanından ayarlar çekilir ve arayüze yansıtılır. Böylece kullanıcı her oturumda aynı tercihleri tekrar yapmak zorunda kalmaz.
Test ve Hata Ayıklama
ESC menüsüne eklenen yeni ayarlar test edilmelidir. Hem C++ hem de Python tarafında hata ayıklama işlemleri yapılmalı. Özellikle ağ üzerinden veri aktarımı sırasında oluşabilecek gecikmeler ya da eksik veri iletilmesi gibi durumlar kontrol edilmelidir.
Sonuç
ESC menüsüne yeni ayarlar eklemek, Metin2 özel sunucularında kullanıcı deneyimini ciddi anlamda artırır. Bu işlem için hem C++ hem de Python bilgisi gerekebilir. Ancak doğru yapılandırıldığında, oyuncuların daha fazla kontrol sahibi olması sağlanır.
Guide to Adding New Settings to ESC Menu in Metin2 - Using C++
To enhance the in-game experience for players on Metin2 private servers, adding new settings to the ESC menu is quite a popular feature. In this guide, we'll explain step-by-step how to add new settings to the ESC menu using C++. This process includes both client-side and server-side modifications.
Why Add New Settings to the ESC Menu?
Adding custom settings to the ESC menu provides easy access for players and allows centralized control of in-game options. These settings can include volume levels, PvP modes, graphic adjustments, or custom server rules.
Required Tools and Environments
- Metin2 Client Source (C++)
- UISCRIPT (Python GUI)
- Py Root Files
- Auth and Game Server Knowledge
- Basic C++ and Python Knowledge
Step 1: Preparing the ESC Menu Interface
The ESC menu is typically managed via uiscript files. A window (dialog) is created in Python that opens when the ESC key is pressed. To add new settings, you need to modify uiinterface.py and game.py files to include buttons or tabs for these options.
Step 2: Defining ESC Menu Functions in C++
Functions that execute when the ESC menu opens must be defined on the C++ side. This usually happens within the game/src/client/UserInterface/ folder. You can define new classes or functions to assign custom commands to the ESC menu.
Click Handling and Data Transmission from the ESC Menu
When a setting is changed in the ESC menu, the data must be sent to the server and saved to the player's profile. For this, work on files like network.cpp and packets.cpp. Packet definitions are used to enable communication between the client and server.
Storing Settings on the Server Side
Settings taken from the ESC menu should be stored in the database. Using GameDB or AuthDB, these values can be made persistent. For example, a player's PvP mode preference can be checked upon login and applied accordingly.
Adding Custom PvP Settings to the ESC Menu
In Metin2 PvP systems, allowing players to change their PvP modes directly from the ESC menu offers great convenience. In such systems, a function controlling PvP status must be defined in C++, and the status must be reflected in the UI via Python.
Coding Example: PvP Setting Button in ESC Menu
A button can be defined in Python, and clicking it can toggle the PvP mode. A button object is created in the ui.py file, and when clicked, the corresponding function defined in C++ is called, sending a packet to the server.
Auto-Loading Settings[/BR]When the ESC menu opens, the player's previous settings can be loaded. Upon login, settings are fetched from the database and reflected in the UI, so users don't have to reselect preferences each session.
Testing and Debugging
Newly added settings must be tested thoroughly. Debugging should occur on both the C++ and Python sides. Pay special attention to delays or missing data during network transmission.
Conclusion
Adding new settings to the ESC menu significantly enhances the user experience in Metin2 private servers. This requires knowledge of both C++ and Python. When configured correctly, players gain more control over their gameplay.
