ID:176122
 
Well I want to make it so when you are facing an NPC and press num pad 5 it initiates text.. i haven't the slightest idea how.
im pretty sure its like:

client/center()
(prochere)

and then you have to define the proc:
proc
talk
usr<<"You talk to the npc"
In response to JimmyWimmy
JimmyWimmy wrote:
im pretty sure its like:

client/center()
(prochere)

and then you have to define the proc:
proc
talk
usr<<"You talk to the npc"

Do not, I repeat, DO NOT use usr in a proc, much LESS tell other people to.

mob/NPC
var/text
NPC_Guy
text = "Hello!"
client/Center()
for(var/mob/NPC/N in get_step(mob,mob.dir))// For every NPC type mob in front of you, display their 'text' variable. If you do not know what get_step() is, look it up in the reference.
mob << N.text


~>Volte

In response to Volte
Volte wrote:
Do not, I repeat, DO NOT use usr in a proc, much LESS tell other people to.

I think the bigger problem was that Airjoe/JimmyWimmy didn't put the parentheses after "talk", so it wouldn't work anyway.

Actually this solution isn't so bad if the proc is only ever called by client/Center(), because client/Center() is a verb. However if the proc is to be used in a more proc-like way, usr should be avoided at all costs.

Lummox JR