0 votes

Heey Guys and Gilrs

First sorry English is not my first language.
No my problem I have written a Quest dictionary.


Now I want the variable isQuestactive set to ture with the funtion:

func activateQuest(QuestID):
ID]["isQuestactive?"] = true

What happens now is that the variable isQuestactive remains false and a new entry is added to the dictionary with variable isQuestactive: true

How can i set isQuestactive to true?

can someone help me with this problem? thanks in advance :)

in Engine by (12 points)

1 Answer

+1 vote

You named the key is_Quest_active but are setting the key is_Quest_active? (with a question mark in the end). Here's a working example:

var QuestDictionary = {
    "QUEST0": {
        "Quest_Name": "Farming",
        "is_Quest_active": false
    "QUEST1": {
        "Quest_Name": "Mining",
        "is_Quest_active": false

func _ready():
    print("Quests before: ", QuestDictionary)
    print("Quests after: ", QuestDictionary)

func activate_Quest(QuestID):
    QuestDictionary[QuestID]["is_Quest_active"] = true
by (10,580 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.