ID:155895
 
So...I've noticed that things go wrong with procs and verbs all the time, and you get a run-time error. It happens in even the most stable games. I've also noticed that players generally TRY to crash procs, to test the limits of the game itself, i've done this on multiple occasions. And everytime i crash a proc and a little run-time error pops up, i sigh. It's good to be able to see where your errors are coming from in a game, but if your a player, its very unattractive to be able to see a portion of the code and see why it failed. Though helpful, you wouldn't ever see a game like World of Warcraft posting up it's bugs in the chat screen. Instead, they pop up the "Lua Error" box, which still gives players the ability to report bugs and see what's wrong, but it doesn't garble up the text box. I wanted to do something like that for my game, Just to simply know how it's done and how i can make Errors more visually appealing and professional to the player. I don't want comments on things unrelated to my question please, such as "There's no need for that!" and whatnot. I don't want to make this a Game Ethics debate, but rather just a simple Q&A. Thank you for any help in advance.

What I need: How to show Run-time Errors in a separate pop up box instead of the default Output screen.

-Lily Deliroso
I'm not sure you can handle this. You can probably handle your own errors a little better, but unexpected runtimes do just go to the output window I think.

#define CRASH(MSG) /* Some code to handle gracefully here */
#define ASSERT(EXPR) /* Some code to handle gracefully here */


Similarly you can set the world.log variable to some file to redirect the logging output at least. I believe runtimes related to client macros will always go to output and options.

Best Regards,
Stephen Badger
Dear Lily,

I'm not sure if this is the simplest solution, but I think runtime errors forward to the default output box. So if, for example, "output1" is the default output box, you can separate your chat box and runtime error box like this:

var/j = 0
world << output("Chat message", "output2") // message sent to output 2
world << (2 / j) // division by zero runtime, sent to output1


There might be a simpler solution I don't know of. This is the first thing that comes to mind.

Sincerely,
-- Toadfish

P.S. The default output box is the one with the "default" checkbox widget ticked.
In response to Toadfish
I know how to work with skins and everything of the sort, but is there no real, practical way to move errors to different screens or to just delete them altogether? I guess one thing i could do is set up a fail-safe on every proc, that if something that would normally crash it happens, it's redirected safely elsewhere. Thank you for the tips.
Errors go to the default output control. Minimize it to 1x1 pixel, or put it where you want errors to show up, and don't use the default output control *ever* for anything else.
In response to Alathon
If I could "thumbs up" this post or at least shake your hand, I would. So simple it works, and I bet there isn't a single person out there on BYOND who does this other than maybe yourself. I would have never thought of doing that, personally.