.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

.unloadcfg - There is possible, now?

Post 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.
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: .unloadcfg - There is possible, now?

Post 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.
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Re: .unloadcfg - There is possible, now?

Post 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.");
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: .unloadcfg - There is possible, now?

Post 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?
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Re: .unloadcfg - There is possible, now?

Post by Austin »

Yes for NPCs.

No for itemdesc.cfg
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: .unloadcfg - There is possible, now?

Post by Yukiko »

Cool. Thanks.
Post Reply