I need help with attributes.

–1 vote
217 views
asked Jul 25 in Authoring by Tyson Grant (1 point)
edited Jul 26 by Dannii

I am limited to the browser version of Quest, and I would like to know how to make custom status attributes that show in the menu on the side when being played.

1 Answer

0 votes
answered Jul 26 by hegemonkhan (161 points)
selected Jul 27 by Tyson Grant
 
Best answer

an example:

'pages' -> 'page1' -> Page Type: [script] or [text+script] -> (see below)

The Attributes:

add new script -> variables -> 'set a variable or attribute' Script -> set variable player.strength = [expression] 0

The Displayment of those Attributes in the Status Pane during game play (via the built-in 'statusattributes' String Dictionary Attribute):

add new script -> variables -> 'set a variable or attribute' Script -> set variable player.statusattributes = [expression] NewStringDictionary () <----- these are parenthesis, it's not a zero, nor the letter 'O'.

(I don't have quest open at the moment, so this will be in code, but hopefully you can figure out how to do it via the GUI~Editor's Scripts):

dictionary add (player.statusattributes, "strength", "Strength: " + player.strength)

outputs~displayment:

Strength: 0


this should work... hopefully... let me know if it doesn't. Or, let me know if you want to do anything more fancy, as this was only a simple example for you.

for example of something more fancy, outputs~displayment:

Life: 999/999

commented Jul 27 by Tyson Grant (1 point)
edited Jul 27 by Tyson Grant
I tested this on the Gamebook and it worked, thank you, I'm going to try this on the Text adventure I'm working on.
It didn't work. :(
commented Oct 19 by Toris (1 point)
I don't seem to have the option to set Newstringdictionary only expression. Is there a way for me to see dictionary's in gamebook? Or do I need to make them somehow? Trying to display them and get them put in a dictionary.
Thanks ahead of time
This site is now closed.
As of 1st November 2015, this site is a read-only archive. For more information see the intfiction forum post

Welcome to IF Answers, a site for questions and answers about Interactive Fiction.

Technical questions about interactive fiction development tools such as Inform, Twine, Quest, QuestKit, Squiffy, Adrift, TADS etc. are all on-topic here.

Non-technical questions about interactive fiction are also on-topic. These questions could be about general IF design, specific games, entering the IF Comp etc.
...