[Nasıl Yapılır?] Pet-Seviye diğer renkte (MaviAy)

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

Admin

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



  • <li data-xf-list-type="ul">Açık InstanceBaseEffect.cpp (Client-Kaynak, UserInterface) <li data-xf-list-type="ul">AramakKodu:
    Statik D3DXCOLOR s_kLevelColor = D3DXCOLOR ( 152.0f / 255.0f , 255.0f / 255.0f , 51.0f / 255.0f , 1.0f );
    <li data-xf-list-type="ul">İle değiştirinKodu:
    statik D3DXCOLOR s_kLevelColor ;
    if ( IsPC () || IsEnemy () || IsStone () || IsPoly ()) {
    s_kLevelColor = D3DXCOLOR ( 152.0f / 255.0f , 255.0f / 255.0f , 51.0f / 255.0f , 1.0f );
    }
    else {
    s_kLevelColor = D3DXCOLOR ( 225.0f / 255.0f , 255.0f / 255.0f , 0.0f / 255.0f , 1.0f );
    }

Pet-Seviye Diğer Renkte (MaviAy) Nasıl Yapılır? - Metin2 Lobby

Metin2 özel sunucularında geliştirme yaparken bazı estetik ve fonksiyonel değişiklikler yapmak, oyuncu deneyimini ciddi anlamda artırabilir. Bu rehberde, Pet-Seviye sisteminde karakter seviyesine göre değişen bir renk sistemi eklemeyi öğreneceksiniz. Bu rehber özellikle MaviAy temalı bir renk sistemiyle ilgilidir. Metin2 Lobby olarak bizler, Metin2 özel sunucu geliştirme konusunda size rehberlik etmeye devam ediyoruz.

Gerekli Dosyalar ve Hazırlık
Öncelikle, uiscript dosyaları üzerinde çalışacağımız için root klasörünüze erişiminiz olması gerekir. Ayrıca, Python tabanlı GUI düzenlemeleri yapacağımız için py root dosyalarınızın yedeğini almanız önemlidir. Bu işlem sırasında Martysama tarafından geliştirilen araçlar da işinize yarayabilir.

Adım 1: Pet Arayüzü Dosyasını Belirleyin
Genellikle petwnd.py gibi bir isim altında bulunan arayüz dosyasını açın. Bu dosya, pet penceresinin çizildiği ve seviye bilgilerinin gösterildiği yerdir. Bu dosya genellikle root dizini altında yer alır.

Adım 2: Seviye Değerine Göre Renk Ataması
Python tarafında bir fonksiyon tanımlamalısınız. Örneğin:

def get_pet_level_color(level):
if level < 10:
return 'gray'
elif level < 20:
return '#54acd2' # MaviAy tonu
elif level < 30:
return 'green'
else:
return 'gold'


Adım 3: Arayüze Entegre Etme
Pet penceresindeki seviye yazısının rengini değiştirmek için, SetTextHorizontalAlignCenter, SetPackedFontColor gibi fonksiyonları kullanarak elde ettiğiniz rengi uygulamanız gerekir. Bu işlem sırasında uiscript yapısı dikkate alınmalıdır.

Not: game core veya db core üzerinde değişiklik yapmadan sadece istemci tarafında yapılan bu değişiklik, sadece oynayan kullanıcıya yansır. Gerçek zamanlı veri için sunucu tarafında da entegrasyon gerekebilir.

Adım 4: Test ve Uygulama[/BR]Dosyaları sunucunuza yükledikten sonra, pet seviyenizi yükselttikçe otomatik olarak rengin değiştiğini göreceksiniz. Bu sayede hem estetik hem de bilgilendirici bir sistem oluşturmuş olursunuz.

Bonus: Sunucu Tarafında Geliştirme
Eğer bu rengi sunucu tarafından belirlenmiş dinamik bir sistem haline getirmek isterseniz, C++ tabanlı server src üzerinde de küçük değişiklikler yapabilirsiniz. Bu durumda, seviye bilgisi ile birlikte renk bilgisi de game server tarafından istemciye aktarılır.

Sonuç
Bu rehber sayesinde, Metin2 özel sunucularınızda Pet-Seviye sistemine dinamik renk entegrasyonu gerçekleştirebilirsiniz. MaviAy temalı bu yaklaşım, kullanıcı deneyimini artırmak ve sunucunuzu diğerlerinden ayırt etmek için harika bir özelliktir. Daha fazla script ve sistem geliştirmek için Metin2 Lobby üzerinden bize ulaşabilirsiniz.


How To: Pet-Level Different Color (MaviAy) - Metin2 Lobby

When developing custom Metin2 servers, making aesthetic and functional changes can significantly enhance the player experience. In this guide, you will learn how to add a color-changing system based on pet level within the Pet-Level system. This tutorial focuses specifically on a color system themed around MaviAy. As Metin2 Lobby, we continue to assist you in Metin2 private server development.

Required Files and Preparation
Firstly, since we will be working with uiscript files, you need access to your root folder. Additionally, since we will perform GUI modifications based on Python, backing up your py root files is important. Tools developed by Martysama may also be useful during this process.

Step 1: Locate the Pet Interface File
Open the interface file, typically named something like petwnd.py. This file draws the pet window and displays the level information. It is usually located under the root directory.

Step 2: Assign Colors Based on Level
Define a function in Python such as:

def get_pet_level_color(level):
if level < 10:
return 'gray'
elif level < 20:
return '#54acd2' # MaviAy tone
elif level < 30:
return 'green'
else:
return 'gold'


Step 3: Integrate into the Interface
To change the color of the level text in the pet window, use functions like SetTextHorizontalAlignCenter and SetPackedFontColor to apply the color you obtained. During this process, the structure of uiscript must be considered.

Note: Since this change is made only on the client-side without altering game core or db core, the effect will only be visible to the player. For real-time data, integration on the server-side might be required.

Step 4: Testing and Application
After uploading the files to your server, you will notice that the color changes automatically as you level up your pet. This creates both an aesthetic and informative system.

Bonus: Server-Side Development
If you wish to turn this color system into a dynamic one determined by the server, you can make minor changes to the C++-based server src. In this case, the color information will be sent to the client along with the level data from the game server.

Conclusion
With this guide, you can integrate dynamic color into the Pet-Level system on your Metin2 private servers. This MaviAy-themed approach is an excellent feature for enhancing user experience and distinguishing your server from others. For more scripts and system developments, feel free to reach out to us at Metin2 Lobby.
 

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

Benzer konular

Geri
Üst Alt