ID:141228
 
Code: step_towards problem.
//the mob that i want to walk to the given var with step_towards.
mob/Olivander
icon = 'Banker.dmi'
NPC = 1
Click()
set src in oview(1)
if(usr.HaveWand==1)
alert("Ah, I remember your face. I believe I've already sold you a wand.")
else
switch(input("Welcome to Olivander's Wand Shop.?","You have [usr.money] Gold")in list("Yes","Cancel"))
if("Yes")
alert("Lets see here.")
step_towards(src,target)//the step_towards proc is located here.
if(usr.WNDone==1)
if(usr.WN==1)
alert("Olivander hands you a 10 in. Hippogriff Talon Wand.")
switch(input("This wand costs 100 gold, Would you like to buy it?","You have [usr.money] Gold")in list("Yes","Cancel"))
if("Yes")
if(usr.money>=100)
usr << "Olivander says: That turned out nicely! I hope you enjoy your new wand."
usr.money-=100
usr.HaveWand=1
return
else
usr<<"You don't have enough Gold for the wand."
return
else
return
if(usr.WN==2)
alert("Olivander hands you a 11 in. Dragon Heartstring Wand.")
switch(input("This wand costs 100 Gold, Would you like to buy it?","You have [usr.money] Gold")in list("Yes","Cancel"))
if("Yes")
if(usr.money>=100)
usr << "Olivander says: That turned out nicely! I hope you enjoy your new wand."
usr.money-=100
usr.HaveWand=1
return
else
usr<<"You don't have enough Gold for the wand."
return
else
return
if(usr.WN==3)
alert("Olivander hands you a 12 in. Phoenix Feather Wand.")
switch(input("This wand costs 100 Gold, Would you like to buy it?","You have [usr.money] Gold")in list("Yes","Cancel"))
if("Yes")
if(usr.money>=100)
usr << "Olivander says: That turned out nicely! I hope you enjoy your new wand."
usr.money-=100
usr.HaveWand=1
return
else
usr<<"You don't have enough Gold for the wand."
return
else
return
if(usr.WN==4)
alert("Olivander hands you a 11 in. Veela Hair Wand.")
switch(input("This wand costs 100 Gold, Would you like to buy it?","You have [usr.money] Gold")in list("Yes","Cancel"))
if("Yes")
if(usr.money>=100)
usr << "Olivander says: That turned out nicely! I hope you enjoy your new wand."
usr.money-=100
usr.HaveWand=1
return
else
usr<<"You don't have enough Gold for the wand."
return
else
return
if(usr.WN==5)
alert("Olivander hands you a 10 in. Unicorn Hair Wand.")
switch(input("This wand costs 100 Gold, Would you like to buy it?","You have [usr.money] Gold")in list("Yes","Cancel"))
if("Yes")
if(usr.money>=100)
usr << "Olivander says: That turned out nicely! I hope you enjoy your new wand."
usr.money-=100
usr.HaveWand=1
return
else
usr<<"You don't have enough Gold for the wand."
return
else
return


//the obj/var of the bookshelf that is the target for the mob to walk to.
obj/Bookshelf/var/mob/target


Problem description: When i compile the world, it says target is a Undefined var in the step_towards proc.

Should be other way around. Now you're assigning a mob to the bookshelf. You should assign a bookshelf to a mob.
In response to Mysame
That should be it right, because i want the MOB to walk to the BOOKSHELF.
In response to Mitzzz
Exactly, so the MOB should have a VARIABLE that directs to a BOOKSHELF object.

mob/var/obj/target