ID:261823
 
Alright, I have a few problems here. First, here's my code:


mob/npc/Girl
icon = 'Girl.dmi'
icon_state = "Girl"
verb/Talk()
set src in oview(1)
set hidden = 1
usr << "You're lookin' pretty sexy"


Now, this is all nice and whatnot. But, how would I put in an if code so that if there isn't anyone around me, I won't try to talk. Because as it stands, if I press the center key when there's noone around me, it gives me an ingame error saying Talk is inaccessable. I was also wondering how I could make it so I only talk to them if I'm facing their direction. I dunno what to replace oview(1) with to make that. Thanks for any help.
mob/npc/Girl
icon = 'Girl.dmi'
icon_state = "Girl"
verb/Talk()
set src in get_step(usr,usr.dir)
set hidden = 1
usr << "You're lookin' pretty sexy"

now you have to face them. as for the other problem.. you have enter set as the macro "Talk" right? well there is no verb "Talk" (unless you are facing the npc) so naturally its inaccessible.
In response to Siefer
The "set src" line you used won't work; only a few values are acceptable for it, and that isn't one of them.

Unfortunately there is no way to limit the verb to a certain direction using set src.

Lummox JR
In response to Lummox JR
hmmmmm. perhaps what you could do is if the npc doesnt move give the player the verb Talk when they have Entered() a tile nest to the npc.
mob/verb/Talk()
for(mob/npc in get_step(usr,usr.dir)
//the rest would go here.
and when they have Exited() take the verb away.
In response to Siefer
try using

hascall();

-Salarn
In response to Salarn
They're all unsupported src settings... I'm.. Pretty sure it's possible to make it so you can only talk to someone when you're looking at them. They do it in the RPGs I've played. FFL, DWO, DWQ... I dunno. Thanks for your replies, though.
In response to Rockin' Eli
You can just not supply an argument to the verb, and then use get_step() to get whoever is in front of them. You won't be able to right-click on the NPC to bring up the "talk" verb, but apart from that it should work fine.