.unloadcfg - There is possible, now?

Here you can post threads on the development of the current release of the core (100)

Moderator: POL Developer

Post Reply
User avatar
Ciechu
New User
Posts: 29
Joined: Mon Oct 15, 2018 5:36 am
Location: Poland
Contact:

.unloadcfg - There is possible, now?

Post by Ciechu » Fri Nov 23, 2018 10:13 am

Hiho!

When I saw the POL Emulator for the first time (since 2004r) there was a problem with config files - reloading config files. When I change for example monster color in config/npcdesc.cfg I must do a restart whole server. .unloadcfg never works for me - I know that issue.

Is there any possible to reload config files without a server restarts?

newest POL version 100

Thank you, Ciechu.
"Live Fast, Die Fast"
- GG Allin

Yukiko
Distro Developer
Posts: 2552
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: .unloadcfg - There is possible, now?

Post by Yukiko » Fri Nov 23, 2018 10:45 am

You cannot unload/reload itemdesc.cfg and npcdesc.cfg files. I suspect it is because doing so would require refreshing (removing and recreating) all items and NPCs in the world.
Sincerely,
Yukiko

I would tell you a UDP joke but you might not get it.

Titus 2:13

User avatar
Austin
Former Developer
Posts: 615
Joined: Wed Jan 25, 2006 2:30 am
Contact:

Re: .unloadcfg - There is possible, now?

Post by Austin » Mon Nov 26, 2018 11:54 am

You can totally unload npcdesc.cfg - you just have to unload them the way they are read in in any script(s)
::npcdesc :*:npcdesc :pkgname:npcdesc followed by ReloadConfiguration()


You can unload and reload an itemdesc.cfg for scripts to read in but it wont affect the core's handling of itemdesc.cfg data. Usually this is done as :*:itemdesc




Code: Select all

SendSysMessage(user, "Begining to unload npcdesc.cfg files...");

UnloadConfigFile(":*:npcdesc");
SendSysMessage(user, "Unloading :*:npcdesc");
UnloadConfigFile("::npcdesc");
SendSysMessage(user, "Unloading ::npcdesc");

foreach package in (Packages())
	if ( package.npcdesc )
		UnloadConfigFile(":"+(package.name)+":npcdesc");
		SendSysMessage(user, "Unloading :"+(package.name)+":npcdesc");
	endif
	Sleepms(2);
endforeach

SendSysMessage(user, "ReloadConfiguration() -> "+ReloadConfiguration());

SendSysMessage(user, "All npcdesc.cfg files unloaded.");
-Austin

Yukiko
Distro Developer
Posts: 2552
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: .unloadcfg - There is possible, now?

Post by Yukiko » Mon Nov 26, 2018 4:34 pm

Good to know Austin. Unloading the npcdesc.cfg never worked quite right when I tried it before but that was pre 096. Maybe something was changed in the Core since then.

Will unloading npcdesc.cfg or itemdesc.cfg and reloading them make new NPCs and/or items added prior to the unload/reload sequence available in game?
Sincerely,
Yukiko

I would tell you a UDP joke but you might not get it.

Titus 2:13

User avatar
Austin
Former Developer
Posts: 615
Joined: Wed Jan 25, 2006 2:30 am
Contact:

Re: .unloadcfg - There is possible, now?

Post by Austin » Mon Nov 26, 2018 6:30 pm

Yes for NPCs.

No for itemdesc.cfg
-Austin

Yukiko
Distro Developer
Posts: 2552
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: .unloadcfg - There is possible, now?

Post by Yukiko » Tue Nov 27, 2018 8:58 am

Cool. Thanks.
Sincerely,
Yukiko

I would tell you a UDP joke but you might not get it.

Titus 2:13

Post Reply