Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

How do I make a workable shop?

3 days ago
Hello! ^^ I'm new here, and a bit of a newbie to CYS script, so please forgive my ignorance--does anyone know where I could find an in-depth article about an in-game shop?

My idea is relatively simple, I'd just like to have an inventory of things (just one or multiple/infinite) the main character can buy with in-game money (variable), and potentially have the ability to buy things to "change" rooms (for example, their house at lvl 1 is big enough for one person. In order to move someone else in, they need lvl 2; they upgrade at the shop and now whenever they go to the home page, it's the new one from then on)--I hope I'm explaining this well enough!

These range from tangible items to other variables, as well.

I know this might be a very dumb question, I'm sorry if this has been asked a bunch of times before!!

How do I make a workable shop?

3 days ago
While not an exact match, these two articles might help.

How do I make a workable shop?

3 days ago
Player clicks a link to buy X, the script in the link says to add item X and adjust variable Y and Z. Once you know how to make and reference a variable, and change another variable based on that, you basically know how to do this or just about anything else that can be done with the base editor. It's just a matter of stringing it all together, and that's the part that can be tedious with no real shortcuts. You'll also need to put in global checks to ensure the amount they're spending doesn't take them below zero money and then give them the item anyway, and so on.

How do I make a workable shop?

3 days ago
This could also get complex, depending on what you're doing.

You mention an inventory of things affecting their location. Why? Is there a button/link/action that will take them "home?" If your home location varies, why? Will it always have the same links from it? In that case, you can use inline scripting to change the location based on variables instead of having a different page for the location. But if you want different options/links based on different home locations, that's different pages. So then you're looking at 5 pages for homes 1-5. Then you might need a secondary "home" page that actually just redirects the page based on a variable setting using the DEST variable.

That's outside of a shop of items to buy, which is just different.

How do I make a workable shop?

3 days ago
Thank you all for your replies, I feel so silly! Now to figure out why my VAR1 won't go down and my VAR2 will go up exponentially upon clicking the link regardless of VAR1 inventory...

How do I make a workable shop?

3 days ago
If you haven't already, you should go into the editor options on the Properties page and set everything there to advanced btw. That will let you use scripts more directly which may be necessary in some situations, or at least faster than the little plus/minus signs and checking boxes.