(Python-Lua) Yeni Destek Becerisi #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 125

Admin

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

Root uicharacter.py atarılır;
Kod:
SHOW_LIMIT_SUPPORT_SKILL_LIST = [121, 122, 123, 124, 126, 127, 129, 128, 131, 137, 138, 139, 140]
140 yanına eklenir;
Kod:
, 164
Son hali;
Kod:
SHOW_LIMIT_SUPPORT_SKILL_LIST = [121, 122, 123, 124, 126, 127, 129, 128, 131, 137, 138, 139, 140, 164]
uitooltip.py aratılır;
Kod:
def SetSkillNew(self, slotIndex, skillIndex, skillGrade, skillLevel):


locale olarak ayarlı
Kod:
def SetSkillNew(self, slotIndex, skillIndex, skillGrade, skillLevel):         if player.SKILL_INDEX_TONGSOL == skillIndex:                          slotIndex = player.GetSkillSlotIndex(skillIndex)             skillLevel = player.GetSkillLevel(slotIndex)             self.AppendDefaultData(skillIndex)             self.AppendPartySkillData(skillGrade, skillLevel)         elif 164 == skillIndex:             self.ClearToolTip()             self.__SetSkillTitle(skillIndex, skillGrade)             opis = skill.GetSkillDescription(skillIndex)             self.AppendDescription(opis, 25)             self.AppendSpace(5)             BonusType = {                 164 : "Bonus: +"}                          bonuslar = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]                          Bonusds = {                 164 : ""}                              if skillLevel == 10:                 self.AppendTextLine("Beceri Max. Seviyede!", self.POSITIVE_COLOR)                          if 164 == skillIndex:                 self.AppendTextLine("%s %d%s" % (BonusType[skillIndex], bonuslar[skillLevel], Bonusds[skillIndex]), self.NORMAL_COLOR)                 if skillLevel < 10:                     self.AppendSpace(5)                     self.AppendTextLine("Sonraki bonus: %d%s" % (bonuslar[skillLevel+1], Bonusds[skillIndex]), self.POSITIVE_COLOR)         elif player.SKILL_INDEX_RIDING == skillIndex:             slotIndex = player.GetSkillSlotIndex(skillIndex)             self.AppendSupportSkillDefaultData(skillIndex, skillGrade, skillLevel, 30)         elif player.SKILL_INDEX_SUMMON == skillIndex:             maxLevel = 10             self.ClearToolTip()             self.__SetSkillTitle(skillIndex, skillGrade)             ## Description             description = skill.GetSkillDescription(skillIndex)             self.AppendDescription(description, 25)             if skillLevel == 10:                 self.AppendSpace(5)                 self.AppendTextLine(locale.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR)                 self.AppendTextLine(locale.SKILL_SUMMON_DESCRIPTION % (skillLevel*10), self.NORMAL_COLOR)             else:                 self.AppendSpace(5)                 self.AppendTextLine(locale.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR)                 self.__AppendSummonDescription(skillLevel, self.NORMAL_COLOR)                 self.AppendSpace(5)                 self.AppendTextLine(locale.TOOLTIP_SKILL_LEVEL % (skillLevel+1), self.NEGATIVE_COLOR)                 self.__AppendSummonDescription(skillLevel+1, self.NEGATIVE_COLOR)         elif skill.SKILL_TYPE_GUILD == skill.GetSkillType(skillIndex):             if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:                 self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH                 self.ResizeToolTip()             self.AppendDefaultData(skillIndex)             self.AppendSkillConditionData(skillIndex)             self.AppendGuildSkillData(skillIndex, skillLevel)         else:             if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:                 self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH                 self.ResizeToolTip()             slotIndex = player.GetSkillSlotIndex(skillIndex)             skillCurrentPercentage = player.GetSkillCurrentEfficientPercentage(slotIndex)             skillNextPercentage = player.GetSkillNextEfficientPercentage(slotIndex)             self.AppendDefaultData(skillIndex, skillGrade)             self.AppendSkillConditionData(skillIndex)             self.AppendSkillDataNew(slotIndex, skillIndex, skillGrade, skillLevel, skillCurrentPercentage, skillNextPercentage)             self.AppendSkillRequirement(skillIndex, skillLevel)         self.ShowToolTip()
playersettingmodule.py atarılır;
Kod:
def DefineSkillIndexDict():
O kod bloğunda örneğin şöyle bir satır var;
Kod:
"SUPPORT" : (122, 123, 121, 124, 125, 129, 0, 0, 130, 131,),},
"SUPPORT" olanlarda 125 sayısı 164 olarak değiştirilecek. (hepsi)


