{"id":15722689,"url":"https://github.com/subsoap/defquest","last_synced_at":"2025-05-13T03:46:01.022Z","repository":{"id":71235843,"uuid":"111870773","full_name":"subsoap/defquest","owner":"subsoap","description":"Setup, track, and check real world time countdowns based on OS or server time for Defold","archived":false,"fork":false,"pushed_at":"2018-01-05T06:40:33.000Z","size":24,"stargazers_count":7,"open_issues_count":4,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-10T05:52:48.610Z","etag":null,"topics":["defold","defold-game-engine"],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/subsoap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-11-24T03:12:05.000Z","updated_at":"2024-10-11T12:29:08.000Z","dependencies_parsed_at":"2023-02-28T01:01:31.751Z","dependency_job_id":null,"html_url":"https://github.com/subsoap/defquest","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subsoap%2Fdefquest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subsoap%2Fdefquest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subsoap%2Fdefquest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subsoap%2Fdefquest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/subsoap","download_url":"https://codeload.github.com/subsoap/defquest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253870822,"owners_count":21976611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["defold","defold-game-engine"],"created_at":"2024-10-03T22:08:54.085Z","updated_at":"2025-05-13T03:46:00.987Z","avatar_url":"https://github.com/subsoap.png","language":"Lua","funding_links":[],"categories":["Libraries"],"sub_categories":["Programming Language"],"readme":"# DefQuest\nSetup, track, and check real world time countdowns based on OS or server time for Defold\n\nDefQuest can be used for Hearthstone style quests, time locked crates / events (to encourage users to return to the game), or energy regeneration times for games with an energy/heart system.\n\n## Installation\nYou can use DefQuest in your own project by adding this project as a [Defold library dependency](http://www.defold.com/manuals/libraries/). Open your game.project file and in the dependencies field under project add:\n\n\thttps://github.com/subsoap/defquest/archive/master.zip\n  \nOnce added, you must require the main Lua module in scripts via\n\n```\nlocal defquest = require(\"defquest.defquest\")\n```\n\nDefQuest has DefSave and DefWindow as optional dependencies but they are highly recommended you use them. If you use the Defold API Window callbacks then if you should use DefWindow to set your Window callback function instead of using Defold's Window API directly.\n\nIn your update make sure to include\n\ndefquest.update(dt)\n\nAnd in your final make sure to include (before defsave.final())\n\ndefquest.final()\n\n## Usage\n\nIf you are using DefSave then you need to make sure you setup the appname and init DefSave before doing anything with DefQuest (see the example).\n\ndefquest.add(id, time, data)\n\nYou can set the id til nil to generate a random id. When the random id is generated DefQuest will check to make sure an ID with the random ID it generates is not the same as any other IDs.\n\nIf you set an ID when adding a quest it will overwrite any existing quest with that ID.\n\nTime is a table with all values optional but you should set at least one of the values unless you want the quest to complete instantly for some reason. The table values are: seconds, minutes, hours, days, years. \n\ndefquest.add(nil, {hours = 1}, {prize = 25})\n\nIf you want a reset time based on midnight or noon then you can set time.midnight or time.noon to true. This will set the next reset to the follow midnight / next day's noon (or today's noon if it's not yet noon). This time is NOT based on local time but on UTC +0. (I honestly don't know with certainty if these time related things are accurate so hopefully someone who knows about it better can sanity check it...)\n\n## Information\n\nDefQuest is meant for games which have frequent or always on Internet connections. You can use DefQuest offline, but it defeats its purpose.\n\nBy default, DefQuest saves its data (using DefSave) to a \"defquest\" file. You can set the defquest.defsave_filename string to another file, such as your user profile/game data so that users cannot simply swap their defquest files to cheese quest completion over and over.\n\n\nBeware of using Lua's build in date/time functions as they by default work on local timezone.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubsoap%2Fdefquest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsubsoap%2Fdefquest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubsoap%2Fdefquest/lists"}