Artık hareket ederken item değişicek.
char_item.cpp te aratıyoruz
Değiştirilir ;
İyi Forumlar.
+REP VERİRSENİZ SEVİNİRİM.
Metin2 özel sunucularında geliştirme yaparken, oyuncuların hareket ederken eşya değiştirmesi gibi dinamik sistemler oluşturmak oldukça ilginç ve faydalı olabilir. Bu tarz sistemler, oyuncu deneyimini artırır ve PVP sistemlerinde avantaj sağlayabilir. Bugün hareket ederken item değiştirme işlemi için C++ tabanlı bir sistem geliştireceğiz. Bu sistem sayesinde oyuncular yürüdüğü anda elindeki silahı veya diğer eşyaları hızlıca değiştirebilir. Bu yazıda bu sistemi nasıl kuracağınızı adım adım anlatacağız.
Öncelikle Metin2 Sunucu Yapısı Hakkında
Metin2 özel sunucularında oyun içi sistemler genellikle C++ ile geliştirilir. Oyun motoru, istemci tarafı ve sunucu tarafı ayrı ayrı çalışır. Bu nedenle hem game server hem de client tarafında değişiklikler yapılması gerekebilir. Biz burada sunucu tarafında bir event oluşturarak hareket sırasında eşya değişimi sağlanmasını sağlayacağız.
Sistem Mimarisi
Bu sistemde amaç, oyuncu bir hareket komutu gönderdiğinde, belirli bir eşya seti veya item slotu kontrol edilerek otomatik olarak başka bir itemin giydirilmesidir. Örneğin, oyuncu koşarken bir silahı hızlıca diğerine geçirebilir. Bu, özellikle PvP sistemlerinde büyük bir avantaj sağlar.
Geliştirme Ortamı ve Gereksinimler
Adım Adım Uygulama
1. Oyuncu Hareket Event'i Oluşturmak: Oyuncu bir yön tuşuna bastığında character_state.cpp dosyasında bir event tetiklenir. Buraya bir kontrol ekleyeceğiz.
2. Item Slot Kontrolü: Oyuncunun belirli slotlarda belirli itemlerin varlığını kontrol edeceğiz. Eğer belirli bir item varsa, onu giydirme komutunu çalıştıracağız.
3. Silah Değiştirme Komutu: Bu işlem için item_manager.cpp dosyasında bir fonksiyon yazacağız. Bu fonksiyon, belirli bir itemi giydirir veya silah slotunda olan eski eşyayı çıkarır.
Kod Örneği (C++)
Sunucu Tarafında Ayarlar
Bu işlemi yapabilmek için game/src/char.cpp dosyasında OnMove fonksiyonuna müdahale etmeniz gerekir. Bu fonksiyon her hareket sırasında çalışır. Burada bir if kontrolüyle oyuncunun belirli bir eşyaya sahip olup olmadığını kontrol edip, gerekli aksiyonu alabilirsiniz.
Client Tarafı İle Entegrasyon
İstemci tarafında da bazı ayarlar yapılmalıdır. Özellikle uiscript dosyalarında py root üzerinde hareket sırasında eşya değişimi animasyonu senkronize edilmelidir. Bu, hem görsel hem de fonksiyonel olarak sistemin doğru çalışması için önemlidir.
Sonuç
Bu sistem sayesinde Metin2 özel sunucularında oyuncuların daha akıcı ve dinamik bir oyun deneyimi yaşaması sağlanabilir. Özellikle PvP sistemlerinde bu gibi gelişmiş mekanikler oyuncuların dikkatini çekebilir. Geliştirme sürecinde Martysama, DB Core ve Source Edit gibi araçlardan faydalanabilirsiniz.
Kaynak Kod Paylaşımı
Tüm bu işlemleri gerçekleştirdikten sonra src dosyalarınıza özel olarak oluşturduğunuz bu sistemleri Metin2Lobby üzerinden paylaşabilirsiniz. Diğer geliştiricilerle bilgi alışverişi yaparak sistemleri daha da geliştirebilirsiniz.
While developing custom Metin2 servers, creating dynamic systems such as changing items while walking can be quite interesting and beneficial. Such systems enhance the player experience and can provide advantages in PVP systems. Today, we will develop a C++ based system for changing items during movement. This system allows players to quickly switch their weapons or other items while moving. In this article, we will explain step-by-step how to implement this system.
About Metin2 Server Structure
In Metin2 custom servers, in-game systems are generally developed with C++. The game engine, client side, and server side operate separately. Therefore, modifications may need to be made on both the game server and client sides. Here, we will create an event on the server side to enable automatic item switching during movement.
System Architecture
The goal of this system is to check specific item sets or slots when a player sends a movement command and automatically equip another item. For example, while running, a player can quickly switch between different weapons. This provides a significant advantage, especially in PvP systems.
Development Environment and Requirements
Step-by-Step Implementation
1. Create Player Movement Event: When the player presses a direction key, an event triggers in character_state.cpp. We will add a check here.
2. Item Slot Check: We will check whether specific items exist in certain slots of the player. If a particular item exists, we will execute the command to equip it.
3. Weapon Switch Command: For this operation, we will write a function in item_manager.cpp that equips a specific item or unequips the current one from the weapon slot.
Code Example (C++)
Server-Side Settings
To perform this action, you need to modify the OnMove function in game/src/char.cpp. This function runs every time the player moves. Here, an if condition can be used to check if the player has a specific item and take necessary actions accordingly.
Integration with Client Side
Certain settings must also be adjusted on the client side. Specifically, the movement animation should be synchronized with item changes during movement in uiscript files under py root. This is important for both visual and functional correctness of the system.
Conclusion
This system allows players in custom Metin2 servers to have a more fluid and dynamic gaming experience. Such advanced mechanics can attract attention in PvP systems. During the development process, tools like Martysama, DB Core, and Source Edit can be helpful.
Source Code Sharing
After implementing these processes, you can share your custom systems created in your src files on Metin2Lobby. You can further improve these systems by exchanging knowledge with other developers.
char_item.cpp te aratıyoruz
Kod:
arat: if (iWearCell != WEAR_ARROW && (dwCurTime - GetLastAttackTime() <= 1500 || dwCurTime - m_dwLastSkillTime <= 1500)) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ê°ââ¬ë§şââ¬â¢ížËâ⬠ìžËâ⬠ìââ¬Å¾ ëâ⬢şââ¬â¢ë§şââ¬â¢ ì°©ìş¡©íâ⬢* ìËâ⬠ËÅâ ìžËââ¬ ìş µëâ⬹Ëâ⬠ëâ⬹¤.")); return false; }
Değiştirilir ;
Kod:
[B]/*if (iWearCell != WEAR_ARROW && (dwCurTime - GetLastAttackTime() <= 1500 || dwCurTime - m_dwLastSkillTime <= 1500))[/B] [B] {[/B] [B] ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ê°ââ¬ë§şââ¬â¢ížËâ⬠ìžËâ⬠ìââ¬Å¾ ëâ⬢şââ¬â¢ë§şââ¬â¢ ì°©ìş¡©íâ⬢* ìËâ⬠˺ââ¬Å ìžËââ¬ ìş µëâ⬹Ëâ⬠ëâ⬹¤."));[/B] [B] return false;[/B] [B] }*/[/B]
İyi Forumlar.
+REP VERİRSENİZ SEVİNİRİM.
Metin2 Hareket Ederken İtem Değiştirmek Foruma Özel [C++]
Metin2 özel sunucularında geliştirme yaparken, oyuncuların hareket ederken eşya değiştirmesi gibi dinamik sistemler oluşturmak oldukça ilginç ve faydalı olabilir. Bu tarz sistemler, oyuncu deneyimini artırır ve PVP sistemlerinde avantaj sağlayabilir. Bugün hareket ederken item değiştirme işlemi için C++ tabanlı bir sistem geliştireceğiz. Bu sistem sayesinde oyuncular yürüdüğü anda elindeki silahı veya diğer eşyaları hızlıca değiştirebilir. Bu yazıda bu sistemi nasıl kuracağınızı adım adım anlatacağız.
Öncelikle Metin2 Sunucu Yapısı Hakkında
Metin2 özel sunucularında oyun içi sistemler genellikle C++ ile geliştirilir. Oyun motoru, istemci tarafı ve sunucu tarafı ayrı ayrı çalışır. Bu nedenle hem game server hem de client tarafında değişiklikler yapılması gerekebilir. Biz burada sunucu tarafında bir event oluşturarak hareket sırasında eşya değişimi sağlanmasını sağlayacağız.
Sistem Mimarisi
Bu sistemde amaç, oyuncu bir hareket komutu gönderdiğinde, belirli bir eşya seti veya item slotu kontrol edilerek otomatik olarak başka bir itemin giydirilmesidir. Örneğin, oyuncu koşarken bir silahı hızlıca diğerine geçirebilir. Bu, özellikle PvP sistemlerinde büyük bir avantaj sağlar.
Geliştirme Ortamı ve Gereksinimler
- Metin2 Server SRC (Game/Auth)
- C++ Bilgisi
- Python (GUI ve bazı işlemler için)
- Martysama Editör
- Client SRC (Opsiyonel)
Adım Adım Uygulama
1. Oyuncu Hareket Event'i Oluşturmak: Oyuncu bir yön tuşuna bastığında character_state.cpp dosyasında bir event tetiklenir. Buraya bir kontrol ekleyeceğiz.
2. Item Slot Kontrolü: Oyuncunun belirli slotlarda belirli itemlerin varlığını kontrol edeceğiz. Eğer belirli bir item varsa, onu giydirme komutunu çalıştıracağız.
3. Silah Değiştirme Komutu: Bu işlem için item_manager.cpp dosyasında bir fonksiyon yazacağız. Bu fonksiyon, belirli bir itemi giydirir veya silah slotunda olan eski eşyayı çıkarır.
Kod Örneği (C++)
Kod:
void CHARACTER::OnMove(const TPixelPosition & pos, float move_yaw, int iDuration) { [BR][/BR] if (IsMoving()) { [BR][/BR] DWORD weapon_vnum = GetWear(WEAR_WEAPON);[BR][/BR] if (weapon_vnum == 12345) { // Belirli bir silah numarası[BR][/BR] // Yeni silahı giydir[BR][/BR] EquipItemBySlot(WEAR_WEAPON, 12346);[BR][/BR] }[BR][/BR] }[BR][/BR]}
Sunucu Tarafında Ayarlar
Bu işlemi yapabilmek için game/src/char.cpp dosyasında OnMove fonksiyonuna müdahale etmeniz gerekir. Bu fonksiyon her hareket sırasında çalışır. Burada bir if kontrolüyle oyuncunun belirli bir eşyaya sahip olup olmadığını kontrol edip, gerekli aksiyonu alabilirsiniz.
Client Tarafı İle Entegrasyon
İstemci tarafında da bazı ayarlar yapılmalıdır. Özellikle uiscript dosyalarında py root üzerinde hareket sırasında eşya değişimi animasyonu senkronize edilmelidir. Bu, hem görsel hem de fonksiyonel olarak sistemin doğru çalışması için önemlidir.
Sonuç
Bu sistem sayesinde Metin2 özel sunucularında oyuncuların daha akıcı ve dinamik bir oyun deneyimi yaşaması sağlanabilir. Özellikle PvP sistemlerinde bu gibi gelişmiş mekanikler oyuncuların dikkatini çekebilir. Geliştirme sürecinde Martysama, DB Core ve Source Edit gibi araçlardan faydalanabilirsiniz.
Kaynak Kod Paylaşımı
Tüm bu işlemleri gerçekleştirdikten sonra src dosyalarınıza özel olarak oluşturduğunuz bu sistemleri Metin2Lobby üzerinden paylaşabilirsiniz. Diğer geliştiricilerle bilgi alışverişi yaparak sistemleri daha da geliştirebilirsiniz.
Metin2 Change Item While Moving - Forum Exclusive [C++]
While developing custom Metin2 servers, creating dynamic systems such as changing items while walking can be quite interesting and beneficial. Such systems enhance the player experience and can provide advantages in PVP systems. Today, we will develop a C++ based system for changing items during movement. This system allows players to quickly switch their weapons or other items while moving. In this article, we will explain step-by-step how to implement this system.
About Metin2 Server Structure
In Metin2 custom servers, in-game systems are generally developed with C++. The game engine, client side, and server side operate separately. Therefore, modifications may need to be made on both the game server and client sides. Here, we will create an event on the server side to enable automatic item switching during movement.
System Architecture
The goal of this system is to check specific item sets or slots when a player sends a movement command and automatically equip another item. For example, while running, a player can quickly switch between different weapons. This provides a significant advantage, especially in PvP systems.
Development Environment and Requirements
- Metin2 Server SRC (Game/Auth)
- C++ Knowledge
- Python (for GUI and certain operations)
- Martysama Editor
- Client SRC (Optional)
Step-by-Step Implementation
1. Create Player Movement Event: When the player presses a direction key, an event triggers in character_state.cpp. We will add a check here.
2. Item Slot Check: We will check whether specific items exist in certain slots of the player. If a particular item exists, we will execute the command to equip it.
3. Weapon Switch Command: For this operation, we will write a function in item_manager.cpp that equips a specific item or unequips the current one from the weapon slot.
Code Example (C++)
Kod:
void CHARACTER::OnMove(const TPixelPosition & pos, float move_yaw, int iDuration) { [BR][/BR] if (IsMoving()) { [BR][/BR] DWORD weapon_vnum = GetWear(WEAR_WEAPON);[BR][/BR] if (weapon_vnum == 12345) { // Specific weapon number[BR][/BR] // Equip new weapon[BR][/BR] EquipItemBySlot(WEAR_WEAPON, 12346);[BR][/BR] }[BR][/BR] }[BR][/BR]}
Server-Side Settings
To perform this action, you need to modify the OnMove function in game/src/char.cpp. This function runs every time the player moves. Here, an if condition can be used to check if the player has a specific item and take necessary actions accordingly.
Integration with Client Side
Certain settings must also be adjusted on the client side. Specifically, the movement animation should be synchronized with item changes during movement in uiscript files under py root. This is important for both visual and functional correctness of the system.
Conclusion
This system allows players in custom Metin2 servers to have a more fluid and dynamic gaming experience. Such advanced mechanics can attract attention in PvP systems. During the development process, tools like Martysama, DB Core, and Source Edit can be helpful.
Source Code Sharing
After implementing these processes, you can share your custom systems created in your src files on Metin2Lobby. You can further improve these systems by exchanging knowledge with other developers.
