Serbeste Alma Engeli Mapler vs.[C++]

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Cmd_general.cpp aratılır:
Kod:
ACMD(do_pkmode)
if'lerin içine eklenir;
Kod:
if (!ch->IsGM() && ch->GetMapIndex() == 41)    {         ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Yalnizca GameMaster'lar serbest moduna alabilirler!"));         return;     }
*Map Engellemek İsteyenler getmapindex ayarlasın Gm'ninde serbeste almasını istemeyenler IsGM yi silsinler
Kanıt:

YJN7g6.jpg

Serbeste Alma Engeli Mapler vs. [C++] ile Uygulamalar


Metin2 özel sunucularında geliştirme yaparken, serbeste alma engeli gibi sistemler birçok geliştirici tarafından aranan ve özelleştirilmek istenen özelliklerden biridir. Özellikle PvP odaklı sunucularda, oyuncuların belirli alanlarda özel eşyaları alamaması ya da bazı itemleri güvenli tutması oldukça stratejik bir öneme sahiptir. Bu yazıda, Serbeste Alma Engeli sistemini C++ tabanlı bir yaklaşımla nasıl entegre edebileceğimizi ve harita bazında nasıl kontrol edebileceğimizi ele alacağız.

Serbeste Alma Engeli Nedir?
Serbeste Alma Engeli, oyuncuların belirli alanlarda belirli itemleri alamamasını sağlayan bir sistemdir. Bu sistem genellikle PvP bölgelerinde veya belirli harita sınırlarında aktif edilir. Örneğin, bir oyuncu bir itemi yere attığında, karşı tarafın bunu almasını engelleyebilirsiniz. Bu sayede PvP esnasında item çalma gibi aksiyonlar engellenmiş olur.

C++ ile Serbeste Alma Engeli Sistemi Nasıl Çalışır?
Metin2 özel sunucularında, serbeste alma engeli sistemi genellikle game core üzerinde çalışır. Oyunun çekirdeğinde bulunan C++ kaynak kodları üzerinde değişiklikler yapılarak bu sistem aktif edilebilir. Öncelikle, bir harita listesi tanımlanır ve her harita için bu özelliğin açık ya da kapalı olup olmadığı belirlenir. Bu işlem için genellikle bir config dosyası ya da doğrudan source kodda bir kontrol bloğu oluşturulur.

Örnek Kod Yapısı:
Oyun içinde bir oyuncu bir itemi almayı denediğinde, önce hangi haritada olduğunu kontrol eden bir fonksiyon çağırılır. Eğer bulunduğu harita, serbeste alma engeli olan haritalar listesinde yer alıyorsa, item alma işlemi iptal edilir. Bu kontrol genellikle ItemPickUpEvent veya benzeri bir event üzerinden yapılır.

Harita Bazlı Kontrol Nasıl Gerçekleştirilir?
Harita bazlı kontrol için, öncelikle bir map_id listesi tanımlanır. Bu listede, serbeste alma engeli olan tüm haritalar yer alır. Örneğin, map_index değeri 1, 2, 3 gibi değerler atanabilir. Bu değerler üzerinden, belirli haritalarda item alımının engellenmesi sağlanır.

Engellenen Haritalar Listesi:
Göllü Vadisi – map_index: 1
Yılan Vadisi – map_index: 2
Sura Kale – map_index: 3

C++ Kaynak Kodlarında Uygulama Adımları
1. src/game/src/item_manager.cpp dosyası üzerinde PickUpItem fonksiyonu düzenlenir.
2. GetCurrentMapIndex() fonksiyonu ile mevcut harita kontrol edilir.
3. Harita, belirlenen engelli harita listesinde varsa, işlem iptal edilir.
4. Aksi halde, normal akış devam ettirilir.

Python GUI ile Yapılandırma
Metin2 özel sunucularında yapılandırmalar için sıklıkla Python GUI araçları kullanılır. Bu sistemle, harita ayarlarını kolayca yönetebilirsiniz. Py Root dosyaları üzerinde bir arayüz hazırlanarak, harita ID’leri dinamik olarak değiştirilebilir. Bu sayede, her seferinde derleme işlemi yapmadan sistem ayarları yapılabilir.

Avantajları
- Oyuncuların stratejik düşünmesini sağlar.
- PvP sırasında item çalma gibi sorunları önler.
- Sunucu sahiplerine büyük esneklik sunar.
- Geliştiriciler için özelleştirilebilir yapı sunar.

Sonuç
Serbeste alma engeli sistemi, Metin2 özel sunucularında stratejik bir avantaj sunar. C++ tabanlı geliştirme ile bu sistem, güçlü ve optimize bir şekilde uygulanabilir. Harita bazlı kontrol sayesinde sunucu yöneticileri, PvP ve PvE dengesini daha iyi sağlayabilir. Bu sistem, hem oyun içi deneyimi artırır hem de sunucu güvenliğini destekler. Dilerseniz bu sistemi kendi sunucunuza entegre ederken size yardımcı olabilecek örnek source edit dosyaları veya uiscript örnekleri sunabiliriz.


No-Pickup Zones on Maps vs. [C++] Implementations


When developing private Metin2 servers, features like No-Pickup Zones are highly sought after by many developers. Especially in PvP-oriented servers, preventing players from picking up certain items in specific areas or keeping certain items safe can be strategically important. In this article, we will explore how to implement a No-Pickup system using a C++ approach and how to manage it per map basis.

What Is a No-Pickup Zone?
A No-Pickup Zone prevents players from taking specific items in certain areas. This system is typically activated in PvP zones or specific map boundaries. For instance, when a player drops an item, others may be blocked from picking it up. This prevents item theft during PvP battles.

How Does the No-Pickup System Work with C++?
On Metin2 private servers, the No-Pickup system usually runs within the game core. Modifications to the C++ source code allow this feature to be enabled. First, a list of maps is defined, specifying whether this feature is active for each map. This is typically done via a config file or directly in the source code as a control block.

Sample Code Structure:
When a player attempts to pick up an item, a function checks which map they are on. If the map is included in the No-Pickup list, the action is canceled. This check usually occurs through an event like ItemPickUpEvent.

How to Perform Map-Based Control?
For map-based control, a map_id list is created. This list includes all maps where pickup is restricted. For example, map_index values such as 1, 2, 3 can be assigned. Based on these values, item pickups are blocked in designated maps.

Blocked Maps List:
Swamp Valley – map_index: 1
Snake Valley – map_index: 2
Sura Castle – map_index: 3

Steps for Implementation in C++ Source Code
1. Modify the PickUpItem function in src/game/src/item_manager.cpp.
2. Use GetCurrentMapIndex() to check the current map.
3. If the map exists in the restricted list, cancel the action.
4. Otherwise, continue the normal flow.

Configuration with Python GUI
In Metin2 private servers, Python GUI tools are frequently used for configuration. With this system, you can easily manage map settings. By creating an interface in Py Root files, map IDs can be dynamically adjusted without recompiling each time.

Benefits
- Encourages strategic thinking among players.
- Prevents item stealing during PvP.
- Offers great flexibility to server owners.
- Provides customizable structure for developers.

Conclusion
The No-Pickup system provides a strategic advantage in Metin2 private servers. Implemented with C++-based development, this system can be robust and optimized. Map-based control allows server administrators to better balance PvP and PvE. This system enhances in-game experience while supporting server security. We can also provide example source edit files or uiscript examples to assist you in integrating this system into your own server.
 

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

Geri
Üst Alt