- Katılım
- 6 Mayıs 2022
- Konular
- 48,291
- Mesajlar
- 48,601
- Tepkime puanı
- 75
- M2 Yaşı
- 3 yıl 11 ay 10 gün
- Trophy Puan
- 48
- M2 Yang
- 488,879
Kod:
Search for CInstanceBase::UpdateTextTailLevel Below sprintf(szText, "Lv %d", level); And before CPythonTextTail::Instance().AttachLevel(GetVirtualID(), szText, s_kLevelColor); Add this if (IsGameMaster()) { const char* name = GetNameString(); size_t len = strcspn(name, "]"); char *result = (char *)malloc((len + 1) * sizeof(char)); // Not sure why on client side needs to be like this strncpy(result, name, len +1); result[len + 1] = '\0'; const char *tagDictionary[] = { "[GM]", "[SA]", "[GA]", "[DEV]" }; //Here you can also change the color of the tag const char *nameDictionary[] = { "|cffff0000[STAFF]", "|cffff0000[EQUIPA]", "|cffff0000[STAFF2]", "|cffff0000[DEVELOPER]" }; int tagIndex = -1; for (int i = 0; i < sizeof(tagDictionary) / sizeof(tagDictionary[0]); ++i) { if (strcmp(result, tagDictionary[i]) == 0) { tagIndex = i; break; } } if (tagIndex != -1){ sprintf(szText, nameDictionary[tagIndex]); } else{ // This is just for if the code cant find any tag, it will default to this one. // You can also just delete this whole else statement and it will default to the level text sprintf(szText, "|cffff0000[TEST]"); } free(result); CPythonTextTail::Instance().AttachLevel(GetVirtualID(), szText, s_kLevelColor); }
Metin2 Mini Harita Görev Iconu Sistemi
Metin2 özel sunucularında oyun deneyimini artırmak için geliştirilen pek çok görsel sistem vardır. Bunlardan biri de mini harita üzerinde görev konumlarını gösteren ikonlardır. Bu sistem, oyuncuların görevlerinde ilerlemesini kolaylaştırır ve daha etkili bir oynanış sağlar. Ancak bazı özel sunucularda bu sistem eksik veya hatalı çalışabilir. Bu yazıda, C++ tabanlı bir sistem olan Mini Harita Görev İkonu hatasının nasıl düzeltileceğini detaylı olarak inceleyeceğiz.
Neden Görev İkonları Önemlidir?
Görevler, Metin2 oyununda karakter gelişimi için temel mekanizmalardandır. Oyuncular, görevleri takip ederken harita üzerindeki konumlara gitmek zorundadır. Görev veren NPC'ye ya da görev nesnesine ulaşmak zaman alıcı olabilir. Bu nedenle mini haritada görev konumu gösterimi, kullanıcı dostu bir özelliktir. Bu özellik eksik veya çalışmıyorsa, oyuncu deneyimi ciddi anlamda düşer.
Problemin Kaynağı Nedir?
Genellikle bu problem, istemci tarafında görev ikonlarının doğru şekilde işlenmemesinden kaynaklanır. Bazı özel sunucu sistemlerinde, görev sistemleri farklı yapılandırılmıştır. Bu durumda, görev veren NPC veya görev konumu verileri, mini harita sistemi tarafından doğru şekilde okunamaz. Bu da görev ikonunun görünmemesine sebep olur.
C++ Kaynak Kodlarında Düzeltme
Mini harita görev ikonu düzeltmesi için genellikle iki dosya üzerinde değişiklik yapmanız gerekir:
- Client/src/game/questmanager.cpp
- Client/src/ui/minimap.py
Bu dosyalarda, görev sistemi ile mini harita arasındaki veri akışı kontrol edilmelidir. Özellikle QUEST_ICON_UPDATE fonksiyonu görev ikonlarını güncellemekten sorumludur. Bu fonksiyonun doğru şekilde çağrıldığından emin olunmalıdır.
Yapılması Gerekenler
1. Görev sistemi ile mini harita arasında bağlantı kurulmalı.
2. Görev veren NPC'nin koordinatları doğru şekilde alınmalı.
3. İkon türü ve konumu paket olarak sunucuya gönderilmeli.
4. İstemcide gelen veri doğru şekilde işlenmeli ve ekrana yansıtılmalı.
Python Tarafında UI Script Ayarı
Mini harita UI script dosyası, genellikle uiscript klasöründe yer alır. Bu dosya, görev ikonlarının nerede ve nasıl görüneceğini belirler. Görev ikonu için özel bir icon image tanımlanmalı ve konuma göre konumlandırılmalıdır. Ayrıca, bu ikonun tıklanabilir olması da sağlanabilir.
Test ve Onaylama[/COORD]
Değişikliklerden sonra mutlaka test yapılmalıdır. Yeni bir karakterle görev başlatıp, görevin mini haritada doğru şekilde gösterilip gösterilmediği kontrol edilmelidir. Hata varsa, log dosyaları incelenmeli ve eksik bağlantılar tamamlanmalıdır.
Sonuç
Mini harita görev ikonu sistemi, Metin2 özel sunucularında kullanıcı deneyimini artıran küçük ama önemli bir özelliktir. C++ ve Python tabanlı düzeltmelerle bu sistem stabil hale getirilebilir. Bu tür sistemlerin detaylı analizi, sunucu geliştiricilerinin daha kaliteli içerik üretmesini sağlar. Daha fazla sistem ve kaynak kod için Metin2Lobby'yi takip etmeye devam edin.
Metin2 Mini Map Quest Icon System
In Metin2 private servers, there are many visual systems developed to enhance the gaming experience. One of these is icons that show quest locations on the mini map. This system facilitates players' progress in their quests and provides more effective gameplay. However, in some private servers, this system may be missing or malfunctioning. In this article, we will examine in detail how to fix the Mini Map Quest Icon bug in a C++-based system.
Why Are Quest Icons Important?
Quests are one of the main mechanisms for character progression in Metin2. While completing quests, players must travel to specific locations on the map. Finding the quest-giving NPC or object can take time. Therefore, showing quest locations on the mini map is a user-friendly feature. If this feature is missing or not working, the player experience decreases significantly.
What Is the Source of the Problem?
Usually, this issue stems from incorrect processing of quest icons on the client side. In some private server systems, quest systems are configured differently. In such cases, the mini-map system cannot correctly read quest-giving NPCs or quest location data, resulting in the quest icon not appearing.
Fixing the Issue in C++ Source Code
To fix the mini map quest icon issue, you usually need to modify two files:
- Client/src/game/questmanager.cpp
- Client/src/ui/minimap.py
In these files, the data flow between the quest system and the mini map should be checked. Particularly, the QUEST_ICON_UPDATE function is responsible for updating quest icons. Ensure that this function is called correctly.
What Needs to Be Done
1. Establish a connection between the quest system and the mini map.
2. Obtain the coordinates of the quest-giving NPC correctly.
3. Send the icon type and location as a packet to the server.
4. Process the incoming data correctly on the client side and display it on screen.
UI Script Setup in Python
The mini map UI script file is usually located in the uiscript folder. This file determines where and how the quest icons appear. A special icon image should be defined for the quest icon and positioned according to its location. Additionally, the icon can be made clickable.
Testing and Verification
After making changes, testing must be performed. Start a new character, begin a quest, and check whether the quest appears correctly on the mini map. If there are errors, examine the log files and complete any missing connections.
Conclusion
The mini map quest icon system is a small but important feature that enhances user experience in Metin2 private servers. With C++ and Python-based fixes, this system can be made stable. Detailed analysis of such systems helps server developers create higher-quality content. For more systems and source codes, continue following Metin2Lobby.
