Closed Ohtoh04 closed 5 months ago
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