ID:148207
 
The room:
 +----------+
 |          |
 |          |
 |    M     |
 +----#-----+
      P

Legend:
  M = Merchant
  # = counter (with another turf under it)
  P = player


Current, I am currently able to "talk" to a npc that is standing next to me. After accomplishing that, I decided to add a counter and try to "talk" over this counter. Looking through the online reference (specifically, the "locate" proc), I figured out a way that (to me) would logically work...but it doesn't. Here is the snippet of my code when talking to someone north of the player:

turf/var/talkover=0
turf/town/counter
density=1
talkover=1
icon = 'town.dmi'
icon_state="counter"

proc/actionMenu(mob/player/mychar)
var where
var turf/thisturf
var mob/npc/thisNPC

switch(mychar.dir)
if (1)
where = mychar.y
do
where++
thisturf = locate(/turf/town/counter) in locate(mychar.x, where, mychar.z)
while (!isnull(thisturf) && thisturf.talkover)

thisNPC = locate(/mob/npc) in locate(mychar.x,where,mychar.z)
if (!isnull(thisNPC))
thisNPC.talk(mychar)

Nevermind...I changed the counter to an object. Works wonderfully now.
In response to CableMonkey
Why not use get_step() instead of the switch(dir) thing?
In response to Garthor
That would have worked if I was only talking to mobs next to me.
In response to CableMonkey
CableMonkey wrote:
That would have worked if I was only talking to mobs next to me.

Actually you can just use get_step() again or even nest calls. I think it'd be easier than a massive switch() anyway.

Lummox JR