Jump to content
  • 0

Open shop during NPC script?


GreenMagic793

Question


  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  157
  • Reputation:   18
  • Joined:  08/18/15
  • Last Seen:  

Hey guys,

 

Let's say I have an NPC that talks to the player, and after a brief discussion, I want it to open a shop window just like a regular tool dealer. Is this possible? Is there any way I can set a shop as a function to be called upon? Or, is this entirely impossible and shops can never be open from an NPC window? Thanks for your input.

 

 

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  157
  • Reputation:   18
  • Joined:  08/18/15
  • Last Seen:  

Well, that was simple /oops

 

I have a question however. How do you choose which shop the script will call upon? If I just put: callshop "Tool Dealer",0;, then wouldn't that cause an error by calling on any NPC named Tool Dealer?

sec_in02,137,162,5	script	Test Dealer	828,{

mes "Would you like to access the shop?";
menu "Yes.",A_1,"No.",A_2;

A_1:
callshop "Tool Dealer",0;
close;

A_2:
close;

}

For example, I tried this script, and it mostly works but once I get to the sell/buy window, once I click on an option the box simply disappears and no window comes up. Am I missing something?

Edited by greenmagic469
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  452
  • Reputation:   33
  • Joined:  12/18/14
  • Last Seen:  

Aren't there usually hidden names attached to those Tool Dealer npcs? Like Tool Dealer#1234?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  157
  • Reputation:   18
  • Joined:  08/18/15
  • Last Seen:  

I thought the exact same thing so I tried one of the invisible names as well- no dice. I'm not sure why it isn't working...

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   2
  • Joined:  11/10/15
  • Last Seen:  

-	shop	Tool Dealer	-1,ID:PRICE

did you have that anywhere in the file?

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  157
  • Reputation:   18
  • Joined:  08/18/15
  • Last Seen:  

No, does that need to be in the same document as the script using callshop? I've been trying to call upon a shop from the shops.txt document.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   2
  • Joined:  11/10/15
  • Last Seen:  

I think so. btw I just tried changing the shop name to "sss" and it works (included that thing I posted above in the same file). using "Tool Dealer" didn't work.

Edited by Varyss
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  157
  • Reputation:   18
  • Joined:  08/18/15
  • Last Seen:  

I didn't get to actually try this out till recently, but you were correct. I just put my shop script in the invoking script and gave it a unique name and it worked. I guess it just needs to be in the file. Thanks mate.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...