Skip to content

Debugging

Michael A. Sinclair edited this page Dec 12, 2017 · 2 revisions

If you attempt to make significant alterations to config functions, you will inevitably run into errors. You can track them down using debug mode. When debug mode is enabled, extra messages will print to the chat window and to the log. The messages are inserted into the action queue, so they will print at the appropriate time during the fishing sequence.

Enabling Debug Mode

To enable debug mode module-wide, call:

SetFishingDebugMode(TRUE);

Debug functions will always print if debug mode is enabled module-wide. The OnFishingSetup() function is a great place to put this function.

To enable debug mode on an object oObject, call:

SetFishingDebugMode(TRUE, oObject);

If the object is a fishing equipment item, any PC who uses the item will see debug messages while using it to fish. If the object is a PC, that PC will see debug messages when using any fishing equipment item. These messages will appear even if debug mode is disabled module-wide.

If you want to enable debugging on an item from the toolset rather than using a script, you can create a local int variable named DEBUG on the object and set it to 1.

Disabling Debug Mode

To disable debug mode module-wide, call:

SetFishingDebugMode(FALSE);

To disable debugging on on object oObject, call:

SetFishingDebugMode(FALSE, oObject);

Note that disabling debug mode module-wide will not override locally-applied debugging. Similarly, disabling debugging locally will not disable debug messages for that object if debugging is enabled globally.

Custom Debug Messages

To send a message only if debug mode is enabled, simply call FishingDebug("Your message here.");.

If creating your message requires code that does not need to be called if debug mode is not enabled, wrap it in the GetFishingDebugMode() function like so:

if (GetFishingDebugMode())
{
    string sMessage = MyExpensiveFunction();
    FishingDebug(sMessage);
}
Clone this wiki locally