Kod:
def DefineSkillIndexDict():     global NEW_678TH_SKILL_ENABLE     global SKILL_INDEX_DICT     ###Vectors Ek Skill 125 olanlar 164 olarak değiştirildi###     if NEW_678TH_SKILL_ENABLE:         SKILL_INDEX_DICT = {             JOB_WARRIOR : {             1 : (1, 2, 3, 4, 5, 6, 0, 0, 137, 0, 138, 0, 139, 0,),              2 : (16, 17, 18, 19, 20, 21, 0, 0, 137, 0, 138, 0, 139, 0,),              "SUPPORT" : (122, 123, 121, 124, 164, 129, 0, 0, 130, 131,),},                          JOB_ASSASSIN : {             1 : (31, 32, 33, 34, 35, 36, 0, 0, 137, 0, 138, 0, 139, 0, 140,),              2 : (46, 47, 48, 49, 50, 51, 0, 0, 137, 0, 138, 0, 139, 0, 140,),              "SUPPORT" : (122, 123, 121, 124, 164, 129, 0, 0, 130, 131,),},                          JOB_SURA : {             1 : (61, 62, 63, 64, 65, 66, 0, 0, 137, 0, 138, 0, 139, 0,),              2 : (76, 77, 78, 79, 80, 81, 0, 0, 137, 0, 138, 0, 139, 0,),              "SUPPORT" : (122, 123, 121, 124, 164, 129, 0, 0, 130, 131,),},                          JOB_SHAMAN : {             1 : (91, 92, 93, 94, 95, 96, 0, 0, 137, 0, 138, 0, 139, 0,),              2 : (106, 107, 108, 109, 110, 111, 0, 0, 137, 0, 138, 0, 139, 0,),              "SUPPORT" : (122, 123, 121, 124, 164, 129, 0, 0, 130, 131,),},                          JOB_WOLFMAN : {             1 : (171, 172, 173, 174, 175, 176, 0, 0, 137, 0, 138, 0, 139, 0,),              "SUPPORT" : (122, 123, 121, 124, 164, 129, 0, 0, 130, 131,),}         }     else:         SKILL_INDEX_DICT = {             JOB_WARRIOR : {             1 : (1, 2, 3, 4, 5, 0, 0, 0, 137, 0, 138, 0, 139, 0,),              2 : (16, 17, 18, 19, 20, 0, 0, 0, 137, 0, 138, 0, 139, 0,),              "SUPPORT" : (122, 123, 121, 124, 164, 129, 0, 0, 130, 131,),},                          JOB_ASSASSIN : {             1 : (31, 32, 33, 34, 35, 0, 0, 0, 137, 0, 138, 0, 139, 0, 140,),              2 : (46, 47, 48, 49, 50, 0, 0, 0, 137, 0, 138, 0, 139, 0, 140,),              "SUPPORT" : (122, 123, 121, 124, 164, 129, 0, 0, 130, 131,),},                          JOB_SURA : {             1 : (61, 62, 63, 64, 65, 66, 0, 0, 137, 0, 138, 0, 139, 0,),              2 : (76, 77, 78, 79, 80, 81, 0, 0, 137, 0, 138, 0, 139, 0,),              "SUPPORT" : (122, 123, 121, 124, 164, 129, 0, 0, 130, 131,),},                          JOB_SHAMAN : {             1 : (91, 92, 93, 94, 95, 96, 0, 0, 137, 0, 138, 0, 139, 0,),              2 : (106, 107, 108, 109, 110, 111, 0, 0, 137, 0, 138, 0, 139, 0,),              "SUPPORT" : (122, 123, 121, 124, 164, 129, 0, 0, 130, 131,),},                          JOB_WOLFMAN : {             1 : (171, 172, 173, 174, 175, 176, 0, 0, 137, 0, 138, 0, 139, 0,),              "SUPPORT" : (122, 123, 121, 124, 164, 129, 0, 0, 130, 131,),}         }

