Full Version : Area-spawning
xmlspawner >>Q&A >>Area-spawning


<< Prev | Next >>

olsyke- 05-05-2006
hoi

im tryin to set up a spawner that adds some statics and wanted to know if there's a way to spawn a whole area full of these instead of adding every single entry with /location/(##,##,##)




ArteGordon- 05-05-2006
if you set the SpawnRange to the area that you want filled, and then enter the static you want spawned with the number that you want spawned, then that should do it.

Each spawn will be randomly placed within the area specified by SpawnRange. You can also specify the X1Y1 and X2Y2 coordinates of the spawner to specify a spawning area that is not necessarily centered on the spawner.

Setting the location just allows you to precisely place each one.

olsyke- 05-05-2006
okay now that seems to work perfectly...

just one more thing


what im building is a pool filled with blood

how would you do it ? using the x1y1 x2y2 for filling it with blood tiles and adding the walls around it with location(##,##,##) ?

or can there be more than one area specified for spawning ?


ArteGordon- 05-05-2006
no, you can only have one spawning area defined so you would have to use multiple spawners, or specify the locations for each of the wall statics.

What you might think of doing is to layout your pool, and then save it as a multiaddon using the [writemulti command.

Then you could just use a single spawner and spawn it with a single entry using the MULTIADDON keyword.

from xmlspawner2.txt

QUOTE

- added the new MULTIADDON keyword that allows you to directly import multi-component structure definitions from text files into an addon that can be spawned just like any other object.  (thanks to godfood for the idea)
The syntax is

MULTIADDON,filename

You can use it like any other spawnable keyword (e.g. ARMOR, LOOT, etc.) except you cant spawn it inside of containers or on mobs.

You can generate these multi files by hand, they can be exported from Orbsydia's UO Architect, or they can be created using the new [WriteMulti command.

The files will be automatically found if they are placed either in the main RunUO installation directory, or in the Spawns folder in the main RunUO installation directory.  Otherwise you must include the pathname.

Multi files are text files made up of a series of individual component entries.
Each entry must be on its own separate line with the following format:

itemid x y z visible [hue]
   
where 'x,y, and z' are the relative coordinate offsets of the component, 'visible' is 1 for visible components and 0 for invisible, and 'hue' values can be optionally specified for individual components.

To test it, just add a spawn entry like

MULTIADDON,execution.txt

where execution.txt is an existing multi file

The image below shows the results of spawning the multis contained in the files wall.txt and execution.txt.  Both of those files can be found in the xmlextras package.
user posted image

- added the new WriteMulti command that will allow you to create multi text files that can be imported in UO Architect or spawned with the MULTIADDON keyword.

WriteMulti <MultiFile> [zmin zmax][-noitems][-nostatics][-nomultis][-noaddons][-invisible]

The optional arguments are available to restrict the extraction to certain types of objects.

The -noitems flag will ignore all items
The -nostatics flag will ignore all static (frozen) tiles.
The -noaddons flag will ignore all addons and their components
The -nomultis flag will ignore all multis and their components
The -invisible flag will include invisible items (by default they are ignored)

You will be asked to target an area, and all items and statics within that area will be exported to the multi text file.

You can easily grab things like existing buildings, sections of existing buildings, addons, multis (like camps), or just bunches of objects that you would like to turn into an addon.

By specifying the min and max z, you can limit the exported items/statics to those within that z range.

The 'handle' (the 0,0,0 point) for the addon will be the location of the character when the area selection is completed.

The multi files will be written out into the Spawns folder by default.

If you try to overwrite a non-multi.txt file or a multi.txt file that you did not write, you will be blocked.
This is accomplished by looking for the first header line of the form

1 version staffname

where 'staffname' is the name of the character that wrote the file.  You can overwrite files that you have written, but you cannot overwrite others.
If the staffname is missing, then no one can overwrite it.

The image below is the healer in britain that was extracted using WriteMulti with the roof cut off and spawned using the MULTIADDON keyword.  It is included as healer.txt in xmlextras
user posted image


olsyke- 05-05-2006
hm i stumbled upon another problem... after setting x1y1 and x2y2 the area gets filled with statics... but a lot of tiles are missing and even some are on top of each other...

so i cant get the area filled smoothly

is there some options that could change this ?

ArteGordon- 05-05-2006
QUOTE (olsyke @ May 05, 2006 05:14 pm)
hm i stumbled upon another problem... after setting x1y1 and x2y2 the area gets filled with statics... but a lot of tiles are missing and even some are on top of each other...

so i cant get the area filled smoothly

is there some options that could change this ?

yes, I've been thinking about this. The reason for this is that the spawn location selection algorithm currently used simply selects random locations to spawn. If the location is occupied it will continue to search for other available random locations, but will stop after 10 attempts and will simply place it at the location of the spawner.
If you make a large spawn area, it is possible that random selection of 10 locations will fail to find an open spot.

I am going to be adding the option to specify different algorithms for placing spawns, including things like row-sequential, or progressive-radial. A row-sequential algorithm would be like a simple flood-fill, just selecting successively adjacent locations, so it would guarantee full filling of a spawn area.

I'll add it to the beta_309.zip when it is finished.

(edit)

a new spawn positioning algorithm control feature has been added for the next release. It is in beta_309.zip in the upcoming releases area.
http://xmlspawner.15.forumer.com/index.php?showtopic=53