Automatic Translation of Drop from mob_drop_item.txt and special_item_group.txt Files

  • Konbuyu başlatan Konbuyu başlatan Admin
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 0
  • Görüntüleme Görüntüleme 44

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Video:


Code:
Kod:
# Script by: Grzyb.ovh # The script automatically translates the drop from mob_drop_item.txt and special_item_group.txt files, utilizing the information in the locale_name.txt file import chardet import codecs def detect_encoding(filename):     with open(filename, 'rb') as f:         result = chardet.detect(f.read())     return result['encoding'] with codecs.open('item_names.txt', 'r', encoding='cp1250') as source_file:     contents = source_file.read() with codecs.open('item_names_utf8.txt', 'w', encoding='utf-8') as target_file:     target_file.write(contents) with open('item_names_utf8.txt', 'r', encoding='utf-8') as f:     item_names = {}     for line in f:         if 'VNUM' in line or 'LOCALE_NAME' in line:             continue         vnum, name = line.strip().split('\t')         item_names[vnum] = name drop_cpp_encoding = detect_encoding('drop.txt') with open('drop.txt', 'r', encoding=drop_cpp_encoding) as f:     lines = f.readlines() new_lines = [*] for line in lines:     if line.startswith('Group') or 'exp' in line:         new_lines.append(line)     else:         parts = line.split('\t')         if len(parts) > 2 and parts[2] in item_names:             line = line.rstrip() + ' // ' + item_names[parts[2]] + '\n'         new_lines.append(line) with open('drop2.txt', 'w', encoding='utf-8') as f:     f.writelines(new_lines) # Script by: Grzyb.ovh

Metin2 Sunucularında Otomatik Çeviri Sistemi: mob_drop_item.txt ve special_item_group.txt Dosyalarından Düşen Öğelerin Otomatik Çevrilmesi

Metin2 özel sunucularında geliştirme yaparken, birçok geliştirici item düşme oranları, özel gruplar ve dilerseniz bu dosyaların birden fazla dile çevrilmesi gibi konularla uğraşmaktadır. Bu yazıda, mob_drop_item.txt ve special_item_group.txt dosyalarındaki item isimlerinin otomatik olarak farklı dillere çevrilmesini sağlayacak bir yöntemden bahsedeceğiz.

mob_drop_item.txt ve special_item_group.txt Nedir?
mob_drop_item.txt dosyası, Metin2 oyununda belirli canavarların (mob) öldürüldüğünde düşürdüğü itemleri tanımlar. Bu dosya, drop sistemini doğrudan etkiler ve doğru yapılandırılması önemlidir.

special_item_group.txt ise, item gruplarını tanımlamak için kullanılır. Özellikle bazı özel drop sistemlerinde, item setlerinde veya ödüllerde bu dosya aktif rol oynar. Her iki dosya da Metin2 geliştiricileri için kritik öneme sahiptir.

Otomatik Çeviri Sistemi Nasıl Çalışır?
Bu sistem, item adlarının otomatik olarak başka dillere çevrilmesini sağlar. Örneğin, bir Metin2 sunucusu birden fazla ülkede hizmet veriyorsa, her ülkeye özel item isimlerini göstermek isteyebilirsiniz. Bu durumda, mob_drop_item.txt ve special_item_group.txt dosyalarında geçen item isimleri için bir çeviri tablosu oluşturulabilir.

Bu işlem genellikle Python veya C++ temelli bir script yardımıyla yapılır. Script, belirtilen dosyaları okur, item isimlerini tanımlar ve daha sonra bunları önceden tanımlanmış çeviri dosyalarıyla eşleştirerek otomatik çevirileri gerçekleştirir.

Python Tabanlı Bir Otomatik Çeviri Uygulaması
Python, Metin2 geliştirme sürecinde sıkça kullanılan bir araçtır. Özellikle GUI tabanlı uygulamalar (PyGUI) ile kolayca arayüzler oluşturulabilir. Bu tür bir sistemde, kullanıcı mob_drop_item.txt ve special_item_group.txt dosyalarını yükler, ardından bir JSON dosyası üzerinden çevrilecek olan terimleri belirler. Ardından script, tüm item isimlerini otomatik olarak belirlenen dile çevirir.

C++ ile Entegrasyon
Eğer sunucu tarafında çalışan bir sistem geliştiriyorsanız, C++ tabanlı bir çözüm daha avantajlı olabilir. Özellikle game core veya db core üzerinde yapılan değişikliklerde, item isimlerinin doğrudan veritabanından veya derleme sırasında otomatik çevrilmesi sağlanabilir. Bu tür sistemler, compile sırasında çalışacak şekilde ayarlanabilir.

Avantajları Nelerdir?
- Çoklu dil desteği sağlar.
- Manuel çeviri yapma zorunluluğunu ortadan kaldırır.
- Sunucu yöneticileri için iş yükünü azaltır.
- Hata payını minimize eder.

Sonuç
Metin2 özel sunucularında mob_drop_item.txt ve special_item_group.txt dosyalarının otomatik çevirisini sağlamak, hem geliştirici hem de oyuncu deneyimi açısından büyük kolaylıklar sağlar. Özellikle çok uluslu sunucular için bu tür çözümler, kalite ve kullanıcı memnuniyetini artırır.


Automatic Translation System for Metin2 Servers: Translating Dropped Items from mob_drop_item.txt and special_item_group.txt Files

When developing Metin2 private servers, many developers face challenges such as configuring drop rates, special groups, and translating these files into multiple languages. In this article, we will discuss a method to automatically translate item names from mob_drop_item.txt and special_item_group.txt files into different languages.

What Are mob_drop_item.txt and special_item_group.txt?
The mob_drop_item.txt file defines the items dropped by specific monsters (mobs) when killed in the Metin2 game. This file directly affects the drop system and must be configured correctly.

special_item_group.txt is used to define item groups. It plays an active role in special drop systems, item sets, or rewards. Both files are critical for Metin2 developers.

How Does the Automatic Translation System Work?
This system enables automatic translation of item names. For example, if a Metin2 server serves multiple countries, you might want to display item names in the local language for each region. In this case, a translation table can be created for item names found in mob_drop_item.txt and special_item_group.txt.

This process is usually handled with a script based on Python or C++. The script reads the specified files, identifies item names, and matches them against predefined translation files to perform automatic translations.

Python-Based Automatic Translation Application
Python is frequently used in Metin2 development. Especially with GUI-based applications (PyGUI), user-friendly interfaces can easily be built. In such a system, users upload mob_drop_item.txt and special_item_group.txt, then define terms to be translated via a JSON file. Then, the script automatically translates all item names into the desired language.

Integration with C++
If you're developing a server-side system, a C++ solution may be more beneficial. Especially when making changes to game core or db core, item names can be automatically translated directly from the database or during compilation. Such systems can be configured to run during the compile phase.

Benefits
- Provides multi-language support.
- Eliminates the need for manual translation.
- Reduces workload for server administrators.
- Minimizes human error.

Conclusion
Automatically translating mob_drop_item.txt and special_item_group.txt files in Metin2 private servers brings significant conveniences for both developers and players. Such solutions improve quality and user satisfaction, especially for multi-national servers.
 

Şuan Bu Konuyu Görüntüleyen Kullanıcılar (Toplam : 0, Üye : 0, Misafir : 0)

Benzer konular

Geri
Üst Alt