(Python) Oyun Seçeneklerine Kar Göster Gizle Ekle #Vectors

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

Admin

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

Root Constinfo.py eklenir;
Kod:
Kar = 0
uigameoption.py importların altına eklenir;
Kod:
import background
Aratılır;
Kod:
self.RefreshShowSalesText()
Altına eklenir;
Kod:
self.RefreshShow()
Aratılır;
Kod:
self.showsalesTextButtonList = [*]
Altına eklenir;
Kod:
self.VectorsSnow = [*]
Aratılır;
Kod:
self.showsalesTextButtonList.append(GetObject("salestext_off_button"))
Altına eklenir;
Kod:
self.VectorsSnow.append(GetObject("snow_on")) self.VectorsSnow.append(GetObject("snow_off"))
Aratılır;
Kod:
self.showsalesTextButtonList[1].SAFE_SetEvent(self.__OnClickSalesTextOffButton)
Altına eklenir;
Kod:
self.VectorsSnow[0].SAFE_SetEvent(self._snowon) self.VectorsSnow[1].SAFE_SetEvent(self._snowoff)

Aratılır;
Kod:
def __ClickRadioButton(self, buttonList, buttonIndex):

Kod:
def _snowon(self):         background.SetEnvironmentData(1)         background.EnableSnow(1)         constInfo.Kar = 1         self.RefreshShow()     def _snowoff(self):         background.SetEnvironmentData(0)         background.EnableSnow(0)         constInfo.Kar = 0         self.RefreshShow()     def RefreshShow(self):         if constInfo.Kar == 1:             self.VectorsSnow[0].Down()             self.VectorsSnow[1].SetUp()         else:             self.VectorsSnow[0].SetUp()             self.VectorsSnow[1].Down()


uiscript gameoptiondialog.py aratılır;
(İki adet var ikisinede uygulayın.)
Kod:
25*11+8,
Değiştirilir;
Kod:
27*11+8,
Aratılır;
Kod:
"name" : "salestext_off_button",

