Bvural41 1
Bvural41
romegames 1
romegames
noisiv 1
noisiv
Manwe Work 1
Manwe Work
Best Studio 1
Best Studio
kralhakan2009 1
kralhakan2009
Vahsi Uzman 1
Vahsi Uzman
InfernoShade 1
InfernoShade
BlackFullMoon 1
BlackFullMoon
Agora Metin2 1
Agora Metin2
PrimeAC 1
PrimeAC
Hikaye Ekle
Reklam vermek için turkmmo@gmail.com

Metin2 Cevherleri Yan Yana Sıralamak (C++/Python)

5.00 yıldız(lar) 2 Değerlendirme Değerlendirenler
[CODE title="syserr.txt"]0413 04:11:45088 :: Traceback (most recent call last):

0413 04:11:45088 :: File "ui.py", line 1919, in OnOverInItem

0413 04:11:45088 :: File "ui.py", line 89, in __call__

0413 04:11:45089 :: File "ui.py", line 80, in __call__

0413 04:11:45089 :: File "uiInventory.py", line 1111, in OverInItem

0413 04:11:45089 :: File "uiInventory.py", line 1334, in ShowToolTip

0413 04:11:45089 :: File "uiToolTip.py", line 646, in SetInventoryItem

0413 04:11:45089 :: File "uiToolTip.py", line 1102, in AddItemData

0413 04:11:45089 :: File "uiToolTip.py", line 1950, in __AppendAccessoryMetinSlotInfo

0413 04:11:45089 :: IndexError
0413 04:11:45089 :: :
0413 04:11:45089 :: list index out of range
0413 04:11:45089 ::
[/CODE]

ilgili kod

Python:
                    lv = sockets[mtrlPos]

bu arada sadece ilk cevheri eklerken oluyor bu syserr

aynı sorun var
 
fix -
if app.ENABLE_TOOLTIP_ACCESSORY:
lv = 0
if mtrl > 1:
lv = sockets[mtrlPos]

change to
if app.ENABLE_TOOLTIP_ACCESSORY:
lv = 0
if mtrl > 1 and mtrlPos < len(sockets):
lv = sockets[mtrlPos]
 
Son düzenleme:
Hata alan arkadaşlar çok olmuş onlar için düzenlenmiş halini paylaşıyorum konuya eklersiniz




[CODE title="locale_game.txt"]LEFT_TIME2 Kalan Süre[/CODE]

KANIT :

Ekran Alıntısı.PNG


NOT: BEN 4 SOKETLİ KULLANIYORUM EĞER 4 SOKETE SAHİPSENİZ "ACCESSORY_SOCKET_MAX_SIZE = 3" olan kısmdaki sayının 4 olması yeterli
[CODE lang="python" title="Düzenlenen Kod"] if app.ENABLE_TOOLTIP_ACCESSORY:
def __AppendAccessoryMetinSlotInfo(self, metinSlot, mtrlVnum):
ACCESSORY_SOCKET_MAX_SIZE = 4

cur=min(metinSlot[0], ACCESSORY_SOCKET_MAX_SIZE)
end=min(metinSlot[1], ACCESSORY_SOCKET_MAX_SIZE)


affectType1, affectValue1 = item.GetAffect(0)
affectType2, affectValue2 = item.GetAffect(1)
affectType3, affectValue3 = item.GetAffect(2)

mtrlPos=0
mtrlList=[mtrlVnum]*cur+[player.METIN_SOCKET_TYPE_SILVER]*(end-cur)

if app.ENABLE_TOOLTIP_ACCESSORY:
attr_total = [0,0,0,0,0]
self.AppendSpace(5)
if mtrlVnum > 0 and end > 0:
item.SelectItem(mtrlVnum)
self.AppendTextLine(str(item.GetItemName()),self.CONDITION_COLOR)
self.AppendSpace(5)

socket_lv = metinSlot[2]
sockets=[]
i = 0

while(socket_lv > 0):
mod = int(socket_lv % 10)
sockets.append(int(mod))
socket_lv = int(socket_lv / 10)
i+=1

