Kod:
def OverInItem(self, overSlotPos):
OverInItem içindeki
Kod:
self.wndItem.SetUsableItem(False)
Değiştir
Kod:
self.wndItem.SetUsableItem(True)
Sorun 2;
3 adet buz parçası ve 10 adet buz parçası var
3 adeti tutup 10 adetin üstüne sürüklediğinizde birleştirmiyor
fakat 10 adeti tutup 3 adeti sürüklediğinizde birleştiriyor.
yani sürüklediğiniz sayı birleştireceğinizden büyükse birleştirmiyor.
Çözüm;
root/uiinventory.py
class ExtendedInventoryWindow(ui.ScriptWindow): içinde bul;
Kod:
def SelectItemSlot(self, itemSlotIndex):
SelectItemSlot içindeki
Kod:
if player.GetItemCount(itemSlotIndex) > attachedItemCount: return
Değiştir
Kod:
if attachedSlotPos == itemSlotIndex: return
K Envanter için Birkaç Düzeltme
Metin2 özel sunucularında geliştirme yaparken, oyuncuların envanter yönetimi ve kullanıcı arayüzü üzerinde büyük önem taşır. Bu bağlamda, K Envanter sistemi birçok geliştirici tarafından tercih edilen bir özelliktir. Ancak, bazı durumlarda bu sistemin düzgün çalışması için küçük düzenlemeler yapılması gerekir. Bu yazıda, Metin2Lobby üzerinden paylaştığımız bu sisteme dair bazı önemli düzeltmeleri ele alacağız.
K Envanter Nedir?
K Envanter, Metin2 oyununda ekstra envanter slotları sunan bir sistemdir. Oyuncuların daha fazla eşya taşıyabilmesini sağlar. Özellikle PVP sistemlerinde bu tür özellikler, oyuncu deneyimini ciddi anlamda artırabilir. K Envanter, genellikle C++ tabanlı sunucu tarafında geliştirilir ve istemci tarafında UIScript ile entegre edilir.
Sistem Hatalarını Giderme
K Envanter sisteminin doğru çalışabilmesi için bazı dosyalarda değişiklik yapılması gerekir. Öncelikle, envanterin açılması sırasında yaşanan donmalar ya da açılmama gibi sorunlar, genellikle client/src/game/uitooltip.py veya uiscript/InventoryWindow.py gibi dosyalardaki eksik veya yanlış kodlardan kaynaklanır. Bu dosyaları kontrol etmek ve gerekli düzeltmeleri yapmak, sistemin daha stabil çalışmasını sağlar.
Sunucu Tarafı Kodlama Düzeltmeleri
Sunucu tarafında game/src/char.cpp ve db/src/ClientManager.cpp gibi dosyalar üzerinde değişiklikler yapılmalıdır. Özellikle envanter slot sayısının doğrulanması ve veritabanı ile uyumlu çalışması sağlanmalıdır. Burada yapılan küçük hatalar, sunucuda büyük çaplı sorunlara yol açabilir. Bu nedenle, sunucu tarafında yapılan her değişiklikten önce mutlaka yedek alınmalıdır.
Py Root ve Pack Dosyalarında Gerekli Ayarlar
Python kök dizininde bulunan root klasöründe, K Envanter ile ilgili UI dosyaları yer alır. Bu dosyalar, pack dosyası içerisine yerleştirildiğinde, istemcide doğru görüntülenmelidir. Paketleme sırasında bazı dosyaların eksik gitmesi, sistemin açılmamasına neden olabilir. Bu durumda, packer aracının doğru yapılandırıldığından emin olunmalıdır.
Otomatik Slot Açma Sistemi
K Envanter, genellikle belirli seviye veya görev tamamlamalarıyla otomatik olarak yeni slotlar açar. Bu işlem, hem sunucu hem de istemci tarafında senkronize bir şekilde çalışmalıdır. client/src/game/questluafunctions.cpp dosyası üzerinden bu kontrol sağlanabilir..quest.lua dosyasında tanımlanan fonksiyonlarla, oyuncunun belirli bir seviyeye ulaşması durumunda yeni slotların açılması sağlanabilir.
Sonuç
K Envanter sistemi, Metin2 özel sunucularında kullanıcı dostu bir arayüz sunarak oyuncuların oyun içi deneyimini artırır. Ancak, bu sistemin doğru çalışabilmesi için sunucu ve istemci tarafında yapılacak küçük ama kritik düzenlemeler önemlidir. Bu makalede belirttiğimiz gibi, dosya kontrolleri, paketleme işlemleri ve veritabanı bağlantısı gibi adımlar dikkatle yapılmalıdır. Metin2Lobby olarak, tüm Metin2 geliştiricilerine destek olmaya devam ediyoruz.
Several Fixes for K Inventory
In Metin2 private server development, inventory management and user interface are highly important aspects of gameplay. In this context, the K Inventory system is preferred by many developers. However, sometimes minor adjustments are required for the system to function properly. In this article, we will discuss some important fixes related to the K Inventory system shared via Metin2Lobby.
What is K Inventory?
K Inventory is a system in Metin2 that provides additional inventory slots to players, allowing them to carry more items. Especially in PVP systems, such features can significantly enhance the player experience. The K Inventory is typically developed on the server-side using C++ and integrated into the client through UI scripts.
Fixing System Errors
To ensure the K Inventory system works correctly, modifications may be required in certain files. For example, issues like freezing or failure to open the inventory often stem from missing or incorrect code in files like client/src/game/uitooltip.py or uiscript/InventoryWindow.py. Reviewing these files and making necessary corrections ensures the system runs more stably.
Server-Side Code Corrections
Modifications must also be made to files such as game/src/char.cpp and db/src/ClientManager.cpp on the server side. It is essential to verify the number of inventory slots and ensure compatibility with the database. Minor mistakes here can lead to significant problems on the server. Therefore, always create backups before making any changes on the server side.
Required Settings in Py Root and Pack Files
The root folder in the Python directory contains UI files related to K Inventory. When these files are placed into the pack file, they must display correctly in the client. If certain files are missing during packaging, the system might fail to load. Therefore, ensure that the packer tool is configured correctly.
Automatic Slot Unlocking System
K Inventory often unlocks new slots automatically upon reaching certain levels or completing quests. This process must run synchronously on both the server and client sides. You can manage this through the client/src/game/questluafunctions.cpp file. By defining functions in the quest.lua file, you can enable new slots to unlock when a player reaches a specific level.
Conclusion
The K Inventory system enhances the gaming experience in Metin2 private servers by providing a user-friendly interface. However, small but critical adjustments on both the server and client sides are essential for the system to function properly. As outlined in this article, steps such as file checks, packaging processes, and database connections should be carefully executed. At Metin2Lobby, we continue to support all Metin2 developers.
