Jump to content

GF-Like Inventory Slot Marking System


Recommended Posts

  • 4 weeks later...
0129 19:54:19095 :: Traceback (most recent call last):

0129 19:54:19095 ::   File "networkModule.py", line 247, in SetGamePhase

0129 19:54:19096 ::   File "game.py", line 99, in __init__

0129 19:54:19096 ::   File "interfaceModule.py", line 352, in MakeInterface

0129 19:54:19096 ::   File "interfaceModule.py", line 181, in __MakeWindows

0129 19:54:19096 ::   File "uiInventory.py", line 266, in __init__

0129 19:54:19096 ::   File "uiInventory.py", line 375, in __LoadWindow

0129 19:54:19096 ::   File "uiInventory.py", line 293, in BindWindow

0129 19:54:19097 :: AttributeError
0129 19:54:19097 :: : 
0129 19:54:19097 :: 'InventoryWindow' object has no attribute 'bindWnds'
0129 19:54:19097 :: 

Hy guys!

 

I have problem ?

spacer.png

Link to comment
Share on other sites

  • 2 weeks later...
  • Premium

The system is working great on Martysama's source. I had the problem with the inventory pages at first.

A hint: do not use the edits on the comparable files he is just giving an example of how the files should look like.

https://metin2.download/picture/7fe60CcxRzbkgSG7J2ZZcFuP6t3uD26r/.gif

 

@HUNgarocel1

 

spacer.png

 

Check edits on uiinventory.py.

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 2
  • Confused 1
  • Good 2
  • Love 3
Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...
  • Premium

Got this problem

 

'NoneType' object has no attribute 'GetInventoryType'

 

	if app.WJ_ENABLE_TRADABLE_ICON:
		def CantTradableItem(self, destSlotIndex, srcSlotIndex):
			if app.ENABLE_SPECIAL_INVENTORY:
				invenType = player.GetSpecialInventoryTypeByGlobalSlot(srcSlotIndex)
				if invenType == player.INVENTORY_TYPE_INVENTORY:
					itemInvenPage = srcSlotIndex / player.INVENTORY_PAGE_SIZE
					localSlotPos = srcSlotIndex - (itemInvenPage * player.INVENTORY_PAGE_SIZE)
				else:
					(specialSlotStart, specialSlotEnd) = player.GetSpecialInventoryRange(invenType)
					specialInventorySlot = srcSlotIndex - specialSlotStart
					itemInvenPage = specialInventorySlot / player.INVENTORY_PAGE_SIZE
					localSlotPos = specialInventorySlot - (itemInvenPage * player.INVENTORY_PAGE_SIZE)
					
				self.lockedItems[destSlotIndex] = (invenType, itemInvenPage, localSlotPos)

				if self.wndInventory.GetInventoryType() == invenType and self.wndInventory.GetInventoryPageIndex() == itemInvenPage and self.IsShow():
					self.wndInventory.wndItem.SetCantMouseEventSlot(localSlotPos)

			else:
				itemInvenPage = srcSlotIndex / player.INVENTORY_PAGE_SIZE
				localSlotPos = srcSlotIndex - (itemInvenPage * player.INVENTORY_PAGE_SIZE)
				self.lockedItems[destSlotIndex] = (itemInvenPage, localSlotPos)
				if self.wndInventory.GetInventoryPageIndex() == itemInvenPage:
					self.wndInventory.wndItem.SetCantMouseEventSlot(localSlotPos)

 

anyone a solution for that (using great offshop)

Link to comment
Share on other sites

  • Bot
On 4/8/2018 at 3:13 AM, WLsj24 said:

Same problem, i have great offlineshop. Any kind person who can adapt the code for OfflineShops?

Sorry for reviving old posts, but maybe someone will find this helpful hehe.

game.py

	## PrivateShop
	def __PrivateShop_Open(self):
		if app.ENABLE_OFFLINE_SHOP:
			if app.WJ_ENABLE_TRADABLE_ICON:
				self.uiNewShopCreate.privateShopBuilder.BindInterface(self.interface)
				self.uiNewShopCreate.privateShopBuilder.SetInven(self.interface.wndInventory)
				self.uiNewShopCreate.privateShopBuilder.wndInventory.BindWindow(self.interface.privateShopBuilder)
			self.uiNewShop.Show()
		else:
			self.interface.OpenPrivateShopInputNameDialog()

 

  • Love 2

english_banner.gif

Link to comment
Share on other sites

  • 4 months later...
On 4/5/2020 at 4:08 PM, HUNgarocel1 said:

Hi Dev! :)

 

I have a little bug or something..

So i trade another player, and marking his item, not mine.

Img: YI8gbab.jpg

 

Please help for me
Best regards

 

 

The bug is from PythonNetworkStreamPhaseGame.cpp in Binary.

 

