Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Quick question

I'm sure someone has probably asked this before and/or the answer is staring me in the face,
but I just can't seem to find it and so I must ask:

How can I make it so only certain stores/vendors will buy items from you (some stores will buy and sell, most will just sell)?

Many thanks for your help with this.
 
Thanks for the tip - I didn't find anything at all when I was making general searches, but since I now know it takes a script I finally found one (just one, but that's all I needed anyway). In case anyone else wants to know, it's here:

viewtopic.php?f=11&t=67223&hilit=shop+script

Edit: One thing I don't like about this one is that it's designed mainly to exclude certain items,
so you can still select the "sell" option and see all of your items unsellable.

If anyone finds a script that completely bars access to the "sell" menu I'd love to know where you got it - Thanks!
 
Well you could use a show choices command and conditional branches to event the shop system (It's easy) and exclude the selling option.


You could even have the shop owner event transfer you do an entirely different map that you use for making a full shop system with pictures and stuff. That's what I'd do.
 
Let's see if I understand your meaning here, I got the second part, but am uncertain about the second.
Do you mean to show choices as in "Would you like to buy this?"/"What would you like to buy" (with choices) sort of thing and then conditional branches for whether or not they have enough gold (etc.)?
I do have a couple specialty shops like that right now, not sure if I'd like it in all my shops...
Well, I'll consider it.
Thank you for your (semi)omnipresent aid, Kiriashi :)
 
:) Yeah I was a few minutes off. :p

Basically the event would look like this:

@>Show Text:
@>Label: mahlabel
@>Show Choices: (If you do the label thing, then make sure the player can use escape to exit.
>___Choice1
>___Conditional Branch: Gold equal to or greater than x
>_____Play SE:
>_____Change Items:
>_____Change gold: decrease by x
>_____Show Text:
>___Else
>___Show Text: NOT ENOUGH MUNNIES!!!
@>Jump to label: mahlabel

And then so on.


As for the picture scenario, I would make a new map and use a tileset to make the windows and such of my shop, and I would make it so that the player can select more than four options (curse you show choices!), and I wouldn't event to ability to sell items. :)
 
Ah guys, in times of script-based RPG Maker versions, noone should be left with eventing shop systems anymore... especially since it involves barely any scripting if you just want to enable/disable the buy and sell options. I'd do it like this:

First, you need a range of states your shop system can have, for example:

0 - buy and sell
1 - buy only
2 - sell only

You pack that into a variable, meaning before your Shop call with event commands, you place a call script event command and set $game_system.shop_type = AnInteger, namely to one of the above three numbers.

To not get a syntax error from that, go to Game_System in your script editor, and look for the first section where it says "attr_accessor" quite a few times. Add attr_accessor :shop_type underneath all of them.
Now find the initialize section, storing a number of variables starting with @s. Add your own one underneath, like this: @shop_type = 0.
You just created an operable variable within the Game_System class (referenceable by $game_system) that's default value is 0 and that's allowed to be modified from other classes (which is what we need the attr_accessor for).

Now you need to modify your shop system within Scene_Shop. Now this depends on the RM version you have (XP or VX), so I can't really help ya out from here without knowing that. You can try to figure it out yourself by looking at the code though - it's not hard!

Good luck.
 
BlueScope~ I'll try that out some time I'm feeling more adventuresome.
Oh, I'm using xp, by the way.

Kiriashi~ Yeah, that's what I figured you meant. I have a couple stores that use eventing like that without the picture part.
The player basically walks around the store and picks out what they want (almost like real life)
 
What Kiriashi talks about isn't a walk-around system like you mean - only technically: Imagine the image of what you want your menu to look like put as a map background (or well, pictures), and have your avatar's sprite replaced by a cursor. Now, on the ground, there'd be events working by button triggered actions. For example, if your avatar stands one field left of "Potion" and you press the confirm button, there's an action triggered that could for example check if you have full health, and if you don't, remove one potion from your items and heal your character. This is the way people were doing custom systems of all sorts before RPG Makers had script support.

There are a quadruple of reasons not to do this in RMXP/RMVX - most of them are related to scripts being more efficient, easier to use, more versatile, and - only important if you want to share them afterwards or work in teams - not a pain to exchange between multiple people. From a functionality perspective, event-based menu/battle/shop systems are outdated and highly inferior to script-based systems, from ANY (literally) point of view. The only appliance method I can imagine would be contests, but yeah...

And remember to check out the RGSS Support forums, which have many helpful people around to help ya with this script - which really is easy.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top