Full Version : Question on group spawning
xmlspawner >>XMLSpawner Feature Request's >>Question on group spawning
<< Prev | Next >>
Dian- 01-22-2006
Hey, I was wondering if XmlSpawner2 is capable of spawning groups in tight packs.
For instance, in fire where hellhounds spawn, near the daemon and lich rooms.
The hellhounds would have a large range area to spawn, and the groups of 5 or 6 hellhounds could spawn in random area, but all within maybe a 6 tile square area, in a pack really.
Can this be done with the current version?
Also, if it cant, and maybe somthing you would want to work on for it, possibly the option of having 2 or more "packs" of 2 or more in each pack be able to spawn randomly within a large spawner area.
ArteGordon- 01-22-2006
No, that isnt a current feature, although I like the 'pack' idea.
I think that the easiest thing to do would be to add a new field like 'Range' to each entry along with the Subgroup and other entry fields.
This could be combined with the Subgroup setting to create packs.
You would add the creatures that you wanted and assign them to the same subgroup.
Then you could set each entries Range field.
If this wasnt set (the default), then creature for that entry would just be independently spawned across the spawners spawn range. But if it was set, then it would be used to place the spawn at that range from any existing spawns in that subgroup.
If there were no spawns yet in the subgroup, then it would be placed randomly across the spawnrange like normal spawns.
By assigning creatures to different subgroups, you could have multiple 'packs'. Also, by setting the ranges for each differently, you could have different distributions for the different creatures in the pack (some tight, others more spread out).
I like that. I'll do some fiddling.
Dian- 01-22-2006
Cool, glad you like it. It is actually how Hellhounds would spawn. ~4-6 of them wouls all spawn together, in a random area of the dungeon.
I would really like to mimoc this style of spawning, cant wait to see if you get somthing on that
ArteGordon- 01-22-2006
I have added this and just finished testing it out.
The way it works is basically the way I described it. By specifying the new pack range field 'Rng' for a spawn entry that is part of a subgroup, then that entry will be spawned within the specified range of the first existing spawn in that subgroup.
What this means is that things in a subgroup with a Rng setting will spawn next to one another.
If you have multiple subgroups, you can have multiple separate packs of spawns.
In the example below, subgroups 1 and 2 both spawn in separate packs, with the distance between the spawns in each pack given by the Rng setting for each entry.
So there is a pack of hellhounds, and then a separate mixed pack of harpies, trolls, and orcs, with the trolls farther apart than the harpies and orcs.
godfood- 01-22-2006
That's Pretty cool Arte . Great Idea Dian.
Now if there was only enough space for X1_Y1 and X2_Y2 in the advonced gump. We could less spawners to cover more areas and still have the ability to decide which creatures go where. Instead of just placing one spawner for an area with 4 different kinds of creatures.
Another thought is being able to "group" spawners. (Again I know you can use XMLFind for this ). What I'm thinking is when you have the gump open for any given spawner, it would have buttons (Like the pages) that would let you "Jump" to one of the other spawners in the "group". (Just a thought)
Dian- 01-23-2006
Wow, I dont know what to say, other than its perfect!
Thats exactly the idea I had in mind. I dont know what to say, other than Nice Work!
The only little thing I wonder, how about the distance between each mob within the pack. Think that could be editable? so If I wanted a pack of 8 Ophidians to spawn, I could tell spawner that they should be 2 tiles apart from the other on spawn (so long as they have valid landtile) or, If I want, 5 tiles apart from each other.. maybe even random space under the set # distance. make sence?
Or the square radius area editable they are allowed to spawn within, at spawn. You gould allow them to spawn randomly within a 6 square area, or set it to a 12 square tile area.. or, 3.
Heh, anyways, I cant wait to try that out!
ArteGordon- 01-23-2006

QUOTE
Or the square radius area editable they are allowed to spawn within, at spawn. You gould allow them to spawn randomly within a 6 square area, or set it to a 12 square tile area.. or, 3.

That is what the pack range (Rng) setting at the far right of the gump is. If you made it 12, then those spawns would appear randomly within a +- 12 tile box centered on the first spawn in the subgroup.
You can even give different spawns in the same subgroup different ranges, so you could have some spawn tightly together and others loosely around them as in the example that I showed. The trolls will spawn more loosely (Rng of 3) around the orc and harpy that will always spawn within 1 tile of one another (Rng of 1).
(edit)
if you would like to test it out, I have attached updated copies of xmlspawner.cs, basexmlspawner.cs and xmlspawnergumps.cs along with a sample XML file pack.xml that will load up in green acres.
Just [xmlload it and hit respawn a couple of times to see how it works.
It spawns two packs of creatures, and also a pack of items consisting of armor surrounded by invisible spike traps (muaahhhaaahaaa).
Dian- 01-23-2006
I am putting it in now, will let you know how it works!
Dian- 01-23-2006
I am sneaking away to try this real fast, so I cant look into it yet myself.. But initial run I got

CODE
- Error: Scripts\Addition\Engines\xml Spawner 306\BaseXmlSpawner.cs ine 9390, column 20) The type or namespace name 'XmlSpawnerAddon' co ound (are you missing a using directive or an assembly reference?)

I overwote the *.cs files, and dropped the packs.xml file in the root XmlSpawner directory.
Dian- 01-24-2006
Wow, I have just finally been about to set up a few areas the way I had in mind before asking about this spawning method, and I am speechless!
This is PERFECT!
This mod really allows some great detail in spawning now!
Thank You Art!