In response to Shy_guy197
i think thats the prob i deleted my NPC and it works fine with map now
In response to Shy_guy197
Yes, that might be it!

Here's a working one.

mob
verb
MessageHost(T as text)
for(var/mob/M in world)
if(!M.client)
continue
else
if(!M.client.address || M.client.address == world.address)
//message
else
continue


Sorry about that, I need sleep, I totally forgot about the lack of address var on NPCs.
In response to Shy_guy197
now when i try to use it with just myself doesnt do ne thing maybe i need to be with someone else in room?
In response to Shy_guy197
Did you change '//message' to something? //message is just a comment to tell you to insert the method of messaging there.
In response to Nadrew
Yup just did works fine now bout i really dont know it really works theres really none online its so late... but when i send myself a message it comes back to me without errors so im guessin it works thx alot...... if you think you can which wont take but a min i hope ^_^; how do you asign the numbers to the very Right of the keyboard? like attack is 5 and stuff.. you know how?
In response to Shy_guy197
Use of macros. You have to create a .dms file in byond not a dm file then look up macro in f1 help in dream maker
In response to Mrhat99au
cool thx ill do that
In response to Shy_guy197
If theres ne body still here.... i got the marco thing working can you make it where they dont have to press alt everytime they come in game like automatic?
In response to Shy_guy197
No i dont think so.
In response to Shy_guy197
The reason for the error you're getting, and why Nadrew isn't getting it in his tests, is that he forgot to check M.client before checking M.client.address. If you have any non-client mobs, his code will fail. Change his if() to this:
if(M.client && !M.client.address)

In his tests it's working because he has no mobs that aren't players.

Lummox JR
In response to Lummox JR
This was fixed later on in the thread, I feel really stupid about forgetting to check client, lack of sleep got the best of me again.
In response to Nadrew
Nadrew wrote:
This was fixed later on in the thread, I feel really stupid about forgetting to check client, lack of sleep got the best of me again.

I noticed that when I finally read the rest of the way down through. Kind of amusing, though, the almost real-time back-and-forth that went on over a relatively simple problem.

When I first saw your code I actually noticed the client check was missing, but if I hadn't then I would have picked up on it from the "Cannot read null.address" line. Since M.client.address was being checked, that would mean M.client was null for whatever M was. That means M must be an NPC or monster or such, and since a simple quickly coded test wouldn't include those, it explained why your test worked and his didn't.

Lummox JR
In response to Lummox JR
Hey guys - good to see honest, sane, help around here for a change. Good work! But here's a twist: what if the GM is offline (remote hosted on a game server) or AFK? How would you route the message to, let's say, a logfile to be read later or maybe sent to the Pager. Or maybe even emailed?
In response to digitalmouse
digitalmouse wrote:
Hey guys - good to see honest, sane, help around here for a change. Good work! But here's a twist: what if the GM is offline (remote hosted on a game server) or AFK? How would you route the message to, let's say, a logfile to be read later or maybe sent to the Pager. Or maybe even emailed?

Rerouting automatically to e-mail I don't think would be possible, though you could presumably use a Web form to send something along--it wouldn't be an automatic reroute.

Logging would be rather easier, using savefile.ExportText().

Lummox JR
In response to Lummox JR
The SendPage() proc has an option to forward to email if possible.
In response to Nadrew
If you're concerned about lag at all, a better way would be just to check client.address at Login().

<code>var/mob/host mob/Login() // login stuff if(!client.address || client.address == world.address) host = src</code>

That way, the first person to log in that registers as the host through client.address checks. (Hosting from DS will give the host an address of 0, while hosting from DD will see that the host has the same address as the world.) Then the host variable will be set to point to that player from then on, so if you want to refer to the host just use the host variable.
<code> mob/verb/Reply(message as text) src << "You tell the host: [message]" host << "[src] tells you: [message]"</code>
In response to Crispy
Crispy wrote:
The SendPage() proc has an option to forward to email if possible.

SendPage, however, requires the sender to be online to send the message. That is, you'd have to ask the client to send the page (and risk not having it be sent), or have the GM send the page, which only works online.

It's very possible and easy to save it to a log, though:

var/file = file("GMmessages.txt")
file << message
Page: 1 2