Full Version : Using XMLSPawner is there a way to...
xmlspawner >>XMLSpawner - Discussion >>Using XMLSPawner is there a way to...
<< Prev | Next >>
Greystar- 02-28-2008
I took the BlackRock stuff found on runuo and added the ability to "Corrupt" mobiles it wasn't included. Anyway with xmlspawner is there a built in way to make it so a spawner will look for x amount of items in the same area then to spawn a mobile in that area? IE a BlackRockElemental.
So say there is a pile of blackrock at x,y,z that fits the criteria then it makes a BlockRockElemental spawn at x,y,z like it was created out of the blackrock piles that their by their corrupting power.
I figure I could do this buy creating a "Shard Poller" item that scans the facet and if x blackrock it exists to manually create a blackrockelemental but I wanted to know if this is something that's already possible using XMLSpawner.
ArteGordon- 02-29-2008
you can look for the presence of an item, and check the number of items in a stack using the GETONNEARBY keyword

QUOTE
- added the 'GETONNEARBY,range,name[,type][,searchcontainers],property' keyword that can be used to get or test properties on nearby items or mobiles. This can be used in property assignments or property tests. If more than one of the specified object is found, it will only return the value from one.
For example, to test to see if someone has placed the longsword named "Grizzleblag" on the ground near the spawner you could use a condition test like
GETONNEARBY,1,Grizzleblag,longsword,visible=true
Or you could get the size of a pile of gold in a nearby container with
SENDMSG/{GETONNEARBY,1,,gold,true,amount} gold pieces are in the container

What this wont do is to tell you how many of an item are nearby if there are more than one since it only returns information on the first matching item that it finds.
There is an AMOUNTCARRIED keyword that will tell you the total amount of an item that a player is carrying, but there isnt a keyword that will do the same thing for things in the world.
A combination of those two, like an AMOUNTNEARBY keyword would be what was required. I will think about that.
Greystar- 02-29-2008

QUOTE (ArteGordon @ February 29, 2008 07:25 am)
you can look for the presence of an item, and check the number of items in a stack using the GETONNEARBY keyword

QUOTE
- added the 'GETONNEARBY,range,name[,type][,searchcontainers],property' keyword that can be used to get or test properties on nearby items or mobiles. This can be used in property assignments or property tests. If more than one of the specified object is found, it will only return the value from one.
For example, to test to see if someone has placed the longsword named "Grizzleblag" on the ground near the spawner you could use a condition test like
GETONNEARBY,1,Grizzleblag,longsword,visible=true
Or you could get the size of a pile of gold in a nearby container with
SENDMSG/{GETONNEARBY,1,,gold,true,amount} gold pieces are in the container

What this wont do is to tell you how many of an item are nearby if there are more than one since it only returns information on the first matching item that it finds.
There is an AMOUNTCARRIED keyword that will tell you the total amount of an item that a player is carrying, but there isnt a keyword that will do the same thing for things in the world.
A combination of those two, like an AMOUNTNEARBY keyword would be what was required. I will think about that.
I'll have to look through the XMLSpawner docs and examples you provide to combine something with
{GETONNEARBY,1,,gold,false,amount}
with a spawner to make a blackrock ele appear. I'm at work right now so I'm not near my code, however I could just download XMLSpawner and read the docs at work.
Also is there a way to find all XMLSpawners using XMLFind that have a bad spawn entry... Like it's trying to spawn a mobile that doesn't exist, but the other spawns in the list work fine? Or will it just give a bad spawn log if there are any such spawns setup. I imported an XML File that was set up to Spawn ML areas using MilkMan Dan's scripts but I already had most of the OSI accurate mobiles that where named differently through scripts provided by Malganis and I wanted to make sure none of the imported spawners where incorrectly trying to fire.
PS) this isn't a high priority since I'm still trying to make the BlackRock Eles Infection to work then I'll have to make it so my copy of RunUO accepts custom ores since I'm making it so that the Corrupted Ore (any normal ore influenced by blackrock becomes corrupted ore (or BlackRock Ore), even though the Clilocs referr to BlackRock as a Reagent or an Arcane Focus) is a resource that I can craft with. Then when I get all that working I'll worry about figureing out a way to spawn a blackrock ele. I just thought of a way as I was typing, but it would require turning the BlackRock ore itself into a Spawner untill it was turned into Ingots.
ArteGordon- 02-29-2008
there is a checkbox down near the bottom left corner of the [xmlfind gump that will let you search for spawners with errors (the 'err' checkbox).
Just set the Type as 'xmlspawner', and then check the 'Err' box and do a search.
That will find spawners that have invalid mobiles which are also reported in the badspawns log.
Greystar- 02-29-2008

QUOTE (ArteGordon @ February 29, 2008 02:21 pm)
there is a checkbox down near the bottom left corner of the [xmlfind gump that will let you search for spawners with errors (the 'err' checkbox). Just set the Type as 'xmlspawner', and then check the 'Err' box and do a search. That will find spawners that have invalid mobiles which are also reported in the badspawns log.

Thanks, when I get home I'll check into that when I start my shard. I had imported all the XML files then saved and shutdown so I didn't give them all a chance to start firing yet to get a spawn.log.
My G/F was having a bad night a work when she got home she was upset so I had to stop doing stuff with the shard and lend her my attention.