Merhaba arkadaşlar bugün sizlere minimap altı yazı eklemeyi anlatacağım
uiscript / minimap.py Açılır
root / uiminimap.py Açılır
locale / tr /locale_interface.txt
Python ile Metin2 Özel Sunucu Geliştirme Serisi: Mini Harita Altı İsteğe Bağlı Yazı Sistemi
Metin2 özel sunucularında kullanıcı deneyimini artırmak için geliştiriciler sürekli yeni sistemler üretir. Bu sistemlerden biri de mini harita altına istenen yazının yazdırılmasıdır. Bu yazılar; sunucu duyuruları, özel etkinlikler veya sadece estetik amaçlı olabilir. Bu makalede, Python dilini kullanarak Mini Harita Altı bölümüne istenilen yazıyı nasıl yazdıracağımızı adım adım inceleyeceğiz. Bu sistem özellikle Martysama tabanlı clientlerde kolayca entegre edilebilir.
Ön Bilgi: Bu makale, Metin2 özel sunucu geliştirme konusunda bilgi sahibi olan ya da olmaya çalışan geliştiriciler içindir. Python bilgisi ve UIScript yapısına aşina olmak faydalı olacaktır. Ayrıca bu işlem sırasında client tarafında değişiklik yapılması gerekir.
1. Gerekli Dosyalar ve Yollar
Öncelikle, mini harita arayüzünü kontrol eden dosyayı tanımlamalıyız. Bu genellikle uiscript/minimap.py veya benzeri bir dosya olur. Client üzerinde mini haritada bir yazı eklemek için bu dosyanın içinde yeni bir TextLine nesnesi oluşturmamız gerekir.
2. UIScript Dosyasında Değişiklik
minimap.py dosyasını açtıktan sonra, mevcut yapıyı inceledikten sonra mini haritanın altında yer alacak yeni bir TextLine objesi ekleyelim. Örneğin:
self.minimapText = ui.TextLine()
self.minimapText.SetParent(self.minimapBoard)
self.minimapText.SetPosition(0, 180)
self.minimapText.SetText('Python ile Metin2 Lobby')
self.minimapText.Show()
Bu örnekte, yazı mini harita panelinin altına yerleştirilmiştir. Pozisyon değerleri, ekran boyutuna göre ayarlanabilir. Yazı rengi ve font büyüklüğü gibi özellikler de Python tarafında CSS benzeri stillerle ayarlanabilir ancak bu konu ileri düzeyde detaylara girer.
3. Dinamik Yazı Ataması
Statik bir yazı yerine, oyun başlatıldığında veya belirli bir zaman aralığında değişen bir yazı göstermek istiyorsanız, Python tarafında bir fonksiyon tanımlamanız gerekir. Örneğin, game.py veya system.py dosyasında bir update fonksiyonu tanımlanabilir:
def update_minimap_text(text):
minimap_window.minimapText.SetText(text)
Bu sayede sunucu tarafından gelen mesajlar veya admin panelinden girilen duyurular, mini harita altındaki yazı kısmında dinamik olarak gösterilebilir.
4. Entegrasyon ve Test
Yaptığınız değişiklikleri client üzerine derledikten sonra test edin. Eğer yazı görünmüyorsa, hata loglarını kontrol edin. PyCharm veya Visual Studio Code gibi editörlerde hata ayıklama yaparak sorunları çözebilirsiniz. Metin2Lobby.com forumlarında bu konularla ilgili yardım alabileceğiniz topluluklar da mevcuttur.
5. Ekstra Özellikler
Yazının rengini zamana göre değiştirebilir, blink efekti ekleyebilir veya belirli bir süre sonra kaybolmasını sağlayabilirsiniz. Bunun için tick fonksiyonları veya timer sınıfları kullanılabilir. Örneğin, yazı her 5 saniyede bir rengi değişebilir veya farklı bir metin gösterebilir.
Sonuç: Mini harita altına yazı yazmak, kullanıcı deneyimini artırmak için oldukça etkili ve kolay bir yöntemdir. Python tabanlı sistemler sayesinde bu yazılar hem statik hem de dinamik olarak ayarlanabilir. Bu sistem, Metin2 özel sunucularında hem PvP hem de PvE sunucularında kullanılabilir. Geliştiriciler bu yöntemi kullanarak kendi sunucularına özgün dokunuşlar ekleyebilirler.
Python-Based Metin2 Private Server Development Series: Writing Custom Text Below the Minimap
To enhance user experience in Metin2 private servers, developers constantly create new systems. One such system involves displaying custom text beneath the minimap. This text can be used for server announcements, special events, or simply for aesthetic purposes. In this article, we will examine step by step how to write desired text under the minimap using the Python language. This system can be easily integrated into Martysama-based clients.
Prerequisites: This article is intended for developers familiar with Metin2 private server development or those learning. Knowledge of Python and the UIScript structure will be beneficial. Additionally, modifications on the client-side are required for this implementation.
1. Required Files and Paths
Firstly, we need to identify the file that controls the minimap interface. This is typically a file like uiscript/minimap.py or a similar one. To add text below the minimap in the client, we need to create a new TextLine object within this file.
2. Modifying the UIScript File
After opening the minimap.py file, we inspect its current structure and then add a new TextLine object that will appear below the minimap. For example:
self.minimapText = ui.TextLine()
self.minimapText.SetParent(self.minimapBoard)
self.minimapText.SetPosition(0, 180)[/COORD]
self.minimapText.SetText('Python with Metin2 Lobby')
self.minimapText.Show()
In this example, the text is positioned below the minimap panel. Position values can be adjusted according to screen dimensions. Text color and font size can also be set via Python, though this topic delves into more advanced details.
3. Dynamic Text Assignment
If you want to display dynamic text that changes at launch or at specific intervals instead of static text, you should define a function in Python. For instance, a update function could be defined in game.py or system.py:
def update_minimap_text(text):
minimap_window.minimapText.SetText(text)
This allows messages from the server side or announcements entered through an admin panel to dynamically appear in the text area beneath the minimap.
4. Integration and Testing
After compiling your changes into the client, test them. If the text does not appear, check the error logs. You can debug issues using editors like PyCharm or Visual Studio Code. Communities on Metin2Lobby.com forums may also provide assistance with these topics.
5. Additional Features
You can change the text's color over time, add blinking effects, or make it disappear after a certain duration. For this, tick functions or timer classes can be used. For example, the text can change color every 5 seconds or display different content.
Conclusion: Displaying custom text under the minimap is an effective and simple way to enhance user experience. Thanks to Python-based systems, these texts can be set both statically and dynamically. This system can be used in both PvP and PvE Metin2 private servers. Developers can use this method to add unique touches to their own servers.
uiscript / minimap.py Açılır
Kod:
# En üste ekle import uiScriptLocale
Kod:
# Arat "children" : ( { "name" : "OpenWindowBGI", "type" : "image", "x" : 0, "y" : 0, "image" : ROOT + "minimap.sub", },
Kod:
# Altına Ekle { "name" : "Yazi", "type" : "text", "text_horizontal_align" : "center", "x" : 70, "y" : 205, "outline" : 1, "text" : uiScriptLocale.MINI_MAP_YAZI, },
root / uiminimap.py Açılır
Kod:
# Arat self.CloseWindow = self.GetChild("CloseWindow") self.MiniMapShowButton = self.GetChild("MiniMapShowButton") self.positionInfo = self.GetChild("PositionInfo") self.observerCount = self.GetChild("ObserverCount") self.serverInfo = self.GetChild("ServerInfo")
Kod:
# Altına Ekle self.RYazi = self.GetChild("Yazi")
locale / tr /locale_interface.txt
Kod:
# En Alta Ekle MINI_MAP_YAZI Serverimize Hoşgeldiniz
Sistemden Görüntü
Python ile Metin2 Özel Sunucu Geliştirme Serisi: Mini Harita Altı İsteğe Bağlı Yazı Sistemi
Metin2 özel sunucularında kullanıcı deneyimini artırmak için geliştiriciler sürekli yeni sistemler üretir. Bu sistemlerden biri de mini harita altına istenen yazının yazdırılmasıdır. Bu yazılar; sunucu duyuruları, özel etkinlikler veya sadece estetik amaçlı olabilir. Bu makalede, Python dilini kullanarak Mini Harita Altı bölümüne istenilen yazıyı nasıl yazdıracağımızı adım adım inceleyeceğiz. Bu sistem özellikle Martysama tabanlı clientlerde kolayca entegre edilebilir.
Ön Bilgi: Bu makale, Metin2 özel sunucu geliştirme konusunda bilgi sahibi olan ya da olmaya çalışan geliştiriciler içindir. Python bilgisi ve UIScript yapısına aşina olmak faydalı olacaktır. Ayrıca bu işlem sırasında client tarafında değişiklik yapılması gerekir.
1. Gerekli Dosyalar ve Yollar
Öncelikle, mini harita arayüzünü kontrol eden dosyayı tanımlamalıyız. Bu genellikle uiscript/minimap.py veya benzeri bir dosya olur. Client üzerinde mini haritada bir yazı eklemek için bu dosyanın içinde yeni bir TextLine nesnesi oluşturmamız gerekir.
2. UIScript Dosyasında Değişiklik
minimap.py dosyasını açtıktan sonra, mevcut yapıyı inceledikten sonra mini haritanın altında yer alacak yeni bir TextLine objesi ekleyelim. Örneğin:
self.minimapText = ui.TextLine()
self.minimapText.SetParent(self.minimapBoard)
self.minimapText.SetPosition(0, 180)
self.minimapText.SetText('Python ile Metin2 Lobby')
self.minimapText.Show()
Bu örnekte, yazı mini harita panelinin altına yerleştirilmiştir. Pozisyon değerleri, ekran boyutuna göre ayarlanabilir. Yazı rengi ve font büyüklüğü gibi özellikler de Python tarafında CSS benzeri stillerle ayarlanabilir ancak bu konu ileri düzeyde detaylara girer.
3. Dinamik Yazı Ataması
Statik bir yazı yerine, oyun başlatıldığında veya belirli bir zaman aralığında değişen bir yazı göstermek istiyorsanız, Python tarafında bir fonksiyon tanımlamanız gerekir. Örneğin, game.py veya system.py dosyasında bir update fonksiyonu tanımlanabilir:
def update_minimap_text(text):
minimap_window.minimapText.SetText(text)
Bu sayede sunucu tarafından gelen mesajlar veya admin panelinden girilen duyurular, mini harita altındaki yazı kısmında dinamik olarak gösterilebilir.
4. Entegrasyon ve Test
Yaptığınız değişiklikleri client üzerine derledikten sonra test edin. Eğer yazı görünmüyorsa, hata loglarını kontrol edin. PyCharm veya Visual Studio Code gibi editörlerde hata ayıklama yaparak sorunları çözebilirsiniz. Metin2Lobby.com forumlarında bu konularla ilgili yardım alabileceğiniz topluluklar da mevcuttur.
5. Ekstra Özellikler
Yazının rengini zamana göre değiştirebilir, blink efekti ekleyebilir veya belirli bir süre sonra kaybolmasını sağlayabilirsiniz. Bunun için tick fonksiyonları veya timer sınıfları kullanılabilir. Örneğin, yazı her 5 saniyede bir rengi değişebilir veya farklı bir metin gösterebilir.
Sonuç: Mini harita altına yazı yazmak, kullanıcı deneyimini artırmak için oldukça etkili ve kolay bir yöntemdir. Python tabanlı sistemler sayesinde bu yazılar hem statik hem de dinamik olarak ayarlanabilir. Bu sistem, Metin2 özel sunucularında hem PvP hem de PvE sunucularında kullanılabilir. Geliştiriciler bu yöntemi kullanarak kendi sunucularına özgün dokunuşlar ekleyebilirler.
Python-Based Metin2 Private Server Development Series: Writing Custom Text Below the Minimap
To enhance user experience in Metin2 private servers, developers constantly create new systems. One such system involves displaying custom text beneath the minimap. This text can be used for server announcements, special events, or simply for aesthetic purposes. In this article, we will examine step by step how to write desired text under the minimap using the Python language. This system can be easily integrated into Martysama-based clients.
Prerequisites: This article is intended for developers familiar with Metin2 private server development or those learning. Knowledge of Python and the UIScript structure will be beneficial. Additionally, modifications on the client-side are required for this implementation.
1. Required Files and Paths
Firstly, we need to identify the file that controls the minimap interface. This is typically a file like uiscript/minimap.py or a similar one. To add text below the minimap in the client, we need to create a new TextLine object within this file.
2. Modifying the UIScript File
After opening the minimap.py file, we inspect its current structure and then add a new TextLine object that will appear below the minimap. For example:
self.minimapText = ui.TextLine()
self.minimapText.SetParent(self.minimapBoard)
self.minimapText.SetPosition(0, 180)[/COORD]
self.minimapText.SetText('Python with Metin2 Lobby')
self.minimapText.Show()
In this example, the text is positioned below the minimap panel. Position values can be adjusted according to screen dimensions. Text color and font size can also be set via Python, though this topic delves into more advanced details.
3. Dynamic Text Assignment
If you want to display dynamic text that changes at launch or at specific intervals instead of static text, you should define a function in Python. For instance, a update function could be defined in game.py or system.py:
def update_minimap_text(text):
minimap_window.minimapText.SetText(text)
This allows messages from the server side or announcements entered through an admin panel to dynamically appear in the text area beneath the minimap.
4. Integration and Testing
After compiling your changes into the client, test them. If the text does not appear, check the error logs. You can debug issues using editors like PyCharm or Visual Studio Code. Communities on Metin2Lobby.com forums may also provide assistance with these topics.
5. Additional Features
You can change the text's color over time, add blinking effects, or make it disappear after a certain duration. For this, tick functions or timer classes can be used. For example, the text can change color every 5 seconds or display different content.
Conclusion: Displaying custom text under the minimap is an effective and simple way to enhance user experience. Thanks to Python-based systems, these texts can be set both statically and dynamically. This system can be used in both PvP and PvE Metin2 private servers. Developers can use this method to add unique touches to their own servers.
