Page 1 of 1

Disabling a Debug NPC

Posted: 13 Nov 2013, 09:07
by SudoPlatypus
Is editing /tmwa-server-data/world/map/npc/functions/debug.txt
by changing
callfunc "Debug";
to
callfunc "!debug";
a safe way to disable one of the Debug NPC's?

I tried using @disablenpc and it worked fine, but if server is shutdown and restarted the NPC is automatically re-enabled.

So I tried this,
callfunc "!debug";
editing the debug.txt like this to disable Debug1

Code: Select all

042-2.gat,30,26,0|script|Debug0|154,
{
    callfunc "Debug";
    end;
OnInit:
    if (!debug)
        disablenpc "Debug0";
}

001-1.gat,41,29,0|script|Debug1|154,
{
    callfunc "!debug";
    end;
OnInit:
    if (!debug)
        disablenpc "Debug1";
Is that a proper way to disable one of these NPC's?

Re: Disabling a Debug NPC

Posted: 13 Nov 2013, 12:13
by Freeyorp101
Your statement callfunc "!debug"; means that the script is trying to call a function called "!debug", which does not exist.

Generally, when you want to run a server in production mode, you change [the definition of the debug constant in const.txt] to 0. That way, !debug (not the string literal "!debug") resolves to !0, which is true, disabling the NPC via the OnInit: label.


---Freeyorp

Re: Disabling a Debug NPC

Posted: 13 Nov 2013, 15:51
by tux9th
There is no way to just disable Debug1. If you want to disable debug1 you have to remove it from the debug.txt