Page 1 of 1

.unloadcfg - There is possible, now?

Posted: Fri Nov 23, 2018 10:13 am
by Ciechu
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.

Re: .unloadcfg - There is possible, now?

Posted: Fri Nov 23, 2018 10:45 am
by Yukiko
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.

Re: .unloadcfg - There is possible, now?

Posted: Mon Nov 26, 2018 11:54 am
by Austin
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.");

Re: .unloadcfg - There is possible, now?

Posted: Mon Nov 26, 2018 4:34 pm
by Yukiko
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?

Re: .unloadcfg - There is possible, now?

Posted: Mon Nov 26, 2018 6:30 pm
by Austin
Yes for NPCs.

No for itemdesc.cfg

Re: .unloadcfg - There is possible, now?

Posted: Tue Nov 27, 2018 8:58 am
by Yukiko
Cool. Thanks.