ID:154543
 
If you're like me, sections of code under heavy development are liberally sprinkled with things like:

world << "item [src] found." or

probability = usr.accuracy + usr.luck - src.evasion
world << "Evasion: [src.evasion]"

just so you can see things as they happen. I end up getting tired of the messages, but afraid to delete them, so I comment them out in order to be able to recover them easily.

But then I thought of this:

var
  debug[0] // list of those receiving debug messages

verb
  debug_on()
    debug.Add(usr) // add to debug list
    usr << "Debug mode on."

  debug_off()
    debug.Remove(usr)
    usr << "Debug mode off."


Then you can replace your temporary 'world << "msg"' lines with semi-permanent 'debug << "msg"'

Now whenever you want the messages, use the debug_on() verb. Hey presto! Another advantage is you can check something quickly if your game is already running and you don't want to bring the world down.

.s
On 6/10/01 5:30 pm Skysaw wrote:
Now whenever you want the messages, use the debug_on() verb. Hey presto! Another advantage is you can check something quickly if your game is already running and you don't want to bring the world down.


Yeah I added something like that to an early MUD...exactly like that really, except it was for more than errors.

Guides could add themselves as "event receivers" and then they would be notified about interesting things going on in the world so they could see what was up.

Along these lines, I suggest that those serious about doing MUDs put in some tracking statistics, like how many mobs killed in a zone per day, how many potions created, etc.

If you have actual players, for example, and you show that no one ever creates a potion, it tells you:

a) potion-making may be broken
b) people may not realize the value
c) potion-making may not be very useful to players

Any of these items is very valuable to know.
In response to Deadron
I had thought of this as well... definitely a good idea. Especially as a second channel separate from the debug channel.

Guides could add themselves as "event receivers" and then they would be notified about interesting things going on in the world so they could see what was up.