Jump to content

Remote Shop System


Recommended Posts

  • Honorable Member

M2 Download Center

This is the hidden content, please
( Internal )

This is the hidden content, please
( GitHub )

 

 

  • Now you can open shops directly.
  • There is no need to adjust the coordinates when adding a new shop. Automatically adjusted according to the shop names.(remote_shop_names.txt)

 

  • For new shop:

  • Spoiler
    1. locale/xx/remote_shop_names.txt
    2. Add npc vnums to input_main.cpp (_arrShopNpcVnum

    npc vnum = player.shop(npc_vnum)

 

305225system.png

 

Special thanks to @Tatsumaru for taskbar Icons ❤️:

305225icon-1.png
305225icon-2.png

Edited by Mali61
  • Metin2 Dev 161
  • kekw 2
  • Dislove 1
  • Not Good 1
  • Sad 1
  • Think 3
  • Scream 1
  • Good 34
  • Love 8
  • Love 110

 

Link to comment
Share on other sites

4 hours ago, DemOnJR said:

Working.

If someone have the button .sub i need it idk why the tga is not working for me, thanks.

  Hide contents

 

spacer.png

spacer.png

 

 



just rename tga files , change big letters to small like that

 

before : 

 

RemoteShop_Button_01.tga

 

after :

 

remoteshop_button_01.tga

 

( do that to all tga )

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

  • Premium
10 hours ago, TryHard said:



just rename tga files , change big letters to small like that

 

before : 

 

RemoteShop_Button_01.tga

 

after :

 

remoteshop_button_01.tga

 

( do that to all tga )

Thanks ❤️

 

Oh No Reaction GIF

Edited by Metin2 Dev
Core X - External 2 Internal

🙂

Link to comment
Share on other sites

  • 2 weeks later...
On 1/21/2021 at 7:38 PM, Mali61 said:

M2 Download Center

This is the hidden content, please
( Internal )

This is the hidden content, please
( GitHub )

 

 

  • Now you can open shops directly.
  • If the shop's npc is not on player's map, you cannot open that shop.
  • There is no need to adjust the coordinates when adding a new shop. Automatically adjusted according to the shop names.(remote_shop_names.txt)

 

  • For new shop:

  •   Reveal hidden contents
    1. locale/xx/remote_shop_names.txt
    2. Add npc vnums to input_main.cpp (_arrShopNpcVnum

    npc vnum = player.shop(npc_vnum)

 

305225system.png

 

Special thanks to @Tatsumaru for taskbar Icons ❤️:

305225icon-1.png
305225icon-2.png

 

Is it possible to change the code, so you can open the shops although the NPC is not on the current map? I think this would be the benefit of using this remote shop.

Edited by DevBlade
  • Metin2 Dev 3
  • Think 1
Link to comment
Share on other sites

1 hour ago, DevBlade said:

 

Is it possible to change the code, so you can open the shops although the NPC is not on the current map? I think this would be the benefit of using this remote shop.


no its not possible, you will need to modify the source structure, its simply not made for changes like that. You know? P2P (core to core communication) something like this exist for npc too.


Google for npcToNpc communication. You can learn a lot my friend

Edited by Kafa
  • Lmao 1
Link to comment
Share on other sites

2 hours ago, Kafa said:


no its not possible, you will need to modify the source structure, its simply not made for changes like that. You know? P2P (core to core communication) something like this exist for npc too.


Google for npcToNpc communication. You can learn a lot my friend

i saw some servers with similar system that opens shop from any map. Idk if is the same system or not

 

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

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

  • Honorable Member
9 hours ago, DevBlade said:

 

Is it possible to change the code, so you can open the shops although the NPC is not on the current map? I think this would be the benefit of using this remote shop.

#Updated

use shop.vnum

  • Love 2

 

Link to comment
Share on other sites

  • 3 months later...
  • 5 months later...

Edit : Fixed. 

npc vnum = player.shop(npc_vnum) WRONGGGG

player.shop open (vnum) true

Example : 

1    ????    9001
2    ?????    9009
3    ????    9003
4    ?????    9002

9001 wrong
1 true

also

The market name is not written. Market name : None 🙂

spacer.png

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

  • Silver

The tutorial is complete, for those who have problems with this "pack_open" not defined

Search:
ShopData = pack_open(REMOTE_FILE_NAME, "r").readlines()

Change with:
ShopData = open(REMOTE_FILE_NAME, "r").readlines()

And if you have problem with buying items is from ENABLE_MULTISHOP, you have to adapt the system in localeinfo.py and uishop.py in function AskBuyItem.

 

70,75,48 is from your mysql player -> shop_item (Vnum where is opening the shop with items "doing what you want") 

Example:

Like in my case ->shop item : Vnum (3 is to open the window with weapons and where you find items)

In player -> shop you have (Shop vnum - (3), Name (bla bla), NPC - Npc vnum (9001) ) example

In remote_shop_names.txt you have to put them like how in input_main.cpp vnum it is. Example (3, )

Locale- 3 go first and name in remote_shop_names.txt -> Weapons

If we go for a new shop (Do same like weapons and go in input_main.cpp vnum in row 3, 4, 5) and in remote shop again do that

3 = Weapons

4 = Armors

5 = General.

SJ8Tn36.png - How Input_main.cpp how looks

How remote_shop_names looks.

NEgcgHn.png

Sorry for bad english and bad "explain", i just woke up. I hope you understood the idea.

10 hours ago, EAkar said:

70, 75, 48, 107

 

Are there npc codes in mob_proto in these numbers 🙂

9001 9002 9003 these codes are not.

1    ????    9001
2    ?????    9009
3    ????    9003
4    ?????    9002

8 hours ago, EAkar said:

Edit : Fixed. 

npc vnum = player.shop(npc_vnum) WRONGGGG

player.shop open (vnum) true

Example : 

1    ????    9001
2    ?????    9009
3    ????    9003
4    ?????    9002

9001 wrong
1 true

also

The market name is not written. Market name : None 🙂

spacer.png

"Market name is working" aswell, maybe u missed something from tutorial.

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

11 hours ago, Vaynz said:

The tutorial is complete, for those who have problems with this "pack_open" not defined

Search:
ShopData = pack_open(REMOTE_FILE_NAME, "r").readlines()

Change with:
ShopData = open(REMOTE_FILE_NAME, "r").readlines()

And if you have problem with buying items is from ENABLE_MULTISHOP, you have to adapt the system in localeinfo.py and uishop.py in function AskBuyItem.

 

70,75,48 is from your mysql player -> shop_item (Vnum where is opening the shop with items "doing what you want") 

Example:

Like in my case ->shop item : Vnum (3 is to open the window with weapons and where you find items)

In player -> shop you have (Shop vnum - (3), Name (bla bla), NPC - Npc vnum (9001) ) example

In remote_shop_names.txt you have to put them like how in input_main.cpp vnum it is. Example (3, )

Locale- 3 go first and name in remote_shop_names.txt -> Weapons

If we go for a new shop (Do same like weapons and go in input_main.cpp vnum in row 3, 4, 5) and in remote shop again do that

3 = Weapons

4 = Armors

5 = General.

SJ8Tn36.png - How Input_main.cpp how looks

How remote_shop_names looks.

NEgcgHn.png

Sorry for bad english and bad "explain", i just woke up. I hope you understood the idea.

"Market name is working" aswell, maybe u missed something from tutorial.

I installed the system without any problems. I guess it doesn't match.

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

  • 9 months later...
Quote


:23: error: cannot initialize a parameter of type 'DWORD' (aka 'unsigned int') with an rvalue of type 'std::nullptr_t'
        pkShop->AddGuest(ch, NULL, false);
                             ^~~~
/usr/include/sys/_null.h:37:14: note: expanded from macro 'NULL'compile input_udp.cpp

#define NULL    nullptr
                ^~~~~~~
./shop.h:47:46: note: passing argument to parameter 'owner_vid' here
                virtual bool    AddGuest(LPCHARACTER ch,DWORD owner_vid, bool bOtherEmpire);
 

how i solve this ?

Link to comment
Share on other sites

  • 7 months later...

0320 15:26:18167 :: Traceback (most recent call last):

0320 15:26:18167 ::   File "networkModule.py", line 285, in SetGamePhase

0320 15:26:18167 ::   File "game.py", line 135, in __init__

0320 15:26:18167 ::   File "interfaceModule.py", line 778, in MakeInterface

0320 15:26:18167 ::   File "interfaceModule.py", line 374, in __MakeTaskBar

0320 15:26:18167 ::   File "uiTaskBar.py", line 740, in LoadWindow

0320 15:26:18167 ::   File "ui.py", line 6253, in GetChild

0320 15:26:18167 :: KeyError
0320 15:26:18167 :: : 
0320 15:26:18167 :: 'RemoteShop'
0320 15:26:18167 :: 
 

Link to comment
Share on other sites

  • 1 month later...
  • 10 months later...
On 8/7/2022 at 6:29 PM, raihan3 said:
Quote


:23: error: cannot initialize a parameter of type 'DWORD' (aka 'unsigned int') with an rvalue of type 'std::nullptr_t'
        pkShop->AddGuest(ch, NULL, false);
                             ^~~~
/usr/include/sys/_null.h:37:14: note: expanded from macro 'NULL'compile input_udp.cpp

#define NULL    nullptr
                ^~~~~~~
./shop.h:47:46: note: passing argument to parameter 'owner_vid' here
                virtual bool    AddGuest(LPCHARACTER ch,DWORD owner_vid, bool bOtherEmpire);
 

how i solve this ?

Change in input_main.cpp

FROM
pkShop->AddGuest(ch, null, false);

TO
pkShop->AddGuest(ch, ch->GetVID(), false);

@raihan3 I get this problem and solve with this change, try this.

Link to comment
Share on other sites

@ Mali
When i open the shop with the Remote Shop, the window cames with a close button "Fechar Loja"(Close Store),

But it is the same button to close private shop, and the window don't close even doing the dialog process. The window still open, nothing happen
Can you say, how i can remove this button or put the right "Cose" button there? 

Gif:



Thanks in advance

Edited by damzaffari
Link to comment
Share on other sites



×
×
  • 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.