sockets.reverse()

#self.AppendTextLine(#self.AppendTextLine(n([str(i) for i in sockets])), 0xFF00b6d6)

height = self.toolTipHeight

for mtrl in mtrlList:
if app.ENABLE_TOOLTIP_ACCESSORY:
lv = 0
# if mtrl > 1:
if mtrl > 1 and mtrlPos < len(sockets):
lv = sockets[mtrlPos]


newP = 175
affectList1=[0, max(1, affectValue1*(5*lv)/int(newP)), max(1, affectValue1*(5*lv)/int(newP)), max(1, affectValue1*(5*lv)/int(newP)), max(1, affectValue1*(5*lv)/int(newP)), max(1, affectValue1*(5*lv)/int(newP)), max(1, affectValue1*(5*lv)/int(newP)), max(1, affectValue1*(5*lv)/int(newP)), max(1, affectValue1*(5*lv)/int(newP))]
affectList2=[0, max(1, affectValue2*(5*lv)/int(newP)), max(1, affectValue2*(5*lv)/int(newP)), max(1, affectValue2*(5*lv)/int(newP)), max(1, affectValue2*(5*lv)/int(newP)), max(1, affectValue2*(5*lv)/int(newP)), max(1, affectValue2*(5*lv)/int(newP)), max(1, affectValue2*(5*lv)/int(newP)), max(1, affectValue2*(5*lv)/int(newP))]
affectList3=[0, max(1, affectValue3*(5*lv)/int(newP)), max(1, affectValue3*(5*lv)/int(newP)), max(1, affectValue3*(5*lv)/int(newP)), max(1, affectValue3*(5*lv)/int(newP)), max(1, affectValue3*(5*lv)/int(newP)), max(1, affectValue3*(5*lv)/int(newP)), max(1, affectValue3*(5*lv)/int(newP)), max(1, affectValue3*(5*lv)/int(newP))]


affectString1 = self.__GetAffectString(affectType1, affectList1[mtrlPos+1])
affectString2 = self.__GetAffectString(affectType2, affectList2[mtrlPos+1])
affectString3 = self.__GetAffectString(affectType3, affectList3[mtrlPos+1])
if mtrl > 1:
if affectString1:
attr_total[0] += affectList1[mtrlPos+1]

if affectString2:
attr_total[1] += affectList2[mtrlPos+1]

if affectString3:
attr_total[2] += affectList3[mtrlPos+1]
else:
affectString1 = self.__GetAffectString(affectType1, affectList1[mtrlPos+1]-affectList1[mtrlPos])
affectString2 = self.__GetAffectString(affectType2, affectList2[mtrlPos+1]-affectList2[mtrlPos])
affectString3 = self.__GetAffectString(affectType3, affectList3[mtrlPos+1]-affectList3[mtrlPos])

leftTime = 0
if cur == mtrlPos+1:
leftTime=metinSlot[2]



if app.ENABLE_TOOLTIP_ACCESSORY:
self.__AppendMetinSlotInfo_AppendMetinSocketData_New(mtrlPos, mtrl, height, end, lv, leftTime)
else:
self.__AppendMetinSlotInfo_AppendMetinSocketData(mtrlPos, mtrl, affectString1, affectString2, affectString3, leftTime)
mtrlPos+=1

if app.ENABLE_TOOLTIP_ACCESSORY:
if end > 0:
if end > 4:
self.toolTipHeight += 70
else:
self.toolTipHeight += 35

self.ResizeToolTip()

affectString11 = self.__GetAffectString(affectType1, attr_total[0])
affectString22 = self.__GetAffectString(affectType2, attr_total[1])
affectString33 = self.__GetAffectString(affectType3, attr_total[2])


self.AppendSpace(5)
if affectString11:
self.AppendTextLine(affectString11, self.POSITIVE_COLOR)
if affectString22:
self.AppendTextLine(affectString22, self.POSITIVE_COLOR)
if affectString33:
self.AppendTextLine(affectString33, self.POSITIVE_COLOR)


self.ResizeToolTip()