Search for :

 

                int iSlotIndex = exchange_packet.arg2.cell;
                CPythonExchange::Instance().SetItemToTarget(iSlotIndex, exchange_packet.arg1, (BYTE) exchange_packet.arg3);
                for (int i = 0; i < ITEM_SOCKET_SLOT_MAX_NUM; ++i)
                    CPythonExchange::Instance().SetItemMetinSocketToTarget(iSlotIndex, i, exchange_packet.alValues);
                for (int j = 0; j < ITEM_ATTRIBUTE_SLOT_MAX_NUM; ++j)
                    CPythonExchange::Instance().SetItemAttributeToTarget(iSlotIndex, j, exchange_packet.aAttr[j].bType, exchange_packet.aAttr[j].sValue);

 

And remove: 

#ifdef WJ_ENABLE_TRADABLE_ICON

...

#endif

 

 

 

Then, above you should see:

 

        case EXCHANGE_SUBHEADER_GC_ITEM_ADD:
            if (exchange_packet.is_me)

 

 

Add under  this function:

 

                    CPythonExchange::Instance().SetItemAttributeToSelf(iSlotIndex, j, exchange_packet.aAttr[j].bType, exchange_packet.aAttr[j].sValue);

 

 

the function you removed  previously. :) 

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • 6 months later...
  • 3 months later...
  • Premium

Hi.

 

I have this problem.

 

Quote

In function `CExchange::Cancel()':
/usr/src/mainline/Srcs/Server/game/src/exchange.cpp:916: undefined reference to `exchange_packet(CHARACTER*, unsigned char, bool, unsigned int, SItemPos, unsigned int, void*)'
OBJDIR/exchange.o: In function `CExchange::Accept(bool)':
/usr/src/mainline/Srcs/Server/game/src/exchange.cpp:907: undefined reference to `exchange_packet(CHARACTER*, unsigned char, bool, unsigned int, SItemPos, unsigned int, void*)'
/usr/src/mainline/Srcs/Server/game/src/exchange.cpp:908: undefined reference to `exchange_packet(CHARACTER*, unsigned char, bool, unsigned int, SItemPos, unsigned int, void*)'
OBJDIR/exchange.o: In function `CExchange::AddGold(long)':
/usr/src/mainline/Srcs/Server/game/src/exchange.cpp:256: undefined reference to `exchange_packet(CHARACTER*, unsigned char, bool, unsigned int, SItemPos, unsigned int, void*)'
/usr/src/mainline/Srcs/Server/game/src/exchange.cpp:273: undefined reference to `exchange_packet(CHARACTER*, unsigned char, bool, unsigned int, SItemPos, unsigned int, void*)'
OBJDIR/exchange.o:/usr/src/mainline/Srcs/Server/game/src/exchange.cpp:274: more undefined references to `exchange_packet(CHARACTER*, unsigned char, bool, unsigned int, SItemPos, unsigned int, void*)' follow
OBJDIR/exchange.o: In function `CExchange::Cancel()':
/usr/src/mainline/Srcs/Server/game/src/exchange.cpp:916: undefined reference to `exchange_packet(CHARACTER*, unsigned char, bool, unsigned int, SItemPos, unsigned int, void*)'
OBJDIR/exchange.o: In function `CExchange::Accept(bool)':
/usr/src/mainline/Srcs/Server/game/src/exchange.cpp:907: undefined reference to `exchange_packet(CHARACTER*, unsigned char, bool, unsigned int, SItemPos, unsigned int, void*)'
/usr/src/mainline/Srcs/Server/game/src/exchange.cpp:908: undefined reference to `exchange_packet(CHARACTER*, unsigned char, bool, unsigned int, SItemPos, unsigned int, void*)'
OBJDIR/exchange.o: In function `CExchange::AddGold(long)':
/usr/src/mainline/Srcs/Server/game/src/exchange.cpp:256: undefined reference to `exchange_packet(CHARACTER*, unsigned char, bool, unsigned int, SItemPos, unsigned int, void*)'
/usr/src/mainline/Srcs/Server/game/src/exchange.cpp:273: undefined reference to `exchange_packet(CHARACTER*, unsigned char, bool, unsigned int, SItemPos, unsigned int, void*)'
OBJDIR/exchange.o:/usr/src/mainline/Srcs/Server/game/src/exchange.cpp:274: more undefined references to `exchange_packet(CHARACTER*, unsigned char, bool, unsigned int, SItemPos, unsigned int, void*)' follow
 

 

tutorial:

Quote

