BGforgeNet/Fallout2_Unofficial_Patch

add script name to debug_msg

Closed this issue · 2 comments

Basically, do

#define ndebug(message) debug_msg(NAME + ": " + message + "\n")

and replace all debug_msg with ndebug.
I think that'll make debug.log much more readable.

SCRIPT_NAME is actually a number, need to convert it to a string somehow.

Can add an additional header, with a procedure mapping all numbers to names, something like

procedure ndebug(variable script_num, variable msg) begin
  variable script_name;
  switch script_num begin
    case 17:
      script_name := "acbrahmn";
    ...
  end
  debug_msg(script_name + ": " + msg)
end

Seems a little excessive to put into every script, though. Maybe a smart define construction could be devised instead?