Hik 108 Posted October 3, 2017 Share Posted October 3, 2017 Hi guys, I have a problem I can not solve: 1003 20:27:28537 :: SYSERR: File "networkModule.py", line 231, in SetGamePhase 1003 20:27:28538 :: SYSERR: File "game.py", line 91, in __init__ 1003 20:27:28539 :: SYSERR: File "interfaceModule.py", line 341, in MakeInterface 1003 20:27:28540 :: SYSERR: File "interfaceModule.py", line 198, in __MakeWindows 1003 20:27:28540 :: SYSERR: File "uiInventory.py", line 274, in __init__ 1003 20:27:28540 :: SYSERR: File "uiInventory.py", line 417, in __LoadWindow 1003 20:27:28541 :: SYSERR: File "uiInventory.py", line 486, in SetInventoryPage 1003 20:27:28541 :: SYSERR: File "uiInventory.py", line 557, in RefreshBagSlotWindow 1003 20:27:28541 :: SYSERR: TypeError 1003 20:27:28542 :: SYSERR: : 1003 20:27:28542 :: SYSERR: an integer is required def RefreshBagSlotWindow(self): is_activated = 0 getItemVNum=player.GetItemIndex getItemCount=player.GetItemCount setItemVNum=self.wndItem.SetItemSlot for i in xrange(player.INVENTORY_PAGE_SIZE): slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i) itemCount = getItemCount(slotNumber) if 0 == itemCount: self.wndItem.ClearSlot(i) continue elif 1 == itemCount: itemCount = 0 itemVnum = getItemVNum(slotNumber) setItemVNum(i, itemVnum, itemCount) if itemVnum == 0 and slotNumber in self.liHighlightedItems: self.liHightlightedItems.remove(slotNumber) if constInfo.IS_AUTO_POTION(itemVnum): metinSocket = [player.GetItemMetinSocket(slotNumber, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)] isActivated = 0 != metinSocket[0] if isActivated: self.wndItem.ActivateSlot(i) potionType = 0; if constInfo.IS_AUTO_POTION_HP(itemVnum): potionType = player.AUTO_POTION_TYPE_HP elif constInfo.IS_AUTO_POTION_SP(itemVnum): potionType = player.AUTO_POTION_TYPE_SP usedAmount = int(metinSocket[1]) totalAmount = int(metinSocket[2]) player.SetAutoPotionInfo(potionType, isActivated, (totalAmount - usedAmount), totalAmount, self.__InventoryLocalSlotPosToGlobalSlotPos(i)) else: self.wndItem.DeactivateSlot(i) else: self.wndItem.DeactivateSlot(i) self.__RefreshHighlights() if app.ENABLE_SASH_SYSTEM: slotNumberChecked = 0 for j in xrange(sash.WINDOW_MAX_MATERIALS): (isHere, iCell) = sash.GetAttachedItem(j) if isHere: if iCell == slotNumber: self.wndItem.ActivateSlot(i, (36.00 / 255.0), (222.00 / 255.0), (3.00 / 255.0), 1.0) if not slotNumber in self.listAttachedSashs: self.listAttachedSashs.append(slotNumber) slotNumberChecked = 1 else: if slotNumber in self.listAttachedSashs and not slotNumberChecked: self.wndItem.DeactivateSlot(i) self.listAttachedSashs.remove(slotNumber) self.wndItem.RefreshSlot() if self.wndBelt: self.wndBelt.RefreshSlot() How can I fix it? Thanks in advance Link to comment Share on other sites More sharing options...
Developer Ikarus_ 2427 Posted October 3, 2017 Developer Share Posted October 3, 2017 can u tell me which of these is line 557? Usually this error is done in a xrange. My youtube channel on which you can see my works here Link to comment Share on other sites More sharing options...
Hik 108 Posted October 4, 2017 Author Share Posted October 4, 2017 Yes: for i in xrange(player.INVENTORY_PAGE_SIZE): <---- 557 Link to comment Share on other sites More sharing options...
Hik 108 Posted October 6, 2017 Author Share Posted October 6, 2017 up Link to comment Share on other sites More sharing options...
Developer Ikarus_ 2427 Posted October 6, 2017 Developer Share Posted October 6, 2017 search in PythonPlayerModule "INVENTORY_PAGE_SIZE" I think it should be a PyIntConstant My youtube channel on which you can see my works here Link to comment Share on other sites More sharing options...
Hik 108 Posted October 6, 2017 Author Share Posted October 6, 2017 PyModule_AddIntConstant (poModule, "INVENTORY_PAGE_SIZE", c_Inventory_Page_Size); const DWORD c_Inventory_Page_Size = 45 Link to comment Share on other sites More sharing options...
Developer Ikarus_ 2427 Posted October 7, 2017 Developer Share Posted October 7, 2017 const DWORD c_Inventory_Page_Size = 45 Do you have #ifdef in the c++ that may result in this constant not being compiled? My youtube channel on which you can see my works here Link to comment Share on other sites More sharing options...
Hik 108 Posted October 7, 2017 Author Share Posted October 7, 2017 No, there are no #ifdef. I can not really understand what the problem is ... Link to comment Share on other sites More sharing options...
Developer Ikarus_ 2427 Posted October 9, 2017 Developer Share Posted October 9, 2017 a stupid question.... do you have an import player among imports of uiinventory? My youtube channel on which you can see my works here Link to comment Share on other sites More sharing options...
Hik 108 Posted October 9, 2017 Author Share Posted October 9, 2017 (edited) Yes, is imported. Spoiler Edited September 3, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Developer Ikarus_ 2427 Posted October 10, 2017 Developer Share Posted October 10, 2017 try to change "i" with "index" , I think that "i" is something else. replace this : Spoiler for i in xrange(player.INVENTORY_PAGE_SIZE): slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i) itemCount = getItemCount(slotNumber) if 0 == itemCount: self.wndItem.ClearSlot(i) continue elif 1 == itemCount: itemCount = 0 itemVnum = getItemVNum(slotNumber) setItemVNum(i, itemVnum, itemCount) if itemVnum == 0 and slotNumber in self.liHighlightedItems: self.liHightlightedItems.remove(slotNumber) if constInfo.IS_AUTO_POTION(itemVnum): metinSocket = [player.GetItemMetinSocket(slotNumber, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)] isActivated = 0 != metinSocket[0] if isActivated: self.wndItem.ActivateSlot(i) potionType = 0; if constInfo.IS_AUTO_POTION_HP(itemVnum): potionType = player.AUTO_POTION_TYPE_HP elif constInfo.IS_AUTO_POTION_SP(itemVnum): potionType = player.AUTO_POTION_TYPE_SP usedAmount = int(metinSocket[1]) totalAmount = int(metinSocket[2]) player.SetAutoPotionInfo(potionType, isActivated, (totalAmount - usedAmount), totalAmount, self.__InventoryLocalSlotPosToGlobalSlotPos(i)) else: self.wndItem.DeactivateSlot(i) else: self.wndItem.DeactivateSlot(i) with this : Spoiler for index in xrange(player.INVENTORY_PAGE_SIZE): slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(index) itemCount = getItemCount(slotNumber) if 0 == itemCount: self.wndItem.ClearSlot(index) continue elif 1 == itemCount: itemCount = 0 itemVnum = getItemVNum(slotNumber) setItemVNum(index, itemVnum, itemCount) if itemVnum == 0 and slotNumber in self.liHighlightedItems: self.liHightlightedItems.remove(slotNumber) if constInfo.IS_AUTO_POTION(itemVnum): metinSocket = [player.GetItemMetinSocket(slotNumber, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)] isActivated = 0 != metinSocket[0] if isActivated: self.wndItem.ActivateSlot(index) potionType = 0; if constInfo.IS_AUTO_POTION_HP(itemVnum): potionType = player.AUTO_POTION_TYPE_HP elif constInfo.IS_AUTO_POTION_SP(itemVnum): potionType = player.AUTO_POTION_TYPE_SP usedAmount = int(metinSocket[1]) totalAmount = int(metinSocket[2]) player.SetAutoPotionInfo(potionType, isActivated, (totalAmount - usedAmount), totalAmount, self.__InventoryLocalSlotPosToGlobalSlotPos(index)) else: self.wndItem.DeactivateSlot(index) else: self.wndItem.DeactivateSlot(index) 1 My youtube channel on which you can see my works here Link to comment Share on other sites More sharing options...
Hik 108 Posted October 10, 2017 Author Share Posted October 10, 2017 Same error xD Link to comment Share on other sites More sharing options...
Developer Ikarus_ 2427 Posted October 28, 2017 Developer Share Posted October 28, 2017 at beginnig of the file write COUNT_SLOT = player.INVENTORY_PAGE_SIZE than in the for cicle replace player.INVENTORY_PAGE_SIZE with COUNT_SLOT My youtube channel on which you can see my works here Link to comment Share on other sites More sharing options...
Sidelekbrytro 2 Posted February 9, 2023 Share Posted February 9, 2023 On 10/28/2017 at 3:33 PM, Ikarus_ said: at beginnig of the file write COUNT_SLOT = player.INVENTORY_PAGE_SIZE than in the for cicle replace player.INVENTORY_PAGE_SIZE with COUNT_SLOT Got the same problem, and this is not working... Another solution maybe? Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now