Kod:
{                     "name" : "@Vectors",                     "type" : "text",                     "x" : LINE_LABEL_X,                     "y" : 265+2,                     "text" : "Kar",                 },                 {                     "name" : "snow_on",                     "type" : "radio_button",                     "x" : LINE_DATA_X,                     "y"    : 265,                     "text" : uiScriptLocale.OPTION_VIEW_CHAT_ON,                     "default_image" : ROOT_PATH + "middle_button_01.sub",                     "over_image" : ROOT_PATH + "middle_button_02.sub",                     "down_image" : ROOT_PATH + "middle_button_03.sub",                 },                 {                     "name" : "snow_off",                     "type" : "radio_button",                     "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH,                     "y" : 265,                     "text" : uiScriptLocale.OPTION_VIEW_CHAT_OFF,                     "default_image" : ROOT_PATH + "middle_button_01.sub",                     "over_image" : ROOT_PATH + "middle_button_02.sub",                     "down_image" : ROOT_PATH + "middle_button_03.sub",                 },

Python ile Metin2 Oyunlarında Kar Gösterme Sistemi Geliştirme


Metin2 özel sunucularında kullanıcı deneyimini artırmak adına geliştirilen sistemlerden biri de kar gösterme ve gizleme özelliğidir. Bu sistem özellikle kış temalı haritalarda atmosfer yaratmak ve oyun içi görsellik kalitesini yükseltmek için tercih edilmektedir. Bu yazıda, Python tabanlı UI script ve py root dosyaları kullanarak, Metin2 özel sunucularında nasıl kar efekti ekleyebileceğimizi ve bu efektin nasıl kontrol edileceğini anlatacağız.

Kar Efekti Nedir ve Neden Kullanılır?
Oyunlarda kar efekti, görsel atmosfer yaratmak ve oynanışa görsel derinlik katmak için kullanılır. Özellikle Metin2 gibi MMORPG oyunlarında, farklı mevsimsel etkiler oyun içi deneyimi zenginleştirir. Kar efekti, oyuncuların harita üzerinde dolaşırken rastgele veya sabit aralıklarla düşen kar taneciklerini görmelerini sağlar. Bu efekt, genellikle client tarafında Python ile geliştirilir ve UIScript dosyaları üzerinden yönetilir.

Python Kar Efekti Sistemi Nasıl Kurulur?
Python ile kar efekti sistemi oluşturmak için birkaç temel adımı izlemek gerekir. İlk olarak, py root dizinine özel bir kar efekti modülü eklenmelidir. Bu modül, kar taneciklerinin pozisyonlarını, hızını, renk tonlarını ve saydamlığını belirler. Genellikle bir döngü içinde animasyonlu bir şekilde hareket ettirilir. Kar efekti, oyun başlatıldığında aktif hale gelmeli ve isteğe bağlı olarak oyun içi menüden açılıp kapatılabilmelidir.

Kar Efekti Aç/Kapat Sistemi
Bu sistemin en önemli parçalarından biri, efektin kullanıcı tarafından kontrol edilebilir olmasıdır. Bunun için bir toggle butonu oluşturulabilir. Butona basıldığında kar efekti aktif ya da pasif hale getirilir. Bu işlem için Python GUI kullanılır. Kar efekti kontrolü, hem performans hem de kullanıcı tercihi açısından önemlidir. Özellikle eski donanımlı sistemlerde kar efekti performansı etkileyebilir. Bu nedenle efektin açık/kapalı konumuna göre CPU ve GPU yükünü azaltmak gerekir.

Kar Efekti için Vektör Hesaplamaları
Kar efekti oluştururken fiziksel gerçekçilik için vektör hesaplamaları yapılır. Her kar tanesi, x, y ve bazen z ekseninde hareket eder. Bu hareketler, rastgele veya önceden tanımlanmış vektörlerle belirlenir. #Vectors ifadesi, bu tür sistemlerde vektörel hesaplamaların yapıldığı bir alt sistemi temsil eder. Kar taneciklerinin hızı, yönü ve dönüşü gibi parametreler vektörlerle tanımlanır. Bu sayede daha gerçekçi ve dinamik bir kar efekti elde edilir.

Oyun Seçenekleri Menüsüne Entegrasyon
Kar efekti sistemi, oyun içi ayarlar menüsüne entegre edilmelidir. Oyuncular, bu menüden efektin açık olup olmadığını seçebilmelidir. Bu menü genellikle Python GUI ile geliştirilir ve UIScript dosyası üzerinden düzenlenir. Ayarlar menüsünde, 'Kutucuk' şeklinde bir buton yer alır. Bu kutucuk işaretlenirse kar efekti aktif olur, aksi halde pasif kalır. Bu sistem, oyuncuya özelleştirme imkanı sunar.

Geliştirme Ortamı ve Gereksinimler
Python ile kar efekti geliştirmek için bazı temel bileşenler gereklidir:
- Metin2 Client SRC: Görsel efektler için gerekli olan client tarafı dosyaları.
- Py Root: Python betiklerinin bulunduğu dizin.
- UIScript: Arayüz dosyalarının bulunduğu klasör.
- Martysama veya benzeri kaynaklar: Sistem geliştirmeye yardımcı olacak örnek sistemler.

Sonuç
Python ile geliştirilen kar efekti sistemi, Metin2 özel sunucularında görsel zenginlik sağlar. Bu sistem, hem kullanıcı dostu hem de performans odaklı şekilde tasarlanabilir. Vektörel hesaplamalarla daha gerçekçi efektler elde edilirken, kullanıcıların tercihlerine göre açılıp kapanabilen bir sistemle daha fazla esneklik sağlanır. Bu tarz sistemler, Metin2 geliştirme dünyasında dikkat çeken detaylardır.


Developing Snow Effects in Metin2 Games with Python


To enhance the user experience in Metin2 private servers, one of the developed systems is the snow display and hide feature. This system is especially preferred for creating atmosphere in winter-themed maps and increasing in-game visual quality. In this article, we will explain how to add a snow effect using Python-based UI scripts and py root files in Metin2 private servers, and how to control this effect.

What is the Snow Effect and Why is it Used?
In games, the snow effect is used to create visual atmosphere and add depth to gameplay. Especially in MMORPGs like Metin2, different seasonal effects enrich the in-game experience. The snow effect allows players to see randomly or periodically falling snowflakes while moving around the map. This effect is generally developed on the client side using Python and managed via UIScript files.

How to Set Up the Python Snow Effect System?
To create a snow effect system with Python, several basic steps must be followed. First, a custom snow effect module should be added to the py root directory. This module determines the positions, speed, color tones, and transparency of snowflakes. Usually, they are animated in a loop. The snow effect should activate upon launching the game and optionally be toggleable from the in-game menu.

Snow Effect Toggle System
One of the most important aspects of this system is that it can be controlled by the user. For this, a toggle button can be created. When pressed, the snow effect becomes active or inactive. This process uses Python GUI. Controlling the snow effect is important both for performance and user preference. On older hardware, the snow effect may impact performance. Therefore, reducing CPU and GPU load depending on whether the effect is enabled/disabled is necessary.

Vector Calculations for the Snow Effect
When creating a snow effect, vector calculations are made for physical realism. Each snowflake moves along the x, y, and sometimes z axes. These movements are determined by random or predefined vectors. The term #Vectors represents a subsystem where vector calculations are performed in such systems. Parameters like speed, direction, and rotation of snowflakes are defined with vectors, resulting in a more realistic and dynamic snow effect.

Integration into Game Options Menu
The snow effect system should be integrated into the in-game settings menu. Players should be able to select whether the effect is active from this menu. This menu is usually developed with Python GUI and edited through the UIScript file. In the settings menu, there is a checkbox-style button. If checked, the snow effect activates; otherwise, it remains inactive. This system provides customization options for the player.

Development Environment and Requirements
To develop a snow effect system with Python, some essential components are needed:
- Metin2 Client SRC: Files required for visual effects on the client-side.
- Py Root: Directory where Python scripts are located.
- UIScript: Folder containing interface files.
- Martysama or similar resources: Example systems to assist in system development.

Conclusion
The snow effect system developed with Python adds visual richness to Metin2 private servers. This system can be designed to be both user-friendly and performance-oriented. More realistic effects are achieved with vector calculations, and flexibility is provided by enabling the system to turn on/off according to user preferences. Such systems stand out as remarkable details in the world of Metin2 development.
 

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

Benzer konular

Geri
Üst Alt