//
Metin2 Lobby'de Yeni Yang Düşme Sesi Sistemi
Metin2 özel sunucularında kullanıcı deneyimini artırmak ve sunucu sahiplerine daha fazla özelleştirme imkanı sunmak amacıyla Yeni Yang Düşme Sesi sistemi geliştirildi. Bu sistem sayesinde oyuncular yang kazandıklarında özel bir ses duyabilir. Bu da hem sunucu atmosferini geliştirir hem de oyuncuların kazançlarını daha belirgin hissetmelerini sağlar. Bu yazıda C++[/COORD] tabanlı bir sistem üzerinden bu özelliği nasıl entegre edebileceğinizden bahsedeceğiz.
Sistem Nedir?
Yang düşme sesi sistemi, oyuncuların oyun içi işlemlerinden biri olan 'yang düşmesi' sırasında belirlenen özel bir ses dosyasının çalınmasını sağlar. Bu işlem, sunucu tarafında game modülünde tanımlanan event sistemleri ile gerçekleştirilir. Yang miktarı belli bir eşiği geçtiğinde bu ses çalmaya başlar. Bu sayede büyük yang düşmelerinde oyuncuların dikkatini çekebilir veya sunucuda bir heyecan artırıcı etki yaratabilirsiniz.
C++ Kaynak Kodu Entegrasyonu
Bu sistemi entegre etmek için öncelikle game/src/char.cpp dosyasında bulunan PointChange fonksiyonuna müdahale etmeniz gerekir. Bu fonksiyon, oyuncunun yang gibi para değişikliklerini yöneten merkezi alandır. Yang miktarı belirli bir eşik değerine ulaştığında, SendSoundPacket adlı özel bir fonksiyon çağrılır. Bu fonksiyon, istemciye özel bir ses dosyasının oynatılması için gerekli paketi gönderir. Ses dosyasının adı ve konumu uiscript veya doğrudan root klasöründe tanımlanabilir. Sistem, yang_threshold olarak belirlenen değeri kontrol eder. Bu değer örneğin 100.000.000 yang olsun. Bu değeri geçen düşmelerde ses çalar.
Python Uygulaması ve UI Script ile Entegrasyon
Ses dosyaları genellikle root/ui/sound dizininde tutulur. Bu dosyanın adı yang_drop.wav gibi bir isim olabilir. Python tarafında SendSoundPacket fonksiyonu ile bu ses istemciye gönderilir. Py GUI ile yapılabilecek bir arayüz sayesinde sunucu sahibi bu ses dosyasını değiştirebilir veya devre dışı bırakabilir. Bu sayede sunucu yönetim paneli üzerinden dinamik bir şekilde kontrol sağlanabilir.
Sunucu Tarafında Ayarlar
Sunucu yapılandırmasında, game/core altında bir ayar dosyası oluşturulabilir. Bu dosya içinde yang_sound_enabled, yang_threshold, sound_file_name gibi parametreler tanımlanabilir. Bu sayede sistem, derlenmeden dinamik olarak ayarlanabilir hale gelir. Martysama tarzı geliştiriciler bu yapıyı kullanarak kolayca entegre edebilirler. Auth ve DB yapıları ile entegre çalışması için loglama yapılabilir. Böylece büyük yang düşmeleri loglanır ve istatistiksel analizler yapılabilir.
Kullanım Senaryosu
Sunucuda bir savaş sonucunda bir oyuncu 150 milyon yang kazanmış olsun. Sistem bu miktarı yang_threshold ile karşılaştırır. Eşik geçildiğinde SendSoundPacket('yang_drop.wav') komutu çalıştırılır. Tüm çevredeki oyuncular bu sesi duyabilir. Bu da sunucuda bir 'ekonomik heyecan' yaratır. Oyuncular büyük yang düşmesi duyduklarında çevreye dikkat eder veya fırsat kollamaya başlarlar.
Sonuç
Yeni Yang Düşme Sesi sistemi, Metin2 özel sunucularında kullanıcı deneyimini artıran küçük ama etkili bir özelliktir. C++ ve Python tabanlı yapılarla kolayca entegre edilebilir. Sunucu sahipleri bu sistemi kullanarak sunucularını daha eğlenceli ve özgün hale getirebilirler. Metin2 Lobby olarak bu gibi sistemleri geliştirmeye ve topluluğa sunmaya devam ediyoruz.
New Yang Drop Sound System on Metin2 Lobby
To enhance user experience in Metin2 private servers and provide more customization options to server owners, the New Yang Drop Sound system has been developed. With this system, players can hear a special sound when they earn yang. This improves the server atmosphere and makes the player gains more noticeable. In this article, we will discuss how to integrate this feature using a C++ based system.
What is the System?
The Yang drop sound system enables the playback of a custom sound file when players perform an in-game action known as 'yang drop'. This process is handled by the event system defined in the game module on the server side. When the yang amount exceeds a certain threshold, the sound begins playing. This allows drawing attention during large yang drops or creating a thrilling effect on the server.
C++ Source Code Integration
To integrate this system, you first need to modify the PointChange function found in the game/src/char.cpp file. This function manages changes such as yang for the player. When the yang amount reaches a specific threshold value, a special function called SendSoundPacket is invoked. This function sends a packet to the client to play a specific sound file. The name and location of the sound file can be defined in the uiscript or directly in the root folder. The system checks the value set as yang_threshold. For example, if this value is 100,000,000 yang, the sound plays when drops exceed this value.
Integration with Python Application and UI Script
Sound files are typically stored in the root/ui/sound directory. The file name could be something like yang_drop.wav. On the Python side, the SendSoundPacket function sends this sound to the client. Through a GUI created with Py GUI, the server owner can change or disable the sound file. Thus, dynamic control over the server management panel becomes possible.
Server-Side Configuration
In the server configuration, a settings file can be created under game/core. Parameters such as yang_sound_enabled, yang_threshold[/COORD], and sound_file_name can be defined within this file. This way, the system becomes dynamically adjustable without recompilation. Developers like Martysama can easily integrate using this structure. Logging can be implemented to work integrated with Auth and DB structures. This allows logging of major yang drops and statistical analysis.
Usage Scenario
Suppose a player wins 150 million yang after a battle on the server. The system compares this amount to yang_threshold. If the threshold is exceeded, the command SendSoundPacket('yang_drop.wav') is executed. All nearby players can hear this sound. This creates 'economic excitement' on the server. When players hear a big yang drop, they pay attention to their surroundings or start looking for opportunities.
Conclusion
The New Yang Drop Sound system is a small but effective feature that enhances the user experience in Metin2 private servers. It can be easily integrated using C++ and Python based structures. Server owners can use this system to make their servers more fun and unique. At Metin2 Lobby, we continue to develop and share such systems with the community.
