Code:
mob/PC var list QuestList = new CompletedQuests
proc CheckQuest(QuestName, Step as num, Target) for(var/obj/Quest/Q in src.QuestList) world << 1005 if(Q.name == QuestName) CheckStep(Q, Step, Target) CheckStep(obj/Quest/Q, Steps as num, mob/NPC/Quest/Target) world << "List 1,1: [Q.StepsList["Step [Steps]"][1]]." if(Q.StepsList["Step [Steps]"][1] == "Talk to NPC") world << "2" if(Target.type == Q.StepsList[Steps][2]) world << "!" obj/Quest var Name = "Quest" list/StepsList = newlist()
New(mob/PC/Owner,Name, Steps) world << Steps name = Name StepsList.len = Steps call(/obj/Quest/Quest1/proc/SetList)() Owner.QuestList += src ..()
Quest1
proc/SetList() world << "Called Set!" StepsList[1] = "Step 1" var/list/L = list("Talk to NPC", /mob/NPC/Quest/A) StepsList[1] = L Click() var/mob/PC/M = usr M.CheckQuest("Quest1", 1, /mob/NPC/Quest/A) mob/NPC/Quest A icon = 'test.dmi' verb/Talk() set src in world var/mob/PC/P = usr new /obj/Quest(usr, "Quest1", 1) P.CheckQuest("Quest1", 1, src)
|
Problem description:
Quite a large snippet, but the jist of the problem. I've started dealing with multidimensional lists. I've read up on them in Kunakr's DM Programming Tutorial P.III. As shown in the comment above, the SetList proc isn't even called, be it through New() or Click() Is there anything that could be stopping this? I've scoured over it and I can't possibly think of a work around. I tried making a New() under quest1 to set the list, but it won't pass through that either even if there is a ..() within it. Any ideas?