// 1. Replace this function:
// ********************************* BEGIN ********************************* //
void exchange_packet(LPCHARACTER ch, BYTE sub_header, bool is_me, long long arg1, TItemPos arg2, DWORD arg3, void * pvData)
{
    if (!ch->GetDesc())
        return;

    struct packet_exchange pack_exchg;
    pack_exchg.header         = HEADER_GC_EXCHANGE;
    pack_exchg.sub_header     = sub_header;
    pack_exchg.is_me        = is_me;
    pack_exchg.arg1            = arg1;
    pack_exchg.arg2            = arg2;
    pack_exchg.arg3            = arg3;

    if (sub_header == EXCHANGE_SUBHEADER_GC_ITEM_ADD && pvData)
    {
        thecore_memcpy(&pack_exchg.alSockets, ((LPITEM) pvData)->GetSockets(), sizeof(pack_exchg.alSockets));
        thecore_memcpy(&pack_exchg.aAttr, ((LPITEM) pvData)->GetAttributes(), sizeof(pack_exchg.aAttr));
    }
    else
    {
        memset(&pack_exchg.alSockets, 0, sizeof(pack_exchg.alSockets));
        memset(&pack_exchg.aAttr, 0, sizeof(pack_exchg.aAttr));
    }

    ch->GetDesc()->Packet(&pack_exchg, sizeof(pack_exchg));
}
// ********************************** END ********************************** //
// With this:
// ********************************* BEGIN ********************************* //
void exchange_packet(LPCHARACTER ch, BYTE sub_header, bool is_me, long long arg1, TItemPos arg2, DWORD arg3, void * pvData)
{
    if (!ch->GetDesc())
        return;

    struct packet_exchange pack_exchg;
    pack_exchg.header         = HEADER_GC_EXCHANGE;
    pack_exchg.sub_header     = sub_header;
    pack_exchg.is_me        = is_me;
    pack_exchg.arg1            = arg1;
    pack_exchg.arg2            = arg2;
    pack_exchg.arg3            = arg3;

    if (sub_header == EXCHANGE_SUBHEADER_GC_ITEM_ADD && pvData)
    {
#ifdef WJ_ENABLE_TRADABLE_ICON
        pack_exchg.arg4 = TItemPos(((LPITEM) pvData)->GetWindow(), ((LPITEM) pvData)->GetCell());
#endif
        thecore_memcpy(&pack_exchg.alSockets, ((LPITEM) pvData)->GetSockets(), sizeof(pack_exchg.alSockets));
        thecore_memcpy(&pack_exchg.aAttr, ((LPITEM) pvData)->GetAttributes(), sizeof(pack_exchg.aAttr));
    }
    else
    {
#ifdef WJ_ENABLE_TRADABLE_ICON
        pack_exchg.arg4 = TItemPos(RESERVED_WINDOW, 0);
#endif
        memset(&pack_exchg.alSockets, 0, sizeof(pack_exchg.alSockets));
        memset(&pack_exchg.aAttr, 0, sizeof(pack_exchg.aAttr));
    }

    ch->GetDesc()->Packet(&pack_exchg, sizeof(pack_exchg));
}
// ********************************** END ********************************** //
 

 

Any idea :\?

Link to comment
Share on other sites

  • 3 months later...
On 6/7/2021 at 2:05 PM, Equinox said:

Hi.

 

I have this problem.

 

tutorial:

 

Any idea :\?

That s probably a linker issue. You have two functions with the same name but different parameters and its probably calling the wrong one. Try using gmake clean and recompile afterwards. 

 

I have this problem tho:

0929 14:02:30500 ::   File "game.py", line 782, in RefreshInventory

0929 14:02:30500 ::   File "interfaceModule.py", line 624, in RefreshInventory

0929 14:02:30500 ::   File "uiInventory.py", line 846, in RefreshItemSlot

0929 14:02:30501 ::   File "uiInventory.py", line 809, in RefreshBagSlotWindow

0929 14:02:30501 ::   File "uiInventory.py", line 729, in RefreshMarkSlots

0929 14:02:30501 ::   File "ui.py", line 1436, in SetUsableSlotOnTopWnd

0929 14:02:30501 :: AttributeError
0929 14:02:30501 :: : 
0929 14:02:30501 :: 'module' object has no attribute 'SetUsableSlotOnTopWnd'
0929 14:02:30501 :: 

0929 14:02:30505 :: 
game.py(line:223) Open
game.py(line:632) StartGame
game.py(line:782) RefreshInventory
interfaceModule.py(line:624) RefreshInventory
uiInventory.py(line:846) RefreshItemSlot
uiInventory.py(line:809) RefreshBagSlotWindow
uiInventory.py(line:729) RefreshMarkSlots
ui.py(line:1436) SetUsableSlotOnTopWnd

GameWindow.Open - <type 'exceptions.AttributeError'>:'module' object has no attribute 'SetUsableSlotOnTopWnd'

0929 14:02:30506 :: ============================================================================================================
0929 14:02:30506 :: Abort!!!!

