Login
Remember
IF Answers
Ask a Question

# 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.

- quest
- 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.

## Related questions

- How do I make verbs synonymous for only certain objects in Quest 5.6.1?
- In Quest, how do I send an integer from javascript to Quest and keep it an integer?
- In a Gamebook, how do I fix that the text processor is not working properly on my version of Quest (I think)?
- How do I set a variable by asking the player a question in Quest?
- How do I use the create exit command properly in Quest

...