[C++] Attach specular

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

Admin

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


Here is a small tutorial (shit code, i was write for one guy) if you want to attach a high specular just for some npc's/mob's.

Kod:
//@Source/Client/UserInterface/Locale_inc.h #define WJ_ATTACH_SPECULAR_FROM_LIST //@Source/Client/UserInterface/InstanceBase.cpp //1.) Search for:     m_GraphicThingInstance.SetBattleHitEffect(ms_adwCRCAffectEffect[EFFECT_HIT]); //2.) Add after: #ifdef WJ_ATTACH_SPECULAR_FROM_LIST     struct SAttachSpecularData     {         DWORD race; float specularPower;     };     const int SPECULAR_MAX_NUM = 6;     static SAttachSpecularData structInfo[SPECULAR_MAX_NUM] =     {         { 2493,        0.2f },         { 1191,        0.1f },         { 3091,        0.1f },         { 9003,        0.1f },         { 20092,    0.1f },         { 1095,        0.1f }      };     for (DWORD i=0; i<SPECULAR_MAX_NUM; i++)     {         if (GetRace() == structInfo[i].race)         {             SMaterialData data;             data.pImage = NULL;             data.isSpecularEnable = TRUE;             data.fSpecularPower = structInfo[i].specularPower;             data.bSphereMapIndex = 1;             m_GraphicThingInstance.SetMaterialData(0, NULL, data);         }     } #endif

Link pastebin:
C++ ile Metin2 Oyun Sunucusunda Attach Specular Efekti Sistemi

Metin2 özel sunucu geliştirme sürecinde, görsel efektlerin artırılması ve kullanıcı deneyiminin zenginleştirilmesi büyük önem taşır. Bu bağlamda Attach Specular sistemi, karakterlerin veya objelerin belirli durumlarda özel parlaklık efektleriyle donatılması için kullanılır. Bu sistem özellikle PvP sistemlerinde güçlü karakterlerin vuruş anında ya da özel yetenekler kullanıldığında dikkat çekici efektler göstermek için idealdir. Bu yazıda, C++ dilinde yazılmış bir Attach Specular sisteminin nasıl geliştirileceği ve Metin2 özel sunuculara nasıl entegre edileceği detaylı olarak ele alınacaktır.

Specular Efekti Nedir?

Specular efekti, 3D modellemede ve oyun motorlarında nesnelerin ışıkla temas halindeyken yansıttığı parıltıyı simüle eden bir tekniktir. Bu efekt sayesinde silahlar, zırhlar veya karakterler üzerinde gerçekçi parıltılar oluşturulabilir. Metin2 özel sunucularda bu efekti eklemek, oyuncuların ilgisini çekebilir ve oyun içi atmosferi daha dinamik hale getirebilir.

C++ ile Attach Specular Geliştirimi

Öncelikle, specular efektini karaktere ya da objeye dinamik olarak bağlamak için bir fonksiyon yazmak gerekir. Bu işlem genellikle game server tarafında yapılır. C++ dilinde yazılmış bir sistemde bu fonksiyonlar, karakterin mevcut visual verilerine müdahale ederek efekti ekler.

Örnek bir attach_specular fonksiyonu şu şekilde tanımlanabilir:

Kod:
[B]void[/B] attach_specular([B]int[/B] player_id, [B]const char*[/B] effect_path, [B]float[/B] intensity);


Bu fonksiyon, belirtilen oyuncuya özel bir efekt dosyası atar ve belirlenen yoğunlukta efekt çalıştırır. effect_path parametresi, efekt dosyasının client tarafında bulunduğu konumu belirtmelidir. intensity ise efekt parlaklığını kontrol eder.

Entegrasyon ve Kullanım Örnekleri

Bu sistem, örneğin bir oyuncu özel bir skill kullandığında aktif edilebilir. Skill.cpp dosyasında bir kontrol bloğu oluşturularak, belirli yeteneklerin kullanımında attach_specular çağrısı yapılabilir.

Ayrıca, PvP sistemlerinde güçlü eşyalar giyildiğinde veya özel bir statü kazanıldığında da bu efekt devreye sokulabilir. Bu sayede oyun içindeki güçlü oyuncular kolayca tanınabilir ve atmosfer daha rekabetçi hale gelir.

Python ve Client Taraflı Entegrasyon

Bazı durumlarda, efektin istemci tarafında kontrol edilmesi gerekebilir. Bu gibi durumlarda Python tabanlı UI scriptleri ile efektin başlatılması sağlanabilir. UIScript içinde efekt komutları tanımlanarak, PyRoot üzerinden bu efektler tetiklenebilir.

Sonuç

C++ ile yazılmış bir Attach Specular sistemi, Metin2 özel sunucularında görsel zenginlik katarken aynı zamanda kullanıcı deneyimini de olumlu yönde etkiler. Doğru entegrasyon ile bu sistem, güçlü PvP sistemleri ve özel olaylar için ideal bir araç haline gelebilir. Geliştiriciler, bu sistemi özelleştirerek kendi sunucularında benzersiz efektler yaratabilir.


C++ Attach Specular Effect System for Metin2 Game Servers

In the process of developing Metin2 private servers, enhancing visual effects and enriching user experience are of great importance. In this context, the Attach Specular system is used to equip characters or objects with special brightness effects under certain conditions. This system is particularly ideal for PvP systems, allowing visually striking effects during powerful character attacks or when special abilities are used. This article will detail how to develop an Attach Specular system written in C++ and integrate it into Metin2 private servers.

What Is a Specular Effect?

Specular effects simulate the shine that objects reflect when illuminated in 3D modeling and game engines. With this effect, realistic reflections can be created on weapons, armor, or characters. Adding such effects to Metin2 private servers can capture players' attention and make the in-game atmosphere more dynamic.

Developing Attach Specular with C++

Firstly, to dynamically attach a specular effect to a character or object, a function must be written. This operation is typically performed on the game server side. In a C++-based system, these functions modify the character's current visual data to add the effect.

An example attach_specular function might look like this:

Kod:
[B]void[/B] attach_specular([B]int[/B] player_id, [B]const char*[/B] effect_path, [B]float[/B] intensity);


This function assigns a specific effect file to the given player and runs the effect at the specified intensity. The effect_path parameter should indicate the location of the effect file on the client side. intensity controls the brightness level of the effect.

Integration and Usage Examples

This system can be activated when a player uses a special skill. By creating a control block in the Skill.cpp file, the attach_specular call can be triggered upon using certain skills.

Additionally, when powerful items are equipped in PvP systems or special status is gained, this effect can also be triggered. This makes strong players easily recognizable within the game and creates a more competitive atmosphere.

Python and Client-Side Integration

In some cases, the effect may need to be controlled from the client side. In such scenarios, Python-based UI scripts can trigger the effect. By defining effect commands within UIScript, these effects can be activated via PyRoot.

Conclusion

A C++-based Attach Specular system enhances visual richness in Metin2 private servers while positively impacting user experience. With proper integration, this system can serve as an ideal tool for robust PvP systems and special events. Developers can customize this system to create unique effects on their own servers.
 

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

Benzer konular

Geri
Üst Alt