ID:889118
 
(See the best response by BeignetLover.)
Code:
mob
verb
Say(msg as text)
usr << "You say, '[msg]'" //user gets one message...
oview() << "[usr] says, '[msg]'" //and everyone else in overview get this one


Problem description:
Hi all. From what I can tell the oview() function is meant to include everything in your overview except your own tile. When I run the verb it shows me both lines.

Could someone help me please. Thanks in advance.

P.S Would the oview() function work if I have other players in the same 'room' as me? I am trying to create a Text MUD
Best response
If it's a text MUD, oview is pointless. You should try this.

mob
verb
say(msg as text)
for(var/mob/M in world)
if(M == usr)
M << "You say, [msg]"
else
M << "[usr] says: [msg]"
Thank you!
No problem :3
There's no reason to be looping over the world for this, if the "room" contains a list of players (which it should be) you can loop over that list.
Elaborate?
Looping over 'in world' is far less efficient than looping over 'in my_list', he also asked for it to work room-specific and not for the entire game.
var/room = list()



mob
verb
Join_Room()
room += usr
Leave_Room()
room -= usr
say(msg as text)
if(usr in room)
for(var/mob/M in room)
if(M == usr)
M << "You say, [msg]"
else
M << "[usr] says: [msg]"
/*
if(usr in roomb)
blaaahhhhhhhhhhhhh....


There's probably a better way to do this that uses a proc outside of my knowledge. But meh... oh well.