ID:140142
 
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]]." //empty.
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)() //not calling this at all
Owner.QuestList += src //adds suscessfully and displays in inv tab
..()

Quest1

proc/SetList()
world << "Called Set!" //doesn't display at all.
StepsList[1] = "Step 1"
var/list/L = list("Talk to NPC", /mob/NPC/Quest/A)
StepsList[1] = L
Click()
//work around? Still not calling
//call(/obj/Quest/Quest1/proc/SetList)()
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?
You should not be using call()() here. Just do SetList().
In response to Garthor
I had tried that, but it still won't call. =\ I've tried everything I can think of.
In response to Mechanios
Whoops. The problem is that it's throwing an error when you try to access Steps.len, because Steps is the number 1 and not actually a list.

It would make things easier if you would, in the future, explicitly mention any runtime errors you're getting, because they usually indicate that there's an error.
In response to Garthor
Eh? I wasn't receiving any errors. In any case, thanks for pointing the problem out. I'll remember to avoid that.

I can't create the error. I call world << StepsList.len and it gives me a 1. I don't quite see what I would change to fix this. O.o
In response to Mechanios
Whoops, misread it. I'm going back to my "don't need call()()" explanation. You probably should also be defining the SetList() proc under Quest, and overriding it for Quest1 etc.
In response to Garthor
I had tried setting it under Quest but it still doesn't call the proc in any way. Thats what my irk is. I tried Click() up there for a direct access, but the proc doesn't run.
In response to Mechanios
Also partially because you are creating an /obj/Quest, not an /obj/Quest/Quest1.

I keep on missing little things today, it seems.
In response to Garthor
OHH. Well, damn. I never noticed that. I'll set that up and it should run now.