You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In add_quest function quest dictionary is passed instead of id
func add_quest(quest_name:String,resource:QuestResource=current_resource) -> void:
var node_data = resource.get_quest_by_name(quest_name)
player_quests[node_data.quest_id] = node_data.duplicate(true)
new_quest_added.emit(quest_name)
active_quest = quest_name
check_callable_step(node_data.quest_id)
step_updated.emit(get_current_step(quest_name))
print(node_data.quest_id)
var quest_object = QuestObject.new(player_quests[node_data.quest_id]) # we are passing quest dictionary
active_quest_objects.append(quest_object)
Then in _init function you are trying to iterate through QuestManager.player_quests[quest_id].quest_steps using this dictionary as a key, which leads to this error
Sorry for the late update Ive fixed this issue I had code I was testing that I didn't remove from the main release. Its now fixed with update 0.8.3. The last 3 lines of add quest were for testing quests as class objects instead of dictionaries. Didn't get around to fully implementing it yet. But it will allow tracking quests to be easier using signals directly in each "Quest object step". As noted in #14
In add_quest function quest dictionary is passed instead of id
Then in _init function you are trying to iterate through QuestManager.player_quests[quest_id].quest_steps using this dictionary as a key, which leads to this error
Invalid get index '{ "completed": false, "failed": false, "first_step": "1118a2488c", "group": "", "id": "1e3cd6e59f", "meta_data": { "Is Somthing True": false, "funcparams": [] }, "next_id": "1118a2488c", "position": (380, -440), "quest_details": "", "quest_id": "1e3cd6e59f", "quest_name": "ShootEmUp", "quest_rewards": { "money": 1000 }, "quest_steps": { "1118a2488c": { "collected": 0, "complete": false, "details": "Destroy 10 ships", "id": "1118a2488c", "item_name": "Ships", "meta_data": { "funcparams": [] }, "next_id": "e95c4966d1", "position": (619.791, -396.681), "quest_id": "1e3cd6e59f", "required": 10, "size": (240, 231), "step_type": "incremental_step", "type": 2 }, "a5e44c9e14": { "details": "Complete", "id": "a5e44c9e14", "next_id": "", "position": (1260, -420), "size": (115, 85), "step_type": "end", "type": 6 }, "e95c4966d1": { "complete": false, "details": "Survive 5 seconds", "fail_on_timeout": false, "id": "e95c4966d1", "is_count_down": true, "meta_data": { "funcparams": [] }, "next_id": "a5e44c9e14", "position": (960, -500), "quest_id": "1e3cd6e59f", "size": (231, 281), "step_type": "timer_step", "time": 5, "time_minutes": 0, "time_seconds": 5, "total_time": 5, "type": 7 } }, "size": (200, 250), "type": 0 }' (on base: 'Dictionary').
Then, if we do quest_id = _quest_id.id instead, iterator assigns only id value of the step inquest_steps instead of a step dictionary
I've changed _init function to this:
It is quite clunky, but it seems to work as intended now
The text was updated successfully, but these errors were encountered: