Neden dolayı kullanıldığını henüz bilmiyorum fakat gamede kesilen canavarlar ve adeti tutuluyor
Bende bunu c++ tabanlı zindanlarda veya quest flag vermekten kaçınmak için görevlerde kullanabiliriz
mesela catacomb içine girmek için önce lucifer kesildimi sorgusu yapılabilir.
Bende bunu c++ tabanlı zindanlarda veya quest flag vermekten kaçınmak için görevlerde kullanabiliriz
mesela catacomb içine girmek için önce lucifer kesildimi sorgusu yapılabilir.
Burda listeye her vnumdan bir adet ekleniyor yani bu listede vnum hiç yoksa canavar oyun boyunca hiç kesilmemiş demektir
ekstradan bir depolama yapmadan şöyle kontrol ediyorum
İterator son elemana gelene kadar vnumu bulamadıysa fonksiyon false dönüyor yani canavar kesilmedi
Kod:
bool CHARACTER_MANAGER::IsBeenKilledBefore(DWORD dwVnum) const { itertype(m_map_dwMobKillCount) it = m_map_dwMobKillCount.find(dwVnum); if (it == m_map_dwMobKillCount.end()) return false; return true; }
Örnek kullanım;
Basit Bir Blok Kodu Nedir?
Metin2 özel sunucuları geliştirmeye çalışan geliştiriciler için blok kodlar, temel yapı taşlarından biridir. Bu kodlar genellikle C++ veya Python dillerinde yazılmış olup, oyuncuların oyun içinde belirli eylemler yapmasını sağlayan küçük modüllerdir. Basit bir blok kod, genellikle oyuncuya bir buton gösterir, bir seçim yaptırır veya bir işlem başlatır. Bu tür sistemler, Metin2 PvP sistemlerinde sıkça kullanılır. Bu yazıda basit bir blok kodun nasıl yazılacağını ve Metin2 özel sunucularında nasıl uygulanacağını anlatacağız.
Blokların Kullanım Alanları
Bloklar, oyuncuların etkileşimde bulunduğu arayüz öğeleridir. Örneğin bir görev tamamlama butonu, bir envanter açma komutu veya bir tekrar canlanma seçeneği gibi. Bu bloklar genellikle UIScript veya Py Root üzerinde çalışır. Python GUI kullanılarak hazırlanmış bloklar, daha dinamik ve kullanıcı dostu olabilir. Blok kodları, hem Game Server hem de Client tarafında etkili olacak şekilde tasarlanabilir.
Python GUI Kullanımı
Python ile yazılmış bir blok kodu oluşturmak oldukça kolaydır. Özellikle Py GUI sistemleri, görsel arayüz oluşturmayı kolaylaştırır. Aşağıda basit bir buton içeren bir blok kodu örneği verilmiştir:
import ui
class SimpleBlock(ui.ScriptWindow):
def __init__(self):
ui.ScriptWindow.__init__(self)
self.__CreateDialog()
def __CreateDialog(self):
self.board = ui.ThinBoard()
self.board.SetSize(200, 100)
self.board.SetPosition(100, 100)
self.board.Show()
btn = ui.Button()
btn.SetParent(self.board)
btn.SetPosition(75, 40)
btn.SetText('Tikla')
btn.SetEvent(lambda: self.Click())
btn.Show()
def Click(self):
chat.AppendChat(chat.CHAT_TYPE_INFO, 'Butona tiklandi!')
UYARI: Bu kod doğrudan Metin2 Client SRC dosyalarına entegre edilmelidir. Kodun doğru çalışması için gerekli kütüphanelerin yüklü olduğundan emin olunmalıdır. Ayrıca blok kodları, doğru DB-Core ve Game-Core ile uyumlu olmalıdır.
C++ ile Blok Geliştirme
C++ tabanlı blok sistemleri, daha derin seviye işlemler için uygundur. Özellikle Source Edit süreçlerinde bu tür kodlar kullanılır. C++ bloklar, doğrudan sunucu tarafında çalışır ve daha fazla kontrol sağlar. Ancak yazılması daha karmaşık olabilir. C++ blok kodları genellikle Channel tabanlı sunucularda kullanılır. Bu kodlar Martysama veya benzeri geliştirici sistemleri ile test edilebilir.
Sonuç
Basit bir blok kodu oluşturmak, Metin2 özel sunucularında kullanıcı deneyimini artırmak için önemli bir adımdır. Hem Python GUI hem de C++ sistemleri, farklı ihtiyaçlara göre kullanılabilir. Geliştiriciler, bu blokları kullanarak daha interaktif ve eğlenceli sistemler inşa edebilir. Bu tür sistemler, Metin2Dev sürecinde büyük rol oynar ve oyuncuların dikkatini çeker.
What is a Simple Block Code?
For developers working on Metin2 private servers, block codes are among the fundamental building blocks. These codes are typically written in C++ or Python and allow players to perform specific actions within the game. A simple block code often displays a button, prompts for a selection, or initiates an action. Such systems are frequently used in Metin2 PvP systems. In this article, we will explain how to write a simple block code and implement it in Metin2 private servers.
Areas of Use for Blocks
Blocks are interface elements with which players interact. For example, a quest completion button, an inventory opening command, or a respawn option. These blocks usually operate on UIScript or Py Root. Blocks created using Python GUI can be more dynamic and user-friendly. Block codes can be designed to function effectively on both Game Server and Client sides.
Using Python GUI
Creating a block code in Python is quite straightforward. Especially Py GUI systems make visual interface creation easier. Below is an example of a simple block code containing a button:
import ui
class SimpleBlock(ui.ScriptWindow):
def __init__(self):
ui.ScriptWindow.__init__(self)
self.__CreateDialog()
def __CreateDialog(self):
self.board = ui.ThinBoard()
self.board.SetSize(200, 100)
self.board.SetPosition(100, 100)
self.board.Show()
btn = ui.Button()
btn.SetParent(self.board)
btn.SetPosition(75, 40)
btn.SetText('Click')
btn.SetEvent(lambda: self.Click())
btn.Show()
def Click(self):
chat.AppendChat(chat.CHAT_TYPE_INFO, 'Button clicked!')
WARNING: This code must be integrated directly into the Metin2 Client SRC files. Ensure that the required libraries are installed for the code to run correctly. Additionally, block codes must be compatible with the correct DB-Core and Game-Core.
Developing Blocks with C++
C++ based block systems are suitable for deeper-level operations. These types of codes are especially used during Source Edit processes. C++ blocks operate directly on the server side and provide greater control. However, they can be more complex to write. C++ block codes are generally used on Channel based servers. These codes can be tested using developer systems like Martysama.
Conclusion
Creating a simple block code is an important step in enhancing the player experience in Metin2 private servers. Both Python GUI and C++ systems can be used depending on different requirements. Developers can build more interactive and entertaining systems by utilizing these blocks. Such systems play a significant role in the Metin2Dev process and attract players' attention.