Kod:
164    SUPPORT    Ejderha zırhı            Savunmayı arttırır.                     CANNOT_LEVEL_UP|PASSIVE        Vectorsds

Kod:
164    Ejderhazirhi    0    1    10    0    NONE                                DISABLE_BY_POINT_UP        NONE                0    0    NORMAL    0    1    0    0

Kod:
INSERT INTO `skill_proto` VALUES (164, 'Ejderhazirhi', 0, 0, 10, 0, 'NONE', '', '', '', '', '', '', '', 'DISABLE_BY_POINT_UP', '', 'NONE', '', '', '', '', '', '', '', 0, 0, 'NORMAL', 0, '1', 0, 0);

Yeniskill.eix Yeniskill.epk packe atılıp indexe eklenir;
Kod:
* Yeniskill *

yeniskill.lua /usr/game/share/locale/turkey/quest dizinine atılıp puttyden kodlar yazılır;
Kod:
cd /usr/game/share/locale/turkey/quest ./qc yeniskill.lua

Beceriyi geliştirmek için item kodu 70021 olarak ayarlanmıştır.


Python-Lua Vektör Tabanlı Yeni Destek Becerisi: Metin2 Lobby'de Geliştirme ve Uygulama

Metin2 özel sunucularında geliştirme yaparken hem Python hem de Lua dillerinin güçlü yönlerinden faydalanmak çok önemli. Özellikle #Vectors olarak adlandırılan yeni destek becerisi, Python ve Lua arasında verimli veri aktarımı ve koordinasyon sağlar. Bu sayede Metin2 özel sunucularında PvP sistemleri, karakter becerileri ve efektler daha esnek ve performanslı hale getirilebilir.

Vektör Kavramı Nedir?
Matematiksel olarak vektörler, hem yön hem de büyüklük bilgisi taşıyan niceliklerdir. Oyun geliştirme bağlamında ise, genellikle konum, hız, yön gibi fiziksel değerleri ifade etmek için kullanılır. Metin2 özel sunucu geliştirme sürecinde, Python tarafında tanımlanan vektörler, Lua ile istemciye aktarılıp efektlerde veya animasyonlarda kullanılabilir. Bu, özellikle PvP sistemlerinde karakterlerin hareketlerini, becerilerin etki alanlarını ve hasar dağılımını daha doğru modellemeyi sağlar.

Python Tarafında Vektör Tanımlama
Python tarafında bir vektör tanımı örneği şu şekilde olabilir:

Kod:
import math[BR][/BR][BR][/BR]class Vector3:[BR][/BR]    def __init__(self, x, y, z):[BR][/BR]        self.x = x[BR][/BR]        self.y = y[BR][/BR]        self.z = z[BR][/BR][BR][/BR]    def magnitude(self):[BR][/BR]        return math.sqrt(self.x**2 + self.y**2 + self.z**2)[BR][/BR][BR][/BR]    def normalize(self):[BR][/BR]        mag = self.magnitude()[BR][/BR]        if mag > 0:[BR][/BR]            return Vector3(self.x / mag, self.y / mag, self.z / mag)[BR][/BR]        return Vector3(0, 0, 0)


Bu sınıf, Metin2 oyun motorunda beceri efektlerinin konumunu, yönünü ve büyüklüğünü tanımlamak için kullanılabilir. Örneğin bir PvP becerisi olan Yıldırım Topu gibi bir atak, belirli bir yönde ilerletilebilir.

Lua Tarafında Vektör Kullanımı
Lua tarafında bu vektörler doğrudan alınarak UI Script veya efekt sistemlerinde kullanılabilir. Örnek bir kullanım aşağıdaki gibidir:

Kod:
function onSkillStart(skillID, targetX, targetY, targetZ)[BR][/BR]    local directionVector = {x = targetX, y = targetY, z = targetZ}[BR][/BR]    -- Burada vektör verisi alınıp efekt pozisyonu ayarlanabilir[BR][/BR]end


Python ve Lua Arasında Vektör Aktarımı
Python ve Lua arasındaki veri aktarımı, genellikle pickle veya özel yapılmış mesajlaşma protokolleri ile yapılır. Ancak Metin2 özel sunucularında genellikle bu işlemler game core içinde optimize edilerek yapılır. Bu sayede veri geçişleri hızlı ve güvenilir olur.

