Is there a way to create and display a percentage similar to Health?

Title pretty much says it all.
I'm trying to create a simple survival simulator using Quest and I would like to be able to display more than one status bar to the player. Things like Hunger, Thirst, or Warmth. Has anyone done this before, if so, how?


Well, Quest doesn't have a health bar by default.
If you have one, you've probably imported a library or followed a tutorial that adds it.

If you were following one of the health bar tutorials, just do the same thing again for each bar you want to add. Any more detail will depend on which bar you're using.


Multiple status bars is totally doable. I have a bunch in my framework.

Can you link whatever it is you were following to get your first one working, first?


Pykrete, Tertiary didn't say he followed any tutorials, but mrangel said he might have. I know Tertiary may come out and say he was following a tutorial, I'm just being nitpicky.

Here is the standard tutorial for health, score, and money that someone might find useful.
https://docs.textadventures.co.uk/quest/score_health_money.html


The fact that he specified 'more than one' implies that they have.

As for the default health, score and money attributes in Quest (which don't have status bars); my advice? Ignore them. There's zero reason to use them with all their restrictions when you can very easily make your own with complete freedom.

Here's how mine look, btw. https://i.gyazo.com/70f8ef8618f97f2f1a752f5195e70a22.png

(The icons are set as a background image and there's some minor CSS tweaks outside of the colourscheme, but you get the idea. These bars in particular animate when a stat changes, gradually increasing/decreasing instead of just blipping to their new value - credit to Angel for helping me with that a while back, actually!)


Text adventure Quest games do have a default option to display a Health bar as a percentage under the "Status" drop down menu.
The option to turn it is in the "game" object under "Features."

I didn't follow a tutorial, haha. It's just the default display, right now. I'll look for a tutorial, though. Thanks.


Text adventure Quest games do have a default option to display a Health bar as a percentage under the "Status" drop down menu.
The option to turn it is in the "game" object under "Features."

I wasn't sure because you said a "status bar".
Normally, I would expect a "bar" to be something graphical, not just a line of text.

If you're just after text, you can go to "Status attributes", either on the "Player" tab of the game, or somewhere on the player object (although this doesn't seem to work on the online editor).


Oh man, I completely forgot about that Health option. I think I abandoned it early because a lot of its behaviour is kind of baked in. My bad!

https://docs.textadventures.co.uk/quest/custom_panes.html

This is the page I used to make multiple status bars. I've tweaked it a lot over time, but this is the basics.

If you don't want bars, you can strip out that part and just display the relevant attribute, or set it again a maximum; something like player.hp and player.hp_max.


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

Support

Forums