How do I update shop items?

From OHRRPGCE-Wiki
Jump to navigation Jump to search

There are several reasons to change shop contents, for example to upgrade to better options. Unfortunately there are no script commands yet for directly changing the content or current stock of a shop. That leaves two main options:

  • have tag-conditional "things" in the shop
  • have two or more separate shops and switch between them (in this case the shops won't share their stocks).

Before we start I assume that you have made a potion shop with several items and that the shop is already placed. If not, read Shops.

You also need to understand how to make an NPC saying something different later. In this example, our heroes learn after a battle that the potion shop owner has received new articles.

Using tag-conditional stock[edit]

This is the most simple and recommended way. We're going to use, as usual, tags and text boxes.

First "edit tag names" and create a tag called "new shop arrival". Suppose this tag has number 21.

Then we're going to need three text boxes. Normally you'd already have created the first one when you first placed your potion shop:

  Welcome to the potion shop! What can I do for you?

This text box has a Conditional to "always" go to shop: "potion shop"

The second text box which contains an NPC dialogue:

 We are not isolated any longer thanks to you. You should go to the potion shop! I think the owner
 have received new items. 
 

For this text box, edit the Conditionals to include:

 set tag: always do the following
   set tag 21 = ON (new shop arrival)

Edit your potion shop.

We're going to use the "buy require tag" setting. As the name states, you can buy the shop item only if the tag is on. Of course, if the old potions are still useful for the player, then you don't need to remove the old ones when the tag turns on.

So we assume that the heroes are around level 15 and that they don't need to buy basic potion which gives them back only 20hp and 30mp during battle. We want the shop owner to sell only new useful potion. To do so we need the use buy require setting and turn the tag off for all the old items. (Those items are going to disappear after the heroes learns that new items has arrived).

For each item go down and check the buy require line. Make sure you have

 hp potion buy require tag 21=off
 mp potion buy require tag 21=off
 ether buy require tag 21=off

Once it is done. You can add the new items.

This time, you turn the buy require tag on.

 hp+ potion buy require tag 21=on
 mp+ potion buy require tag 21=on
 ether+ buy require tag 21=on

And that's all folks!

Using two shops[edit]

This method is needed if the shop you want to update has or will hit the limit of 50 of item definitions.

Add a new shop and give it exactly the same name as the old one. Set up all the items in the shop. You'll need to manually duplicate anything in the old shop that you want to keep unchanged. Unfortunately there's no way to copy things from one shop to another. :(

Now simply edit the textbox that opens the original shop, and set a Conditional to go to another textbox instead when the "new shop arrival" tag is on. Set that new textbox will "always" open the new shop.


See Also[edit]