Disabling a Debug NPC

Content and general development discussion, including quest scripts and server code. TMW Classic is a project comprising the Legacy tmwAthena server & the designated improved engine server based on evolHercules.


Forum rules

This forum houses many years of development, tracing back to some of the earliest posts that exist on the board.

Its current use is for the continued development of the server and game it has always served: TMW Classic.

Post Reply
User avatar
SudoPlatypus
Novice
Novice
Posts: 220
Joined: 06 Jun 2011, 17:53
Contact:

Disabling a Debug NPC

Post 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?
The Mouboo was. The Mouboo is. The Mouboo ever shall be. Drop candies and rejoice.
Most leveled character: Qwerty Dragon is 99
User avatar
Freeyorp101
Archivist Prime
Archivist Prime
Posts: 765
Joined: 04 Nov 2008, 09:17
Location: New Zealand

Re: Disabling a Debug NPC

Post 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
(09:58:17) < tux9th> Freeyorp: your sig on the forums is kind of outdated
User avatar
tux9th
TMW Adviser
TMW Adviser
Posts: 428
Joined: 09 Mar 2012, 20:21
Location: -67.067433,54.433587

Re: Disabling a Debug NPC

Post 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
Post Reply