Full Version : Use a spawner to spawn a spawner and add spawn's
xmlspawner >>Q&A >>Use a spawner to spawn a spawner and add spawn's
<< Prev | Next >>
godfood- 01-11-2006
Ok, I'm setting up a spawner that will, When placed in a container and " Respawned":
change the gumpid of the parent (done)
change the dropsound of the parent (done)
add new spawner to the pack (This one will stay in the pack) that is pre-set to (see next entry) or use the spawner to add entry's to the new spawner.
spawn recall rune and specific x/y in the pacl, 1000 gold bankcheck at specified x/y in the pack, etc...
turn the first spawner off (done)
How can i achieve this? Is there a way for it to "Spawn" a saved spawner?
ArteGordon- 01-11-2006
yes, you set the configfile property, and then set loadconfig to true (like with quest npcs).
from xmlspawner2.txt

QUOTE
- Added the LoadConfig and ConfigFile properties to the spawner allowing them to read their configuration information from an XML file. This is similar to the [xmlload command except that it does not create a new spawner to replace an existing one. This allows updating of selected properties without having to respecify all of the properties. e.g. having an .xml file that just contains the spawn object definitions being loaded into an existing triggered spawner would allow that spawner to have dynamically configured spawns. The spawner property names are identical to those contained in the standard [xmlsave files.
The dataset and table names have been changed to avoid any possible confusion as to what is intended to be a fully specified [xmlloadable .xml file and a partially specified config file. An example of several .xml config files are included in the xmlextras package.
Several ways in which this could be used would be to have a switch or other object target the spawner with the TargetProperty string "/configfile/dynamicspawn.xml/loadconfig/true" or have a spawner do the same thing with a spawned SET command "SET/configfile/dynamicspawn.xml/loadconfig/true" and the target spawner as the SetItem target, even having a spawner reconfigure itself.

The configfile is an XML file just like a normal spawner XML file, but it is used to set the properties on existing spawners instead of creating new spawners.
Because it works on existing spawners it doesnt have to specify all of the elements that a complete XML specification would. So it can just specify the things that you want to set or change on the spawner that loads it.
To make one, you can create a normal XML file by saving a spawner that has what you want using [xmlsave, and then edit the resulting XML file in the following way:
Change the name of the Spawns element to XmlSpawner
Change the name of the Points element to Properties
Edit out anything that you dont want configured when you load it in
Place the file in a folder named SpawnerConfigs in the main RunUO folder.
There is an example of one in the xmlextras package.
Then spawn your spawner like
xmlspawner/configfile/filename/loadconfig/true
and it will have everything set on it just as you wanted.
ApplyNow85- 07-18-2009

QUOTE (ArteGordon @ January 11, 2006 12:06 pm)
yes, you set the configfile property, and then set loadconfig to true (like with quest npcs).

why doesn't works? :S