Image

When interacting with the npc there will be a check to make sure that you can get a quest. If the player can get a quest a random quest will be selected from a list of un completed quests on the current level list.

Image

After the request is sent to assign a quest the quests Active value will be set to true. Inside of QuestsSystem.js there is a loop that loops through ALL ACTIVE quests when an interaction occurs. If a quest is found it will send the collided objects ID which will then be checked by the quest to see if its a value inside of the quest.

Image

Inside of the UpdateQuest() function inside of the quest it will find what type of quest it is and run the corosponding checks and log the output. If the quests values have all been met the quest will be deactivated and unlocks the quest npc to allow another quest to be accepted.

Image

The quest npc sends a request to create the corosponding scavenger object

Image

Inside of ScavengerObject.js there is a swich case statement to find the scavenger objects data. This data includes the size, image, and pos of the object. Because the object is being created it will imeaditly show up on the level allowing for the player to collect the object.

Image