Sistem volkan kardeşime aittir iyi kullanımlar dilerim.
Bir teşekkür kafi
Ziyaretçiler için gizlenmiş link,görmek için üye olmalısınız!
Giriş yap veya üye ol.
Ziyaretçiler için gizlenmiş link,görmek için üye olmalısınız!
Giriş yap veya üye ol.
Murat K - İtemlerin Altında Vnum, Type ve Subtype Kodlarını Gösterme Rehberi (SkyOfDance)
Metin2 özel sunucularında kullanıcı dostu arayüz geliştirmek, hem oyun deneyimini artırır hem de geliştiricilerin daha kolay debug yapabilmesini sağlar. Bu rehberde, Murat K tarafından geliştirilen ve SkyOfDance tarzı stillerde kullanılan bir özellik olan 'item altındaki vnum, type ve subtype gösterimi' konusunu ele alacağız. Bu işlem, hem C++ backend tarafında hem de Python GUI tarafında bazı değişiklikler gerektirir.
VNUM Nedir?
Vnum (Virtual Number), Metin2 oyununda her iteme özel bir tanımlayıcıdır. Her itemin eşsiz bir vnum değeri vardır. Bu numara, itemin hangi dosyada tanımlandığını ve hangi özelliklere sahip olduğunu belirler. Sunucu tarafında item spawn edilirken bu numara kullanılır. Oyuncu tarafında ise GUI üzerinden bu numaraları göstermek, geliştirici olarak kontrol sağlamanızı kolaylaştırır.
Type ve Subtype Nedir?
Itemin hangi kategoriye ait olduğunu belirten iki anahtar değerdir. Type, örneğin weapon, armor, food gibi genel kategoriyi; Subtype ise weapon alt kategorisi olan sword, bow, axe gibi detaylı sınıflandırmayı ifade eder. Bu bilgiler, itemin hangi sistemlere etki edeceğini belirler.
Python Tarafında Uygulama Adımları
1. UI Script Dosyasını Değiştirme:
Item tooltip (bilgi kutusu) gösterimi genellikle uiinventory.py veya uisystem.py gibi dosyalarda yönetilir. Tooltip sınıfında, itemin üzerine gelindiğinde görünen metin parçasına ek olarak vnum, type ve subtype bilgileri eklenebilir.
2. Tooltip Fonksiyonuna Bilgi Ekleme:
Örnek olarak, bir fonksiyonda şu satır eklenebilir:
Kod:
tooltip_text += f'[BR][/BR]VNUM: {vnum}[BR][/BR]Type: {type}[BR][/BR]Subtype: {subtype}'
C++ Tarafında Uygulama Adımları
1. Game Sunucusundan Bilgi Aktarımı:
Game sunucusu, item bilgilerini istemciye gönderirken, bu üç bilgiyi de pakete eklemek gerekir. packet.h dosyasında, item bilgileri tanımlanırken yeni alanlar eklenmelidir.
2. Item Struct Güncellenmesi:
Item sınıfında veya struct'ında vnum, type, subtype alanlarının tanımlı olduğundan emin olun. Eğer mevcut değilse, yeni ekleyin ve bu değerler client tarafına gönderilirken kullanılsın.
Dikkat Edilmesi Gerekenler
- Bilgilerin güvenli bir şekilde aktarılması önemlidir. Özellikle özel sunucularda hile riski taşıdığı için bu bilgilerin doğrudan gösterilip gösterilmemesi tartışmalı olabilir.
- Sunucu tarafında item listesi değiştiğinde bu bilgilerin güncel kalması sağlanmalıdır.
- Client tarafında tooltip cacheleniyorsa, yeni verilerin doğru şekilde yansıtılması için cache temizliği yapılmalıdır.
Faydaları
- Geliştiriciler için debug kolaylığı sağlar.
- Hatalı item spawnlarını hızlıca tespit etmenizi sağlar.
- Oyuncular için item kimliklendirme kolaylaşır.
- SkyOfDance tarzı stillerde kullanıcıya daha fazla bilgi verilmesi, profesyonellik algısını artırır.
Sonuç
Murat K tarzı bir geliştirici olarak, Metin2 özel sunucularında item bilgilerini görünür kılmak hem teknik hem de kullanıcı deneyimi açısından büyük faydalar sağlar. Vnum, Type ve Subtype bilgilerinin doğru şekilde entegre edilmesi, profesyonel bir yapı oluşturmak isteyen geliştiriciler için önemli bir adımdır.
Murat K - Displaying Vnum, Type, and Subtype Codes Under Items (SkyOfDance Style)
Enhancing user interfaces in Metin2 private servers improves gameplay experience and allows developers to debug more efficiently. In this guide, we will cover how to display Vnum, Type, and Subtype codes under items, a feature developed by Murat K and used in styles similar to SkyOfDance. This implementation requires modifications on both the C++ backend and the Python GUI side.
What is Vnum?
Vnum (Virtual Number) is a unique identifier assigned to each item in the Metin2 game. It determines where the item is defined and what properties it has. During item spawning on the server-side, this number is used. On the player side, displaying these numbers through the GUI simplifies control and debugging for developers.
What are Type and Subtype?
These are two key values that define which category an item belongs to. Type refers to general categories like weapon, armor, or food, while Subtype represents subcategories such as sword, bow, or axe within the weapon category. These attributes determine how the item interacts with various systems.
Implementation Steps in Python
1. Modifying UI Script Files:
Item tooltips are typically managed in files like uiinventory.py or uisystem.py. To the tooltip class, add information such as vnum, type, and subtype.
2. Adding Info to Tooltip Function:
As an example, you can append the following to a function:
Kod:
tooltip_text += f'[BR][/BR]VNUM: {vnum}[BR][/BR]Type: {type}[BR][/BR]Subtype: {subtype}'
Implementation Steps in C++
1. Sending Data from Game Server:
When the game server sends item data to the client, it must also include these three pieces of information. Add new fields to the packet structure in packet.h where item details are defined.
2. Updating Item Struct:
Ensure that vnum, type, subtype fields are defined in the item class or struct. If not present, add them so they are sent to the client side.
Important Considerations
- Safely transmitting these values is important. For private servers, showing direct values might pose cheating risks.
- Ensure item data remains up-to-date when the server's item list changes.
- If tooltips are cached on the client side, clear the cache to reflect updated data properly.
Benefits
- Simplifies debugging for developers.
- Allows quick identification of incorrect item spawns.
- Easier item identification for players.
- Providing more detailed information to users in styles like SkyOfDance increases professionalism perception.
Conclusion
Displaying item information like Vnum, Type, and Subtype in Metin2 private servers, as done by Murat K, provides significant technical and user experience benefits. Proper integration of these identifiers is an essential step for developers aiming to build professional-grade systems.
