ID:2042695
 
Im just wondering what exactly would be the proper way to do a quest system code wise so i don't have to have like a million variables for each part completed or the quest being completed etc?

There's a lot wrong with that code, for one it's insanely convoluted and hard to expand on. Secondly it has pointless usage of 'return', thirdly, the for() is not required, you can use locate() for that, which you're literally doing in the code below.

A more ideal method of handling quests is by containing them in a datum that can be held within a list (quest book) and all checks would be done per-datum.

Quest
var
list/items_required
CollectBerries
items_required = list(/obj/Berry=10)

proc
CheckQuest(mob/owner)
for(var/object in items_required)
var/obj/found = locate(object) in owner
if(found.amount < items_required[object])
owner << "You need more [found] to complete the quest!"
return
// This part of the code is only reached if all item requirements are met.
FinishQuest(owner)

FinishQuest(mob/owner)
// Do something for rewards here, ideally another variable contained by this datum to control the reward(s)


Written off the top of my head for this topic, not meant to be copy/pasted or compiled, just learned from.
what if it was a quest for like killing a certain npc or multiple npcs how would i go about that?
You can add more mechanics to the datum such as a list of types of required kills or something along those lines, then a way of keeping track of how many of what you've killed.