Full Version : area effect
xmlspawner >>Q&A >>area effect
<< Prev | Next >>
ravyn38- 08-11-2007
I was wondering if there was a way to set up an area effect... like I want to spawn piles of gold in an area, but I dont want to have to put in an xyz for each and every spot in that area. any help would be greatly appreciated. Thanx
ArteGordon- 08-11-2007
there are a number of ways of doing this. If you just want piles of gold randomly placed within an area, you can do that using normal spawning.
Just set up the spawning area by setting either the SpawnRange property or the X1Y1,X2Y2 bounds.
You can set the number of piles you want by setting the maxcount for the spawner and the maxcount for the individual spawn entry.
If you want more than one pile to spawn at the same time, then set the 'Per' (spawns per tick) field in the extended spawner gump. (use the little arrow button in the lower right corner of the spawner gump to open this).
There are other special spawn control keywords that will let you place spawns in particular patterns, such as #XFILL and #YFILL

QUOTE
- added the ability to control the spawn positioning algorithm used for individual spawn entries. By default, spawn location is randomly selected from within the spawning area defined by SpawnRange or X1Y1 X2Y2. By adding one of the following control keywords to the beginning of the entry, several new positioning methods can be used.
#XFILL will add spawns by filling the spawn area progressively in rows of X.
#YFILL will add spawns by filling the spawn area in rows of Y.
#EDGE will add spawns only around the edge of the spawn area.
These can be used to systematically fill spawning areas, when random positioning is not desired.
For example, using the following spawn entry
#EDGE static,89
would spawn the specified statics only around the perimeter of the spawing area.
#XFILL static,82
would fill the spawning area with the given static (depending on the entry maxcount).
#YFILL orc
does the same thing, but fills first along Y instead of X.

QUOTE
- added an additional optional argument to the #XFILL, #YFILL, and #EDGE position control keywords that allows an increment value to be specified that will be added to each subsequent position value instead of the default of 1. Different values give some interesting fill patterns.
#XFILL[,inc]
#YFILL[,inc]
#EDGE[,inc]

Note that you now have to place a semicolon after any of those #XFILL, #YFILL, etc. keywords. The images shown above are for an older syntax when you didnt have to do that.
So something like
#XFILL,3 ; gold,50,100
would fill the spawn area with gold piles containing 50-100 gp with the piles spaced 3 tiles apart.
Again, you would want to set the maxcount and Per values to the number of piles that you wanted.
ravyn38- 08-11-2007
I think I've stated this previously, but I'm a blond, so things dont always make sense to me.... I tried using the XFILL and while it didnt have any issues with a static, once I told it to FILL with gold it got screwy on me....
ArteGordon- 08-11-2007
dont forget the semicolon after the #XFILL. The new syntax requires that after those # control words. This allows you to specify more than one in a single entry.
#XFILL ; gold/amount/1000
Also, while you can certainly set the amount property the way that you did in order to get a gold pile, you can also just call the gold constructor with an amount argument, like this
#XFILL ; gold,1000
which will do the same thing.
That is because the Gold class has multiple constructors defined, some of which accept amount arguments (most stackable items do.)
from gold.cs

CODE
[Constructable] public Gold() : this( 1 ) { } [Constructable]
public Gold( int amountFrom, int amountTo ) : this( Utility.RandomMinMax( amountFrom, amountTo ) )
{
}
[Constructable]
public Gold( int amount ) : base( 0xEED )
{
Stackable = true;
Amount = amount;
}

ravyn38- 08-11-2007
I'm running a 1.0 shard.... I tried this, and it is still not working... not sure if you're giving me the new 2.0 info or what....
ArteGordon- 08-11-2007
you must be using an older xmlspawner version. You can use the [smartstat command to see what it is.
ravyn38- 08-11-2007
it says version 3.08 not sure how old that is... I've been working on this shard for a LONG time trying to improve it and get it ready for opening to the public.
ArteGordon- 08-11-2007
3.08 is old. It doesnt support any of the # spawn control keywords. The current version is 3.21a
You can just drop the new version over the old version.
ravyn38- 08-11-2007
I live just north of indy... come fix it LOL
ravyn38- 08-11-2007
ok well, as time consuming as it was, I just did all the x/y/z's by hand... man... glad I dont have to take on that project every day I will look into updating my xml package
ArteGordon- 08-12-2007
updating is quite painless. Just replace the old xmlspawner package files with the new ones.