PDA

View Full Version : Debug tools chat() ?



cscase
July 28th, 2013, 05:25
Hey all,
Got some code that is mysteriously not working, but not giving any error message either, so I'm trying to debug with the chat() function described in the library's guide, but whenever I attempt to call this function with any argument I can think of, I get this error:
Script Error: [string "charsheet_main:<unnamed>"]:1: attempt to call global 'chat' (a nil value)

The library says that chat() and console() are "built in." Do I despite that need a particular file, though, to use them? I'm modding the CoC ruleset, so it is not the latest greatest. Thanks!

Scott

Dakadin
July 28th, 2013, 06:13
You need to use it like this:

Debug.chat(parameter);
Debug.console(parameter);

Just replace parameter with what you want to output to the chat or console windows.

cscase
July 28th, 2013, 07:19
Aha, thanks once again, Dakadin! I had been trying to call it without the "Debug." prefix. Now, to do some debugging!