## Beginner needs help with purse

Hi, I completely new to this. Ive read the tutorial and am really excited about the possibilities and have started designing a game. I want to have a purse with coins of different denomination in it, that I can add to or take from. I'm sure many of you have done this. Would love to hear how. Many thanks.

Easiest way is to simply create a number of Squiffy attributes. Each attribute represents a coin of a different denomination.

You can then add or subtract coins at will, by modifying the attribute up or down.

With a bit of javascript you could also ad up the total value of all the coins too.

Thanks thetruespin.

I got this far but don't know how to "modify the attribute up or down" (i.e change the value.) I'm also unsure how to display or print the value of an attribute.

Sorry for the primitive question(s).

``````[[Room1]]
@inc QUARTERS 2
@inc DIMES 2
@inc NICKELS 2
@inc PENNIES 2
@inc CENTS 82

[[Room1]]:
You're in your room. You have a [purse].

[purse]:
The purse contains {QUARTERS} [quarters], {DIMES} dimes, {NICKELS} nickels, and {PENNIES} pennies, for a total of {CENTS} cents.

[quarters]:
Do you want to [drop](drop quarter) a quarter?

[drop quarter]:
@dec QUARTERS
@dec CENTS 25
Ok, you dropped one quarter.

[[Continue...]](Room1)
``````

That's a good working example. What you'll need to do next OP is develop it further, including some conditional logic so you can't spend money you don't have. That's where things might get a bit tricky, but you can probably just about handle it using Squiffy markdown without having to resort to Javascript.

Thanks for all this. Its very helpful. However I shouldn't have even posted this request in this forum as I'm working with Quest. (I don't even know what Squiffy is!)
Still I appreciate the time and help.

:s

here's a guide on learning the basics of scripting, the 'bread and butter' of coding/scripting, Attributes and the 'if' Script:

or

and here's a step by step guide demo game that you can make, teaching you the basics of using Attributes (including statusattributes):

or

ask if you need help, or whatever

Thanks
HK for posting these links. There is so much here I'm going to be a while going through it all. Your explanations are very clear and while some of what you have given here is familar alot is not, thus it will prove a great help to me.
Cheers

this is not easy stuff, you're delving into the world of coding, it took me awhile to learn this stuff myself when I first started/founded quest ~5 years ago. If you want to see my own struggles (I wanted to learn coding, so I jumped right into it, after the tutorial, starting with the 'character creation' guide by Pixie, but I was still so confused with all of the terms, jumbled up after I had gone through the tutorial, as I didn't really understand them and what I was doing fully, and it took quite awhile to start really understanding them and what I was doing --- HK edit: oops, first I too had trouble with the troll/bob/defibilator/saying Command stuff too, as it's definately the most advanced and hardest/confusing part of the tutorial):

or

This topic is now closed. Topics are closed after 60 days of inactivity.

Quest
Squiffy
ActiveLit

Documentation
Blog
GitHub

Forums