if app.ENABLE_TOOLTIP_ACCESSORY:
def __AppendMetinSlotInfo_AppendMetinSocketData_New(self, index, metinSlotData, height=0, end=0, socket_lv=0, leftTime=0):
slotType = self.GetMetinSocketType(metinSlotData)
itemIndex = self.GetMetinItemIndex(metinSlotData)

if 0 == slotType:
return

slotImage = ui.ImageBox()
slotImage.SetParent(self)
slotImage.Show()



if player.METIN_SOCKET_TYPE_SILVER == slotType:
slotImage.LoadImage("d:/ymir work/ui/game/windows/metin_slot_silver.sub")
elif player.METIN_SOCKET_TYPE_GOLD == slotType:
slotImage.LoadImage("d:/ymir work/ui/game/windows/metin_slot_gold.sub")

self.childrenList.append(slotImage)


if index > 3:
height += 35
index = index-4

if end > 4:
end = 4

calc_x = (self.toolTipWidth/2) - (17.5*end)

slotImage.SetPosition(calc_x+index*35, height)

metinImage = ui.ImageBox()
metinImage.SetParent(slotImage)
metinImage.Show()
self.childrenList.append(metinImage)

lvText = ui.TextLine()
lvText.SetParent(metinImage)
lvText.SetFontName(self.defFontName)
lvText.SetPackedFontColor(self.CONDITION_COLOR)
lvText.SetOutline()
lvText.SetFeather()
# lvText.Show()
lvText.Hide()

self.childrenList.append(lvText)

if itemIndex:
item.SelectItem(itemIndex)

## Image
## try:
metinImage.LoadImage(item.GetIconImageFileName())
except:
dbg.TraceError("ItemToolTip.__AppendMetinSocketData() - Failed to find image file %d:%s" %
(itemIndex, item.GetIconImageFileName())
)

metinImage.SetPosition(1, 1)
lvText.SetPosition(6, 16)
lvText.SetText("Lv %d" % (socket_lv))

if 0 != leftTime:
timeText = (localeInfo.LEFT_TIME2 + " : " + localeInfo.SecondToDHM(leftTime))

timeTextLine = ui.TextLine()
timeTextLine.SetParent(self)
timeTextLine.SetFontName(self.defFontName)
timeTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
timeTextLine.SetPosition(50, self.toolTipHeight + 16 + 2 + 16 + 2)
timeTextLine.SetOutline()
timeTextLine.SetFeather()
timeTextLine.Show()
timeTextLine.SetText(timeText)
self.childrenList.append(timeTextLine)
self.toolTipHeight += 16 + 2
else:
def __AppendAccessoryMetinSlotInfo(self, metinSlot, mtrlVnum):
ACCESSORY_SOCKET_MAX_SIZE = 3

cur=min(metinSlot[0], ACCESSORY_SOCKET_MAX_SIZE)
end=min(metinSlot[1], ACCESSORY_SOCKET_MAX_SIZE)

affectType1, affectValue1 = item.GetAffect(0)
affectList1=[0, max(1, affectValue1*10/100), max(2, affectValue1*20/100), max(3, affectValue1*40/100)]

affectType2, affectValue2 = item.GetAffect(1)
affectList2=[0, max(1, affectValue2*10/100), max(2, affectValue2*20/100), max(3, affectValue2*40/100)]

mtrlPos=0
mtrlList=[mtrlVnum]*cur+[player.METIN_SOCKET_TYPE_SILVER]*(end-cur)
for mtrl in mtrlList:
affectString1 = self.__GetAffectString(affectType1, affectList1[mtrlPos+1]-affectList1[mtrlPos])
affectString2 = self.__GetAffectString(affectType2, affectList2[mtrlPos+1]-affectList2[mtrlPos])

leftTime = 0
if cur == mtrlPos+1:
leftTime=metinSlot[2]

self.__AppendMetinSlotInfo_AppendMetinSocketData(mtrlPos, mtrl, affectString1, affectString2, leftTime)
mtrlPos+=1[/CODE]​
 
Son düzenleme:
Paylaşım için teşekkürler
 

Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)

Geri
Üst