Could someone throw a hand? xD Thx.

EDIT: SOLVED.

Edited by narcisxb
  • Think 1
Link to comment
Share on other sites

  • 1 month later...

Hello and thanks for this resource, could you do an update for the dice system as well?

or how could I disable the effect for the dice system?


https://metin2.download/picture/EQ698KiURBYOLyt0dNZ9tiAtRTRYp9Pm/.gif
 

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • 7 months later...
  • 5 months later...
  • 4 months later...

@ xP3NG3Rx

I have the following error, has anyone encountered it before? Or could you point me to a solution?
 

0412 07:16:14084 :: Traceback (most recent call last):

0412 07:16:14084 ::   File "networkModule.py", line 236, in SetGamePhase

0412 07:16:14084 ::   File "game.py", line 88, in __init__

0412 07:16:14084 ::   File "interfaceModule.py", line 454, in MakeInterface

0412 07:16:14084 ::   File "interfaceModule.py", line 293, in __MakeWindows

0412 07:16:14084 ::   File "uiInventory.py", line 351, in __init__

0412 07:16:14084 ::   File "uiInventory.py", line 490, in __LoadWindow

0412 07:16:14084 ::   File "uiAttachMetin.py", line 22, in __init__

0412 07:16:14084 ::   File "uiAttachMetin.py", line 22, in <dictcomp>

0412 07:16:14084 :: TypeError
0412 07:16:14084 :: : 
0412 07:16:14084 :: an integer is required
0412 07:16:14084 :: 

 

uiattachmetin.py

https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif.html

Edited by Metin2 Dev International
Core X - External 2 Internal
Link to comment
Share on other sites

  • Premium
34 minutes ago, evils666 said:

@ xP3NG3Rx

I have the following error, has anyone encountered it before? Or could you point me to a solution?
 

0412 07:16:14084 :: Traceback (most recent call last):

0412 07:16:14084 ::   File "networkModule.py", line 236, in SetGamePhase

0412 07:16:14084 ::   File "game.py", line 88, in __init__

0412 07:16:14084 ::   File "interfaceModule.py", line 454, in MakeInterface

0412 07:16:14084 ::   File "interfaceModule.py", line 293, in __MakeWindows

0412 07:16:14084 ::   File "uiInventory.py", line 351, in __init__

0412 07:16:14084 ::   File "uiInventory.py", line 490, in __LoadWindow

0412 07:16:14084 ::   File "uiAttachMetin.py", line 22, in __init__

0412 07:16:14084 ::   File "uiAttachMetin.py", line 22, in <dictcomp>

0412 07:16:14084 :: TypeError
0412 07:16:14084 :: : 
0412 07:16:14084 :: an integer is required
0412 07:16:14084 :: 

 

uiattachmetin.py

https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif.html

Why you dont compare with files which are included in this tutorial?


 

Link to comment
Share on other sites

  • 4 weeks later...
  • 3 months later...
On 9/29/2021 at 12:36 PM, narcisxb said:

That s probably a linker issue. You have two functions with the same name but different parameters and its probably calling the wrong one. Try using gmake clean and recompile afterwards. 

 

I have this problem tho:

0929 14:02:30500 ::   File "game.py", line 782, in RefreshInventory

0929 14:02:30500 ::   File "interfaceModule.py", line 624, in RefreshInventory

0929 14:02:30500 ::   File "uiInventory.py", line 846, in RefreshItemSlot

0929 14:02:30501 ::   File "uiInventory.py", line 809, in RefreshBagSlotWindow

0929 14:02:30501 ::   File "uiInventory.py", line 729, in RefreshMarkSlots

0929 14:02:30501 ::   File "ui.py", line 1436, in SetUsableSlotOnTopWnd

0929 14:02:30501 :: AttributeError
0929 14:02:30501 :: : 
0929 14:02:30501 :: 'module' object has no attribute 'SetUsableSlotOnTopWnd'
0929 14:02:30501 :: 

0929 14:02:30505 :: 
game.py(line:223) Open
game.py(line:632) StartGame
game.py(line:782) RefreshInventory
interfaceModule.py(line:624) RefreshInventory
uiInventory.py(line:846) RefreshItemSlot
uiInventory.py(line:809) RefreshBagSlotWindow
uiInventory.py(line:729) RefreshMarkSlots
ui.py(line:1436) SetUsableSlotOnTopWnd

GameWindow.Open - <type 'exceptions.AttributeError'>:'module' object has no attribute 'SetUsableSlotOnTopWnd'

0929 14:02:30506 :: ============================================================================================================
0929 14:02:30506 :: Abort!!!!

Could someone throw a hand? xD Thx.

EDIT: SOLVED.

how did you solve it? sorry for recalling old post

Link to comment
Share on other sites

  • 2 months later...

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.