How do I retrieve values from a dictionary in Quest 5.6?

+1 vote
53 views
asked Mar 28 in Authoring by Nerava (16 points)
retagged Mar 28 by Dannii
While I have created a string dictionary to hold a rather large list of options, I cannot figure out how to actually retrieve values from it. The command given on the documentation for "using dictionaries" is apparently undefined, and I can only find options for add and remove values in the GUI. I'm probably missing something obvious, but my goal is to get an element from the dictionary and place it into another, which would be checked to allow the player to use certain actions/commands. I'm considering switching it to an object dictionary.

1 Answer

+1 vote
answered Mar 28 by Alex (486 points)

Use StringDictionaryItem.

This is a function, not a command - you need to use it in an expression. For example:

msg (StringDictionaryItem(mydictionary, "mykey"))
commented Mar 28 by Nerava (16 points)
Ah, so it really was something straightforward like that. Didn't realize I was just calling it as a function on its own without printing the result. Thank you.
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.
...