Merhaba arkadaşlar,
Lafı uzatmadan konuya geçiyorum. Yerden alınan itemde eğilir ve eliyle alır.
Konu yabancı bir forumdan alıntıdır. Sadece bir teşekkür yeterlidir.
Yapılış;
Client Source Açılır ve;
UserInterface/PythonCharacterModule.cpp girilir ve aratılır;
Altına eklenir;
UserInterface/PythonPlayerInput.cpp girilir ve aratılır;
Altına eklenir;
GameLib/ActorInstanceMotion.cpp girilir ve aratılır;
Altına eklenir;
GameLib/RaceManager.cpp girilir ve aratılır;
Altına eklenir;
GameLib/RaceMotionData.cpp girilir ve aratılır;
Altına eklenir;
GameLib/RaceMotionData.h girilir ve aratılır;
Altına eklenir;
Source ile işimiz bitti, sırada root/playersettingmodule.py
Aratılır;
Altına eklenir;
İşlem bitmiştir. İyi forumlar.
[C++ & PYTHON] Yerden Alınan İtem Effect'i
Metin2 özel sunucularında geliştirme yaparken, oyuncuların oyun deneyimini artırmak için görsel efektler çok önemlidir. Özellikle yerden item alındığında gösterilen efektler, kullanıcıya geri bildirim sağlar ve oyun içi etkileşimi daha keyifli hale getirir. Bu rehberde, C++ ve Python tarafında nasıl yerden alınan item'e özel efekt ekleyebileceğinizi detaylıca anlatacağız.
Yerden Item Alınması Olayı Nedir?
Metin2 oyununda oyuncu bir itemi yerden almak istediğinde, o itemin sahibi kendisi değilse sistem bu işlemi engeller. Eğer item sahibi oyuncuysa veya açık bırakılmışsa, alınırken belirli ses, efekt veya animasyonlar tetiklenebilir. Bu efektler hem C++ oyun motoru tarafından hem de Python UI tarafında yönetilebilir.
C++ Tarafında Item Efekti Tetiklemek
C++ kısmında, item efekti genellikle GameCore tarafında yönetilir. Örneğin, char_item.cpp dosyasında bulunan PointChange fonksiyonu, item alındığında çağrılır. Burada item tipine göre özel efektler çalıştırabilirsiniz.
Örnek olarak:
if (itemType == ITEM_TYPE_SPECIAL)
{
PlaySpecialEffect(PLAYER_ID, EFFECT_ID);
}
Bu yapı sayesinde, farklı item türlerine özel efektler tanımlayabilirsiniz. Bu efektler önceden derlenmiş grafik dosyaları olabilir, örneğin .gr2 formatında.
Python Tarafında UI Efekti
Python tarafında, uiscript dosyaları aracılığıyla item alınırken UI efekti gösterebilirsiniz. Bu efektler genellikle ekran köşesinde bir bildirim, efekt animasyonu veya ses efektidir.
root klasörü altında bulunan uiinventory.py dosyasında, item alındığında çalışan bir fonksiyon tanımlayabilirsiniz. Örneğin:
def OnPickUpItem(self, itemVnum):
self.__PlaySound('item_pickup.wav')
self.__ShowEffect('effect_item_pickup.gr2')
Dikkat Edilmesi Gerekenler
Efekt dosyalarının doğru yolda olduğundan emin olun. Hatalı yol tanımlaması sistemde çökme veya hata mesajlarına neden olabilir. Ayrıca efektlerin performans üzerindeki etkisini göz ardı etmeyin. Çok fazla efekt, düşük donanımlı sistemlerde FPS düşüşüne sebep olabilir.
Sonuç
C++ ve Python tarafında yerden alınan item efekti eklemek, Metin2 özel sunucularında kullanıcı deneyimini ciddi anlamda artırır. Hem görsel hem de işitsel geri bildirimler ile oyuncular daha fazla motive edilir. Sistemde yapılacak küçük değişikliklerle büyük etkiler elde edilebilir. Bu rehber sayesinde temel düzeyde bir efekt sistemi kurabilirsiniz.
[C++ & PYTHON] Item Pick-Up Effect from Ground
When developing Metin2 private servers, visual effects are crucial for enhancing the player experience. Especially the effects displayed when picking up items from the ground provide feedback to the user and make in-game interactions more enjoyable. In this guide, we will explain in detail how you can add special effects to items picked up from the ground on both C++ and Python sides.
What is the Item Pick-Up Event?
In the Metin2 game, when a player tries to pick up an item from the ground, if the item does not belong to them, the system prevents the action. If the item belongs to the player or has been dropped publicly, sounds, effects, or animations may be triggered upon pickup.
Triggering Item Effects in C++
In C++, item effects are usually managed by the GameCore. For example, the PointChange function located in the char_item.cpp file is called when an item is picked up. Here, you can run custom effects based on the item type.
For example:
if (itemType == ITEM_TYPE_SPECIAL)
{
PlaySpecialEffect(PLAYER_ID, EFFECT_ID);
}
With this structure, you can define custom effects for different item types. These effects might be precompiled graphics files, such as in .gr2 format.
UI Effects in Python
In Python, you can display UI effects during item pickup through uiscript files. These effects typically appear as notifications in the corner of the screen, animation effects, or sound cues.
In the uiinventory.py file under the root folder, you can define a function that runs when an item is picked up. For example:
def OnPickUpItem(self, itemVnum):
self.__PlaySound('item_pickup.wav')
self.__ShowEffect('effect_item_pickup.gr2')
Important Considerations
Ensure that effect files are located in the correct paths. Incorrect path definitions may cause crashes or error messages in the system. Also, do not overlook the performance impact of effects. Too many effects can cause FPS drops on low-end systems.
Conclusion
Adding item pick-up effects from the ground on both C++ and Python sides significantly enhances the user experience in Metin2 private servers. Visual and auditory feedback motivates players more. Significant impacts can be achieved with small changes in the system. With this guide, you can set up a basic effect system.
Lafı uzatmadan konuya geçiyorum. Yerden alınan itemde eğilir ve eliyle alır.
Konu yabancı bir forumdan alıntıdır. Sadece bir teşekkür yeterlidir.
Yapılış;
Client Source Açılır ve;
UserInterface/PythonCharacterModule.cpp girilir ve aratılır;
Kod:
PyModule_AddIntConstant(poModule, "NEW_AFFECT_DRAGON_SOUL_QUALIFIED", CInstanceBase::NEW_AFFECT_DRAGON_SOUL_QUALIFIED);
Altına eklenir;
Kod:
PyModule_AddIntConstant(poModule, "MOTION_PICK_UP", CRaceMotionData::NAME_PICK_UP);
UserInterface/PythonPlayerInput.cpp girilir ve aratılır;
Kod:
void CPythonPlayer::PickCloseItem()
Altına eklenir;
Kod:
pkInstMain->GetGraphicThingInstancePtr()->InterceptOnceMotion(CRaceMotionData::NAME_PICK_UP);
GameLib/ActorInstanceMotion.cpp girilir ve aratılır;
Kod:
case CRaceMotionData::NAME_SLAP_HURT_WITH_SHAMAN:
Altına eklenir;
Kod:
case CRaceMotionData::NAME_PICK_UP:
GameLib/RaceManager.cpp girilir ve aratılır;
Kod:
s_kMap_stType_dwIndex.insert(std::map<std::string, DWORD>::value_type("SKILL5", CRaceMotionData::NAME_SKILL+125));
Altına eklenir;
Kod:
s_kMap_stType_dwIndex.insert(std::map<std::string, DWORD>::value_type("PICK_UP", CRaceMotionData::NAME_PICK_UP));
GameLib/RaceMotionData.cpp girilir ve aratılır;
Kod:
case NAME_DIG:
Altına eklenir;
Kod:
case NAME_PICK_UP:
GameLib/RaceMotionData.h girilir ve aratılır;
Kod:
NAME_JOY,
Altına eklenir;
Kod:
NAME_PICK_UP,
Source ile işimiz bitti, sırada root/playersettingmodule.py
Aratılır;
Kod:
def SetGeneralMotions(mode, folder):
Altına eklenir;
Kod:
chrmgr.RegisterCacheMotionData(mode, chr.MOTION_PICK_UP, "pick_up.msa")
İşlem bitmiştir. İyi forumlar.
[C++ & PYTHON] Yerden Alınan İtem Effect'i
Metin2 özel sunucularında geliştirme yaparken, oyuncuların oyun deneyimini artırmak için görsel efektler çok önemlidir. Özellikle yerden item alındığında gösterilen efektler, kullanıcıya geri bildirim sağlar ve oyun içi etkileşimi daha keyifli hale getirir. Bu rehberde, C++ ve Python tarafında nasıl yerden alınan item'e özel efekt ekleyebileceğinizi detaylıca anlatacağız.
Yerden Item Alınması Olayı Nedir?
Metin2 oyununda oyuncu bir itemi yerden almak istediğinde, o itemin sahibi kendisi değilse sistem bu işlemi engeller. Eğer item sahibi oyuncuysa veya açık bırakılmışsa, alınırken belirli ses, efekt veya animasyonlar tetiklenebilir. Bu efektler hem C++ oyun motoru tarafından hem de Python UI tarafında yönetilebilir.
C++ Tarafında Item Efekti Tetiklemek
C++ kısmında, item efekti genellikle GameCore tarafında yönetilir. Örneğin, char_item.cpp dosyasında bulunan PointChange fonksiyonu, item alındığında çağrılır. Burada item tipine göre özel efektler çalıştırabilirsiniz.
Örnek olarak:
if (itemType == ITEM_TYPE_SPECIAL)
{
PlaySpecialEffect(PLAYER_ID, EFFECT_ID);
}
Bu yapı sayesinde, farklı item türlerine özel efektler tanımlayabilirsiniz. Bu efektler önceden derlenmiş grafik dosyaları olabilir, örneğin .gr2 formatında.
Python Tarafında UI Efekti
Python tarafında, uiscript dosyaları aracılığıyla item alınırken UI efekti gösterebilirsiniz. Bu efektler genellikle ekran köşesinde bir bildirim, efekt animasyonu veya ses efektidir.
root klasörü altında bulunan uiinventory.py dosyasında, item alındığında çalışan bir fonksiyon tanımlayabilirsiniz. Örneğin:
def OnPickUpItem(self, itemVnum):
self.__PlaySound('item_pickup.wav')
self.__ShowEffect('effect_item_pickup.gr2')
Dikkat Edilmesi Gerekenler
Efekt dosyalarının doğru yolda olduğundan emin olun. Hatalı yol tanımlaması sistemde çökme veya hata mesajlarına neden olabilir. Ayrıca efektlerin performans üzerindeki etkisini göz ardı etmeyin. Çok fazla efekt, düşük donanımlı sistemlerde FPS düşüşüne sebep olabilir.
Sonuç
C++ ve Python tarafında yerden alınan item efekti eklemek, Metin2 özel sunucularında kullanıcı deneyimini ciddi anlamda artırır. Hem görsel hem de işitsel geri bildirimler ile oyuncular daha fazla motive edilir. Sistemde yapılacak küçük değişikliklerle büyük etkiler elde edilebilir. Bu rehber sayesinde temel düzeyde bir efekt sistemi kurabilirsiniz.
[C++ & PYTHON] Item Pick-Up Effect from Ground
When developing Metin2 private servers, visual effects are crucial for enhancing the player experience. Especially the effects displayed when picking up items from the ground provide feedback to the user and make in-game interactions more enjoyable. In this guide, we will explain in detail how you can add special effects to items picked up from the ground on both C++ and Python sides.
What is the Item Pick-Up Event?
In the Metin2 game, when a player tries to pick up an item from the ground, if the item does not belong to them, the system prevents the action. If the item belongs to the player or has been dropped publicly, sounds, effects, or animations may be triggered upon pickup.
Triggering Item Effects in C++
In C++, item effects are usually managed by the GameCore. For example, the PointChange function located in the char_item.cpp file is called when an item is picked up. Here, you can run custom effects based on the item type.
For example:
if (itemType == ITEM_TYPE_SPECIAL)
{
PlaySpecialEffect(PLAYER_ID, EFFECT_ID);
}
With this structure, you can define custom effects for different item types. These effects might be precompiled graphics files, such as in .gr2 format.
UI Effects in Python
In Python, you can display UI effects during item pickup through uiscript files. These effects typically appear as notifications in the corner of the screen, animation effects, or sound cues.
In the uiinventory.py file under the root folder, you can define a function that runs when an item is picked up. For example:
def OnPickUpItem(self, itemVnum):
self.__PlaySound('item_pickup.wav')
self.__ShowEffect('effect_item_pickup.gr2')
Important Considerations
Ensure that effect files are located in the correct paths. Incorrect path definitions may cause crashes or error messages in the system. Also, do not overlook the performance impact of effects. Too many effects can cause FPS drops on low-end systems.
Conclusion
Adding item pick-up effects from the ground on both C++ and Python sides significantly enhances the user experience in Metin2 private servers. Visual and auditory feedback motivates players more. Significant impacts can be achieved with small changes in the system. With this guide, you can set up a basic effect system.
