ID:144895
 
Code:
mob
NPC
Quest1
icon='QuestPeople.dmi'
name="Bob"
New()
..()
for(var/mob/m in world)
if(!m.quest1&&m.client)
var/obj/questmark/l=new /obj/questmark
var/image/i=image(l,src)
m<<i
proc/endquest(mob/M)
for(var/i in M.client.images)del(i)


Problem description:
I didn't bother testing out the help that Mysame gave me till now, and it doesn't work. Anybody know what the problem is?

The NPC is created before you're technically in the game ... Let it sleep(50) or something before it checks for what mobs in-game need to do his quest.
In response to Mysame
But doesn't for() loop constantly? I will do it anyway and see.


EDIT: That actualy worked, Thanx man.
In response to Evidence
Another problem, sorry. I did some test verbs to see how it would work.
mob/verb
endq()
src.quest1=1
for(var/i in src.client.images)del(i)
q()
src.quest1=0

For some reason the for() is not looping, and re-adding the mark when i put qyest1 back at 0. I'm not really worried about that much, but what if i put another quest on him that doesn't appear till say, lvl 20?, if its not looping, how will that work?


EDIT: Also, i just logged in on a diff key, and it wouldn't add. So it definitly isn't looping.

Would something like this work?
mob/proc/quest1
for(var/mob/m in world)
if(!m.quest1)
var/obj/questmark/l=new /obj/questmark
var/image/i=image(l,src)
m<<i
spawn(10)
quest1()


Then under New() on the npc, put quest1().
In response to Evidence
for()=/=while(). I think you should look it up, a for() doesn't loop constantly. It just loops 'till it's finished.
In response to Mysame
Ok, i tested the way i put, it works perfectly, thanks for all your help.
In response to Mysame
Mysame wrote:
for()=/=while(). I think you should look it up, a for() doesn't loop constantly. It just loops 'till it's finished.

Actually a for() with no arguements inside it would never finish, so it's a loop. :P