Destek Becerisi Olarak Vektör Kullanımı
Yeni geliştirilen bu destek becerisi, oyuncuların beceri kullanımında daha akıcı ve görsel açıdan zengin deneyim sunmayı hedefler. Örneğin bir destek becerisi, hedefteki oyuncuya doğru bir vektör üzerinden enerji transferi sağlayabilir. Bu da PvP sırasında stratejik avantajlar sunar.

Geliştirici Kaynakları
Metin2Lobby, Metin2 özel sunucu geliştiricileri için gerekli tüm kaynakları sunar. Python, Lua, C++, DB ve core sistemlerinde uzmanlaşmış ekipler tarafından hazırlanan rehberler, örnek kodlar ve sistem dosyaları sayesinde geliştirme süreci kolaylaştırılır.

Sonuç
#Vectors olarak adlandırılan bu yeni beceri sistemi, Metin2 özel sunucularında Python ve Lua dillerinin entegrasyonunu sağlayarak daha gelişmiş ve dinamik sistemlerin geliştirilmesine olanak tanır. Geliştiriciler bu yapıyı kullanarak hem PvP sistemlerini güçlendirebilir hem de oyuncular için daha keyifli bir deneyim yaratabilir.


New Support Skill Based on Vectors: Python-Lua Integration in Metin2 Lobby Development

In developing custom Metin2 servers, it is crucial to leverage the strengths of both Python and Lua. Particularly, the new support skill called #Vectors allows efficient data exchange and coordination between Python and Lua. This makes PvP systems, character skills, and effects more flexible and performance-oriented in Metin2 private servers.

What is a Vector?
Mathematically, vectors are quantities that carry both direction and magnitude. In game development, they are commonly used to represent physical values such as position, velocity, and direction. In Metin2 server development, vectors defined in Python can be transferred to the client via Lua for use in effects or animations. This enables more accurate modeling of character movements, skill areas, and damage distribution in PvP systems.

Defining Vectors in Python
An example vector definition in Python could look like this:

Kod:
import math[BR][/BR][BR][/BR]class Vector3:[BR][/BR]    def __init__(self, x, y, z):[BR][/BR]        self.x = x[BR][/BR]        self.y = y[BR][/BR]        self.z = z[BR][/BR][BR][/BR]    def magnitude(self):[BR][/BR]        return math.sqrt(self.x**2 + self.y**2 + self.z**2)[BR][/BR][BR][/BR]    def normalize(self):[BR][/BR]        mag = self.magnitude()[BR][/BR]        if mag > 0:[BR][/BR]            return Vector3(self.x / mag, self.y / mag, self.z / mag)[BR][/BR]        return Vector3(0, 0, 0)


This class can be used within the Metin2 game engine to define the location, direction, and magnitude of skill effects. For example, an attack skill like Lightning Ball in PvP can be directed along a specific path.

Using Vectors in Lua
These vectors can be directly received in Lua and used in UI scripts or effect systems. An example usage is as follows:

Kod:
function onSkillStart(skillID, targetX, targetY, targetZ)[BR][/BR]    local directionVector = {x = targetX, y = targetY, z = targetZ}[BR][/BR]    -- Here, the vector data can be used to set the effect's position[BR][/BR]end


Transferring Vectors Between Python and Lua
Data transfers between Python and Lua are typically handled with pickle or custom messaging protocols. However, in Metin2 private servers, these operations are optimized within the game core to ensure fast and reliable data exchanges.

Vector Usage as a Support Skill
This newly developed support skill aims to provide smoother and visually rich experiences during skill usage. For example, a support skill might transfer energy to a targeted player along a vector, offering strategic advantages during PvP.

Developer Resources
Metin2Lobby provides all necessary resources for Metin2 private server developers. With guides, sample codes, and system files prepared by teams specialized in Python, Lua, C++, DB, and core systems, the development process becomes easier.

Conclusion
The new skill system named #Vectors enables advanced and dynamic systems by integrating Python and Lua in Metin2 private servers. Developers can enhance PvP systems and create more enjoyable experiences for players using this structure.​
 

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

Geri
Üst Alt