[C++ & PTYHON]Yerden Eğilerek Nesne Alma!

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
içinde bulunanlar :
kbPgMD.png



py dosyasını pyc yapma şeysini googleden bulabilirsiniz.
belki işinize yarar diye paylaşıyorum.

boş yorum atcaklar yorum dahi atmasın.

indir :
virüstotal :
Metin2 Yerden Eğilerek Nesne Alma Sistemi: C++ ve Python Kombinasyonu

Metin2 özel sunucularında oyun deneyimini artırmak için geliştirilen 'yerden eğilerek nesne alma' sistemi, oyuncuların harita üzerinde bulunan itemleri daha doğal ve etkileşimli bir şekilde almasını sağlar.

Bu yazıda, C++ ve Python tabanlı Metin2 sistemlerinde nasıl bu özelliği entegre edebileceğinizi detaylıca anlatacağız.

Sistem mimarisi, gerekli dosya düzenlemeleri ve GUI entegrasyonları gibi konulara değineceğiz.

Bu sistem özellikle PvP sunucularında ve özel olay sistemlerinde büyük avantaj sağlar.

1. Giriş: Yerden Eğilme ve Nesne Alma Nedir?

Oyuncuların harita üzerinde bir nesneye yaklaşarak belirli bir tuşa basması ya da 'eğilme' animasyonu ile nesneyi alması işlemidir. Bu sistem sayesinde;
- Oyuncu hareketi daha gerçekçi olur.
- Item alımı daha kontrollü ve oyun içi mekaniklere entegre edilir.
- PvP oyunlarında item alırken dikkat dağıtıcı etkiler oluşur.

2. Gerekli Geliştirme Ortamı ve Araçlar

Bu sistemi geliştirmek için şu bileşenlere ihtiyacınız olacak:
- Metin2 Client ve Game Server Kaynak Kodları
- C++ Bilgisi (Game Core)
- Python Bilgisi (UIScript / Root)
- PyGUI ve Uiscript Desteği
- Martysama veya benzeri geliştirici araçları

3. C++ Tarafında Geliştirme

C++ tarafında 'PickUp' komutu için bir event handler oluşturulmalıdır. Bu handler, oyuncunun 'eğilme' animasyonunu tetikleyecek ve ardından altındaki itemi kontrol edecektir.

Aşağıdaki adımlar izlenmelidir:
- game/src/char.cpp dosyasında OnClickNPC fonksiyonuna benzer bir yapı kurulur.
- Oyuncunun koordinatlarındaki item kontrolü yapılır.
- Eğer item varsa, oyuncuya eklenir ve haritadan silinir.

4. Python Tarafında UI Entegrasyonu

Python tarafında bir buton veya animasyon tetikleyicisi tanımlanabilir. Bu işlem için UIScript dosyalarında değişiklik yapılmalıdır. Örnek yapı:

root/game.py dosyasında bir fonksiyon tanımlanarak, klavye kısayolu ile 'pick up' komutu gönderilir.

uiscript/InventoryWindow.py dosyasına entegre edilebilir.

5. DB Tarafında Item Kaydı

Oyuncu item aldığında, bu işlem DB Core üzerinden loglanabilir. Bu sayede hile tespiti ve istatistik tutulması kolaylaşır.

DB Core üzerinde player_item_log tablosu kullanılabilir.

6. Test ve Hata Ayıklama

Her iki sistem birlikte test edilmeli. Özellikle animasyon senkronu ve item spawn zamanlaması önemlidir.

Martysama gibi araçlarla debug logları incelenmelidir.

7. Sonuç

Bu sistem, Metin2 özel sunucularında kullanıcı deneyimini ciddi anlamda artırır. C++ ve Python kombinasyonu ile hem stabil hem de esnek bir yapı oluşturulabilir.

Oyuncuların oyun içindeki etkileşimini artıran bu sistem, PvP sunucularında stratejik değer taşır.


Metin2 Pick Up Item by Bending Down System: C++ and Python Integration

The 'pick up item by bending down' system enhances the gaming experience on Metin2 private servers by allowing players to take items from the map in a more natural and interactive way.

In this article, we will explain in detail how you can integrate this feature into your C++ and Python-based Metin2 systems.

We will cover topics such as system architecture, necessary file modifications, and GUI integration.

This system provides significant advantages especially in PvP servers and custom event systems.

1. Introduction: What Is Bending Down and Picking Up Items?

This is the process where players approach an object on the map and press a specific key or perform a 'bend down' animation to collect the item. With this system;
- Player movement becomes more realistic.
- Item pickup becomes more controlled and integrated into gameplay mechanics.
- In PvP games, picking up items introduces distractions and tactical considerations.

2. Required Development Environment and Tools

To develop this system, you will need the following components:
- Metin2 Client and Game Server Source Codes
- Knowledge of C++ (Game Core)
- Knowledge of Python (UIScript / Root)
- PyGUI and Uiscript Support
- MartySama or similar developer tools

3. Development in C++ Side

An event handler for the 'PickUp' command must be created on the C++ side. This handler will trigger the player's 'bend down' animation and then check for items beneath them.

Follow these steps:
- Create a structure similar to OnClickNPC function in game/src/char.cpp.
- Check for items at the player's coordinates.
- If an item exists, add it to the player and remove it from the map.

4. UI Integration in Python Side

A button or animation trigger can be defined in Python. Modifications should be made in UIScript files. Example structure:

Define a function in root/game.py to send the 'pick up' command via keyboard shortcut.

Can be integrated into uiscript/InventoryWindow.py.

5. Item Logging in DB Side

When a player picks up an item, this action can be logged through the DB Core. This helps with cheat detection and statistics tracking.

The player_item_log table in the DB Core can be used.

6. Testing and Debugging

Both systems should be tested together. Especially, animation sync and item spawn timing are important.

Debug logs should be reviewed using tools like MartySama.

7. Conclusion

This system significantly enhances the user experience on Metin2 private servers. A stable and flexible structure can be built using a combination of C++ and Python.

This system increases player interaction within the game and holds strategic value in PvP servers.
 

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

Benzer konular

Geri
Üst Alt