Health and gold counters

zacura8998
06 Jul 2011, 19:46
How do I make it display the players Health and gold in the sidebar.

EX.
Health: 100
Gold: 15

Alex
07 Jul 2011, 05:14
In Quest 4 you do this using Status Variables.

In Quest 5 the feature is called Status Attributes, and it's a new feature in Beta 3 so it's not in the current release, but it should be out in the next few days.

zacura8998
07 Jul 2011, 18:45
How would I add an amount to the attributes

Alex
08 Jul 2011, 08:21
You can do it from "game" or "player" in the tree. Go to the Attributes tab and click "Add" on the Attributes list at the bottom. For example, add "health" and change the type to Integer, give it a value of 100. Then at the top of the screen under "Status attributes", add "health". You can leave the format string blank (it's the same as the Quest 4 format string, e.g. "Health: !%")

Pertex
08 Jul 2011, 09:03
But this will only work with the not yet released Beta3?

Alex
08 Jul 2011, 09:20
Yes, so I'm not even sure why I'm being asked the question... maybe we have time travellers, or maybe this was supposed to be in the Quest 4 forum.

The Pixie
02 Aug 2011, 17:42
So how would I do this for something a bit more complicated. Two examples;

A qualitative statement of health: "good" if health > 80; "middling" if 80 > health > 20; "poor" if 20 > health

A value from an arry, gven an array index

I have tried script and expression, but get errors like this:

Error running script: FunctionCallElement: Could find not function 'Replace(String, String, MultiScript)'

Alex
02 Aug 2011, 18:11
I suggest having two attributes, say "health" and "healthdisplay". You can make a function that updates "healthdisplay" each time "health" is updated by creating a script attribute called "changedhealth".

So in game.changedhealth, update the healthdisplay as appropriate. If healthdisplay is a status attribute, that should be all you need to do.

I've not tested this but it sounds like it should work!