Help with RPG-style Elements [Twine Sugarcube]

hi all i am still new to twine and i am requiering a little bit of help pleas basicaly i am doing a survivle type interactive story but i wold like help with a fue things pleas

now the things i am wanting help with
1: a heath bar
2: a type of inventory system
this is self exsplanetory but i am wanting so some items have a durability but also have the ability to be repaired
3: a money system
4: a skill system
so the reader and chose to “leval up” skills and depending on what skills they pick it can change the story

now i know i dont nesaseryaly need to add code in i could just use meany meany more pages but this would make it easyer for me

Hi Sam. I’ve made a very basic game in sugarcube that has it all except the health bar (it uses numbers). While the code is not commented, maybe you could use it as an example: https://janosbiro.itch.io/space-snacks. Get the HTML file and import it into Twine to see the code.

Some comments: the inventory system is probably the most complex of these features. There are a few options for you here: Chapel’s Simple Inventory System and HiEv’s Universal Inventory System are the ones that I know of. They both require you to add some code to the JavaScript section of your story and I suggest you read the instructions carefully to learn how to use them. The Universal Inventory System has more options but will require more tweaking. I haven’t used any of them yet so I can’t say exactly how to add item durability, though I think the Universal Inventory System is probably more suitable for that. I’ve build my own inventory system without JavaScript based on this example and it suit my needs. I guess you will need some coding skills to get what you want.

There are a few options for the health bar. Again my references are The Meter Macro Set by Chapel, the Health Bar sample code by HiEv and this example from the Twine Cookbook.

The money system is the simplest one, you just have learn how to use variables and the set macro, basically. For the skill system you can use this example.

1 Like