Öncelikle SELAMUN ALEYKÜM arkadaşlar
daha önce böyle bir konu açıldımı açılmadımı bilmiyorum ama bilgi amaçlı bu konuyu açmak istedim.
bilenler vardır illaki ama bilmeyenlerde olduğunu düşünüyorum onun için konuyu açıyorum bir hatam varsa belirtirseniz konuda düzeltirim.
BAŞLAYALIM:
1.ADIM
# questi yapalım :
# ÖRNEK:
-----------------------------------------------------------------------
-----------------------------------------------------------------------
2.ADIM
# root'ta game.py'yi açın sonra
#def Open(self): in altında bulunan
self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight())
# questin görevini yaptıracağımız düğmeyi koyarız.
3.ADIM
#"item_mall" : self.__ItemMall_Open, arıyoruz. ve yapıştırıyoruz
4.ADIM
# sonra, en son py dosyamızın en altına gidip bunları ekliyoruz.
# Şunuda belirtiyim bu kodlar ekliyse eklemeyin quest ekranı boş acılıp takılır yanı kod varsa eklemeyin.
# Def testleri, quest fonksiyonunu yerine getirecek olan testtir
# daha sonra fonksiyonu çalıştıracak olan butona def testleri eklenir.
5.ADIM
# Sonra constinfo'ya gidip ekliyoruz :
Pythondaki Butonu Questle Bağlama
Metin2 özel sunucularında geliştirme yaparken kullanıcı arayüzü (UI) üzerinde butonlara tıklanıldığında belirli görevlerin (quest) çalışması istenebilir. Bu bağlamda, Python GUI üzerinde yer alan bir butonun bir quest ile bağlantılı hale getirilmesi oldukça önemli bir özelliktir. Bu işlem, hem oyuncu deneyimini artırır hem de sunucu tarafında dinamik etkileşimler sağlar.
Python GUI ve UIScript sistemleri, Metin2 özel sunucularında py_root klasörleri altında geliştirilen arayüzler için temel yapı taşlarıdır. Bu sistemde butonlara tıklanıldığında sunucuya mesaj gönderilerek quest başlatılabilir. Bu işlem genellikle game core üzerinden yönetilir ve auth veya db core gibi sistemlerle entegre çalışır.
Buton Oluşturma ve Tıklama İşlevi
Py GUI üzerinde bir buton oluşturmak oldukça basittir. Öncelikle UIScript dosyasında bir buton tanımlanır. Ardından Python tarafında bu butona bir tıklama fonksiyonu atanır. Bu fonksiyon, genellikle net.SendQuestInputChatPacket gibi bir komutla sunucuya quest bilgisini gönderir. Sunucu tarafında ise bu quest komutu karşılanır ve gerekli işlemler başlatılır.
Quest Tarafının Hazırlanması
Quest tarafında, Python'dan gelen mesajı yakalayacak bir sistem oluşturulmalıdır. Bu genellikle quest_function veya doğrudan when blokları ile yapılır. Örneğin:
when button_click begin
say('Butona tıklandı!')
end
Yukarıdaki örnek, butona tıklanıldığında bir mesaj göstermektedir. Ancak gerçek bir sistemde, bu noktada daha karmaşık işlemler yapılabilir: envanter kontrolü, item verme, seviye atlama, özel etkinlik başlatma gibi.
Sunucu Trafından Geri Dönüş
Game server programming yapılırken, buton tıklaması sonrası sunucudan oyuncuya geri dönüşler önemlidir. Örneğin, bir görev tamamlandığında ekranın güncellenmesi gerekebilir. Bunun için client tarafında UI yeniden çizimi yapılması gerekir. Bu da genellikle Python GUI üzerinden yapılır.
Hata Ayıklama ve Test
Sistem doğru çalışmadığında, log dosyaları incelenmelidir. Martysama veya benzeri geliştirici araçları, quest sistemlerinde hata ayıklamada yardımcı olabilir. Ayrıca, compile sırasında çıkan hatalar dikkatlice incelenmeli, source edit işlemleri eksiksiz yapılmalıdır.
Güvenlik ve Performans
Client src üzerinde yapılan her değişiklik, güvenlik açıklarına neden olabilir. Bu nedenle, buton tıklamalarıyla quest başlatılırken doğrulama kontrolleri mutlaka yapılmalıdır. Oyuncunun yetkisi, envanter durumu, seviyesi gibi faktörler kontrol edilmelidir.
Sonuç
Pythondaki bir butonun Questle bağlanması, Metin2 özel sunucularında gelişmiş sistemler geliştirmek için temel adımlardan biridir. Doğru yapılandırıldığında, oyuncular için daha zengin etkileşimli arayüzler oluşturulabilir. Bu işlem, Metin2Dev süreçlerinde merkezi bir rol oynar ve game core ile entegre çalışarak güçlü sistemlerin oluşmasına olanak tanır.
Connecting a Button in Python to a Quest in Metin2
When developing for Metin2 private servers, you may want certain actions to trigger when players click on buttons within the user interface (UI). Connecting a button created with Python GUI to a specific quest is an essential feature that enhances player experience and allows dynamic interactions on the server side.
Python GUI and UIScript systems form the foundation for UI development in py_root folders of Metin2 private servers. In this system, clicking a button sends a message to the server to start a quest. This process is typically managed through the game core and integrates with systems like auth or db core.
Creating Buttons and Handling Click Events
Creating a button in Py GUI is straightforward. First, define the button in your UIScript file. Then, assign a click function to it in Python. This function usually sends quest information to the server using commands such as net.SendQuestInputChatPacket. On the server side, the quest command is received and the necessary processes are triggered.
Preparing the Quest Side
On the quest side, a system must be set up to capture messages sent from Python. This is often done using quest_function or when blocks. For example:
when button_click begin
say('Button clicked!')
end
The above example shows a simple message upon button click. However, in a real system, more complex operations could occur, such as inventory checks, giving items, level-ups, or starting special events.
Server Response
When game server programming is performed, feedback from the server to the player after a button click is important. For instance, if a task is completed, the UI might need updating. This requires redrawing the UI on the client side, usually handled by Python GUI.
Debugging and Testing
If the system doesn’t work as expected, check the log files. Tools like Martysama can assist in debugging quest systems. Additionally, errors during compile should be carefully reviewed, and source edit operations must be done thoroughly.
Security and Performance
Any modifications made to client src can lead to security vulnerabilities. Therefore, validation checks must be implemented when starting quests via button clicks. Factors like player permissions, inventory status, and level should be verified.
Conclusion
Connecting a button in Python to a quest is one of the fundamental steps in creating advanced systems for Metin2 private servers. When configured correctly, it enables richer interactive interfaces for players. This process plays a central role in Metin2Dev workflows and works seamlessly with the game core to build powerful systems.
daha önce böyle bir konu açıldımı açılmadımı bilmiyorum ama bilgi amaçlı bu konuyu açmak istedim.
bilenler vardır illaki ama bilmeyenlerde olduğunu düşünüyorum onun için konuyu açıyorum bir hatam varsa belirtirseniz konuda düzeltirim.
BAŞLAYALIM:
1.ADIM
# questi yapalım :
# ÖRNEK:
-----------------------------------------------------------------------
Kod:
when login begin cmdchat("SendQuestIndex "..q.getcurrentquestindex()) end when info or button begin cmdchat("input1") local ilk_buton = input(cmdchat("button1")) cmdchat("input0") if ilk_buton == "1" then chat("baslangic") elseif ilk_buton == "2" then chat("bitis") end
2.ADIM
# root'ta game.py'yi açın sonra
#def Open(self): in altında bulunan
self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight())
# questin görevini yaptıracağımız düğmeyi koyarız.
Kod:
self.Button1 = ui.Button() self.Button1.SetUpVisual("d:/ymir work/ui/public/slot_cover_button_01.sub") self.Button1.SetOverVisual("d:/ymir work/ui/public/slot_cover_button_02.sub") self.Button1.SetDownVisual("d:/ymir work/ui/public/slot_cover_button_03.sub") self.Button1.SetEvent(self.test) self.Button1.SetPosition(11, 13) self.Button1.Show()
3.ADIM
#"item_mall" : self.__ItemMall_Open, arıyoruz. ve yapıştırıyoruz
Kod:
"SendQuestIndex" : self.SetQIndex, "button1" : self.button1, "input0" : self.__Input0, "input1" : self.__Input1,
# sonra, en son py dosyamızın en altına gidip bunları ekliyoruz.
Kod:
def SetQIndex(self, idx): constInfo.QIDX = int(idx) def __Input0(self): constInfo.INPUT_IGNORE = 0 def __Input1(self): constInfo.INPUT_IGNORE = 1 def button1(self): info = constInfo.SendInfo net.SendQuestInputStringPacket(str(info)) def test(self): import event,constInfo eq = constInfo.QIDX constInfo.SendInfo = "1" event.QuestButtonClick(int(eq))
# Şunuda belirtiyim bu kodlar ekliyse eklemeyin quest ekranı boş acılıp takılır yanı kod varsa eklemeyin.
# Def testleri, quest fonksiyonunu yerine getirecek olan testtir
# daha sonra fonksiyonu çalıştıracak olan butona def testleri eklenir.
5.ADIM
# Sonra constinfo'ya gidip ekliyoruz :
Kod:
INPUT_IGNORE = 0 QIDX = 0 SendInfo = 0
Pythondaki Butonu Questle Bağlama
Metin2 özel sunucularında geliştirme yaparken kullanıcı arayüzü (UI) üzerinde butonlara tıklanıldığında belirli görevlerin (quest) çalışması istenebilir. Bu bağlamda, Python GUI üzerinde yer alan bir butonun bir quest ile bağlantılı hale getirilmesi oldukça önemli bir özelliktir. Bu işlem, hem oyuncu deneyimini artırır hem de sunucu tarafında dinamik etkileşimler sağlar.
Python GUI ve UIScript sistemleri, Metin2 özel sunucularında py_root klasörleri altında geliştirilen arayüzler için temel yapı taşlarıdır. Bu sistemde butonlara tıklanıldığında sunucuya mesaj gönderilerek quest başlatılabilir. Bu işlem genellikle game core üzerinden yönetilir ve auth veya db core gibi sistemlerle entegre çalışır.
Buton Oluşturma ve Tıklama İşlevi
Py GUI üzerinde bir buton oluşturmak oldukça basittir. Öncelikle UIScript dosyasında bir buton tanımlanır. Ardından Python tarafında bu butona bir tıklama fonksiyonu atanır. Bu fonksiyon, genellikle net.SendQuestInputChatPacket gibi bir komutla sunucuya quest bilgisini gönderir. Sunucu tarafında ise bu quest komutu karşılanır ve gerekli işlemler başlatılır.
Quest Tarafının Hazırlanması
Quest tarafında, Python'dan gelen mesajı yakalayacak bir sistem oluşturulmalıdır. Bu genellikle quest_function veya doğrudan when blokları ile yapılır. Örneğin:
when button_click begin
say('Butona tıklandı!')
end
Yukarıdaki örnek, butona tıklanıldığında bir mesaj göstermektedir. Ancak gerçek bir sistemde, bu noktada daha karmaşık işlemler yapılabilir: envanter kontrolü, item verme, seviye atlama, özel etkinlik başlatma gibi.
Sunucu Trafından Geri Dönüş
Game server programming yapılırken, buton tıklaması sonrası sunucudan oyuncuya geri dönüşler önemlidir. Örneğin, bir görev tamamlandığında ekranın güncellenmesi gerekebilir. Bunun için client tarafında UI yeniden çizimi yapılması gerekir. Bu da genellikle Python GUI üzerinden yapılır.
Hata Ayıklama ve Test
Sistem doğru çalışmadığında, log dosyaları incelenmelidir. Martysama veya benzeri geliştirici araçları, quest sistemlerinde hata ayıklamada yardımcı olabilir. Ayrıca, compile sırasında çıkan hatalar dikkatlice incelenmeli, source edit işlemleri eksiksiz yapılmalıdır.
Güvenlik ve Performans
Client src üzerinde yapılan her değişiklik, güvenlik açıklarına neden olabilir. Bu nedenle, buton tıklamalarıyla quest başlatılırken doğrulama kontrolleri mutlaka yapılmalıdır. Oyuncunun yetkisi, envanter durumu, seviyesi gibi faktörler kontrol edilmelidir.
Sonuç
Pythondaki bir butonun Questle bağlanması, Metin2 özel sunucularında gelişmiş sistemler geliştirmek için temel adımlardan biridir. Doğru yapılandırıldığında, oyuncular için daha zengin etkileşimli arayüzler oluşturulabilir. Bu işlem, Metin2Dev süreçlerinde merkezi bir rol oynar ve game core ile entegre çalışarak güçlü sistemlerin oluşmasına olanak tanır.
Connecting a Button in Python to a Quest in Metin2
When developing for Metin2 private servers, you may want certain actions to trigger when players click on buttons within the user interface (UI). Connecting a button created with Python GUI to a specific quest is an essential feature that enhances player experience and allows dynamic interactions on the server side.
Python GUI and UIScript systems form the foundation for UI development in py_root folders of Metin2 private servers. In this system, clicking a button sends a message to the server to start a quest. This process is typically managed through the game core and integrates with systems like auth or db core.
Creating Buttons and Handling Click Events
Creating a button in Py GUI is straightforward. First, define the button in your UIScript file. Then, assign a click function to it in Python. This function usually sends quest information to the server using commands such as net.SendQuestInputChatPacket. On the server side, the quest command is received and the necessary processes are triggered.
Preparing the Quest Side
On the quest side, a system must be set up to capture messages sent from Python. This is often done using quest_function or when blocks. For example:
when button_click begin
say('Button clicked!')
end
The above example shows a simple message upon button click. However, in a real system, more complex operations could occur, such as inventory checks, giving items, level-ups, or starting special events.
Server Response
When game server programming is performed, feedback from the server to the player after a button click is important. For instance, if a task is completed, the UI might need updating. This requires redrawing the UI on the client side, usually handled by Python GUI.
Debugging and Testing
If the system doesn’t work as expected, check the log files. Tools like Martysama can assist in debugging quest systems. Additionally, errors during compile should be carefully reviewed, and source edit operations must be done thoroughly.
Security and Performance
Any modifications made to client src can lead to security vulnerabilities. Therefore, validation checks must be implemented when starting quests via button clicks. Factors like player permissions, inventory status, and level should be verified.
Conclusion
Connecting a button in Python to a quest is one of the fundamental steps in creating advanced systems for Metin2 private servers. When configured correctly, it enables richer interactive interfaces for players. This process plays a central role in Metin2Dev workflows and works seamlessly with the game core to build powerful systems.
