RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

XmlSpawner2

Erucid

Sorceror
ArteGordon said:
you probably have v3.09. That added animation but didnt support that additional argument to #XFILL

get the most recent v3.09b for that
Ok, I updated, and the error message went away BUT Oddly, it only spawns the tree with the leaves 1/2 of the time. The other half of the time it seems to spawn the trunk and leaves randomly as one would expect without this wonderfull add on. SO what am I doing wrong now?
 

ArteGordon

Wanderer
Erucid said:
Ok, I updated, and the error message went away BUT Oddly, it only spawns the tree with the leaves 1/2 of the time. The other half of the time it seems to spawn the trunk and leaves randomly as one would expect without this wonderfull add on. SO what am I doing wrong now?

did you put them both into the same subgroup so that they spawn together?

(edit)
here is a spawner that does it. Give it a try

Code:
<Spawns>
  <Points>
    <Name>TreeSpawner</Name>
    <UniqueId>249bc864-2f2b-4ce5-a2f5-08f305fbdd7e</UniqueId>
    <Map>Trammel</Map>
    <X>5436</X>
    <Y>1116</Y>
    <Width>10</Width>
    <Height>10</Height>
    <CentreX>5441</CentreX>
    <CentreY>1121</CentreY>
    <CentreZ>0</CentreZ>
    <Range>5</Range>
    <MaxCount>2</MaxCount>
    <MinDelay>5</MinDelay>
    <MaxDelay>10</MaxDelay>
    <DelayInSec>False</DelayInSec>
    <Duration>0</Duration>
    <DespawnTime>0</DespawnTime>
    <ProximityRange>-1</ProximityRange>
    <ProximityTriggerSound>500</ProximityTriggerSound>
    <TriggerProbability>1</TriggerProbability>
    <InContainer>False</InContainer>
    <MinRefractory>0</MinRefractory>
    <MaxRefractory>0</MaxRefractory>
    <TODStart>0</TODStart>
    <TODEnd>0</TODEnd>
    <TODMode>0</TODMode>
    <KillReset>1</KillReset>
    <ExternalTriggering>False</ExternalTriggering>
    <SequentialSpawning>-1</SequentialSpawning>
    <AllowGhostTriggering>False</AllowGhostTriggering>
    <SpawnOnTrigger>False</SpawnOnTrigger>
    <SmartSpawning>False</SmartSpawning>
    <Team>0</Team>
    <Amount>1</Amount>
    <IsGroup>False</IsGroup>
    <IsRunning>True</IsRunning>
    <IsHomeRangeRelative>True</IsHomeRangeRelative>
    <Objects2>static,12477:MX=1:SB=1:RT=0:TO=0:KL=0:RK=0:CA=1:DN=-1:DX=-1:SP=1:PR=-1:OBJ=#XFILL,0 static,12463:MX=1:SB=1:RT=0:TO=0:KL=0:RK=0:CA=1:DN=-1:DX=-1:SP=1:PR=-1</Objects2>
  </Points>
</Spawns>

(edit)

if you are spawning it with multiple pieces with non-zero offsets, it is possible that you are seeing the wraparound behavior of the #XFILL keyword when it extends beyond the edge of the spawnrange.
I have added a new #RELXY keyword that doesnt have that wraparound and just allows pure offsets. It will be in the next release and is available in the beta_310.zip update and the support forum in the upcoming releases section.
 

Erucid

Sorceror
Ok, you lost me on all that "subgroup", "wrap around" and "offset" talk. I put them both into the same spawner, one under the other on the entry fields.
 

ArteGordon

Wanderer
Erucid said:
Ok, you lost me on all that "subgroup", "wrap around" and "offset" talk. I put them both into the same spawner, one under the other on the entry fields.

Assigning multiple entries to a subgroup causes them to behave like a single entry so that they will always be spawned together. To assign the subgroup, just expand the spawner gump by pressing the little arrow button in the lower right corner.
Then look for the 'Sub' column for each entry and enter a subgroup number, for example '1'.
You will see the entries change color to indicate the subgroup assignment.

 

Erucid

Sorceror
ArteGordon said:
Assigning multiple entries to a subgroup causes them to behave like a single entry so that they will always be spawned together. To assign the subgroup, just expand the spawner gump by pressing the little arrow button in the lower right corner.
Then look for the 'Sub' column for each entry and enter a subgroup number, for example '1'.
You will see the entries change color to indicate the subgroup assignment.
:cool: That is soo cool. So tell me what the other entries do and how to set them. I've read the XMLSpawnerFan page, and have not come accross what all this means and how to use it. This XML is such a powerful add on, yet I'm only capable of using a small fraction mainly because I can't find the information I'm looking for, can't find an example of what I'm looking for, or can't figure out the correct sequence of switches.

Suchas

ADD/WEAPON,1,2/Hue/33
Will work, but
ADD/Daisho,1,2/Hue/33
Will not work

Or how about
ADD,0.3/WEAPON,1,2/Hue/33
will work, but
EQUIP,0.3/WEAPON,1,2/Hue/33
will not work

What I would love to see is a lengthy HOW TO doc on everything that this XML is capable of doing, and an example of each.

Of course, I expect alot from a free attachement to a shard I'm not even paying for. :D

Keep up the awesome work!!
 

ArteGordon

Wanderer
Erucid said:
What I would love to see is a lengthy HOW TO doc on everything that this XML is capable of doing, and an example of each.
So would I :)
In general, all of the information is buried in xmlspawner2.txt which describes all of the features as they were added. It isnt organized so that it is easy to find, but generally doing a string search through that file will turn up useful information.

I'm working on building up the HowTo section of the support site, and others have been contributing tutorials and other examples as well, so that side of things is still a work in progress.

ADD/WEAPON,1,2/Hue/33
Will work, but
ADD/Daisho,1,2/Hue/33
Will not work

WEAPON is a built in xmlspawner keyword that generates a random magical weapon that accepts two arguments which are the min and max attribute level of the weapon.

from xmlspawner2.txt

- added new keywords ARMOR, WEAPON, SCROLL, NECROSCROLL, POTION, that will create random magic items of the type specified.

ARMOR,min,max will drop a random piece of armor, shield, or jewelry with an attribute level randomly selected between min and max. min and max can range between 0 and 5 with 5 being the most powerful.
WEAPON,min,max does the same for weapons.
SCROLL,mincircle,maxcircle drops a random scroll between mincircle and maxcircle, POTION drops a random potion,
NECROSCROLL,index drops a necro scroll of the specified index.

Add these to the spec line in place of normal types, i.e. wherever you would use a typename like katana, or platehelm, just substitute these keywords.
These can either be used as the basic entry in a spawn spec, therefore spawning them directly, or they can be used with the ADD keyword to add them to a spawned mobs pack. e.g. "ogre/ADD,0.5/WEAPON,2,5" would spawn an ogre with a 0.5 probability of dropping a lev 2-5 magic weapon.

The spec line "ARMOR,5,5/name/Bruiser/hue/300/durability/200" would spawn a random piece of magic armor of level 5, name it Bruiser, turn it blue, and set its durability to 200.
The spec line "ogre/ADD,0.5/<ARMOR,5,5/name/Bruiser/hue/300/durability/200>" would add that piece of armor to a spawned ogres pack with probability 0.5
The line "GIVE/WEAPON,5,5" would give a level 5 magic weapon to the player that triggered the spawner.
The line "woodenchest/ADD/WEAPON,3,5/ADD/ARMOR,3,4/ADD/ARMOR,3,4/ADD/POTION/ADD/SCROLL,4,6/ADD,.1/<WEAPON,2,3/slayer/elementalban>" would spawn a chest with a magic weapon, two pieces of magic armor, a potion, a scroll, and occasionally a lev2-3 elemental slayer.

ADD/Daisho,1,2

would try to add the item Daisho by calling its constructor with two arguments 1 and 2. The Daisho object would have to have a constructor that supported those two arguments. It does not.
You would get the same complaint if you tried to manually add it using a command line like

[add Daisho 1 2

which does the same thing. It will tell you that it only supports the zero-argument constructor, like

[add Daisho

so similarly, you would only be able to use

ADD/Daisho

in a spawn entry.
Or how about
ADD,0.3/WEAPON,1,2/Hue/33
will work, but
EQUIP,0.3/WEAPON,1,2/Hue/33
will not work

actually the EQUIP entry would work if the item could actually be equipped. You need to make sure that the layer it would equip to is not already occupied.
Use the UNEQUIP keyword to do this.
- added the new "UNEQUIP,layer[,delete]" keyword that allows you strip a mobile of an equipped item on the specified layer. If the optional "delete" argument is specified, then the removed item will be destroyed, otherwise it will simply be dropped into the the mobiles pack.

for example

banker/UNEQUIP,OneHanded/EQUIP/WEAPON,1,2

would spawn a banker, unequip anything it already had on the OneHanded layer and then equip a random magical weapon between level 1 and 2.

If you used the ADD keyword instead, it would just put in into the banker's pack.

banker/ADD/WEAPON,1,2

(edit)

one thing to point out is that those spawn entries are always evaluated from left to right, which is why when you do

banker/UNEQUIP,OneHanded/EQUIP/WEAPON,1,2

it first unequips what it is carrying, and then equips the new thing. If you did it in a different order, it would not be the same, for example

banker/EQUIP/WEAPON,1,2/UNEQUIP,OneHanded

would first try to equip the new weapon, and then would unequip whatever it had in the one handed slot. Very different.
 

Shadow1980

Wanderer
Finally got around updating from a fairly ancient version to the latest version, I am sure Zyle will be thrilled ;-) (She has been asking me for ages)

Thank you so much for all the new features and for your continued support Arte. We wouldn't have been able to create Prophecies without the Xmlspawner2 system, it is truly one of the foundations under many of our systems!
 

ArteGordon

Wanderer
snicker7 said:
yo, arte, love the spawner, just getting used to some of the more advanced features.. but there was something I wanted to ask/suggest.

I noticed that when using the ADD keyword to add objects to containers and the like, they don't seem to be counted as part of the "spawn" for that spawner, meaning they don't despawn when the spawner is reset or despawned. I was wondering if it was possible to add an argument to ADD like ADD[,bool despawn] where it would if you set that arg to true?

Another thing I wanted to ask is if there was a way to clear the contents of a container, or even get an object by type or name within a specified container. I was working on adding town spawns of misc items to crates and chests and wanted to do it with a single spawner rather than adding multiple spawners (one per container), so something like

GETINCONTAINER,name,type/<properties or keywords>/

that way I could have a single spawner that did sometihng like

SETONNEARBY,3,,largecrate/GETINCONTAINER,,banana/DELETE/

but that wouldn't be necessary really if the ADD keyword had the above addition. I don't want to feel like I am imposing on you at all, I just wouldn't feel right modding your code, and I thought you might like the suggestions...

the upcoming v3.10 release has a new argument for SETONNEARBY that allows you to access container contents. You can get a preview here
http://xmlspawner.15.forumer.com/index.php?showtopic=53
 

snicker7

Sorceror
Looks awesome Arte, can't wait till we can get it on the server.

One thing I wanted to point out, I managed to crash the server with a questholder object by setting the Objective1 to "COLLECTNAMED,<name>,<type>," I think that comma on the end caused an exception and blew it up. In addition, the string format for the gump when a COLLECTNAMED objective was set was wrong. However, we are running version 3.04, so I don't know if that has been corrected already or not.
 

ArteGordon

Wanderer
snicker7 said:
Looks awesome Arte, can't wait till we can get it on the server.

One thing I wanted to point out, I managed to crash the server with a questholder object by setting the Objective1 to "COLLECTNAMED,<name>,<type>," I think that comma on the end caused an exception and blew it up. In addition, the string format for the gump when a COLLECTNAMED objective was set was wrong. However, we are running version 3.04, so I don't know if that has been corrected already or not.

yes, that one was fixed in 3.09

- fixed a possible crash bug involving certain invalid quest objective strings. (thanks to LowCastle for pointing this out)
 

snicker7

Sorceror
Are there any ways to get an NPC to trigger a spawner and use the appropriate TrigMob values in the spawner to refer to that NPC?
 

ArteGordon

Wanderer
snicker7 said:
Are there any ways to get an NPC to trigger a spawner and use the appropriate TrigMob values in the spawner to refer to that NPC?
You cannot get them to trigger in the same way that players will activate a spawner based on proximity, but you can set the MobTriggerName and MobTriggerProp values to trigger off of a named npc.

The triggering npc should have a unique name (that is how it is located). Then you can set the trigger prop to the condition on the npc required to activate the spawner.

from xmlspawner2.txt

- added player and mob property triggered spawning. By specifying a property test string in PlayerTriggerProp, you can trigger based upon the value of a property on a player within the proximity range of the spawner. For example setting PlayerTriggerProp to hits<50, would cause the spawner to trigger whenever a player within range fell below 50 health. Other properties could be used to trigger when a player got hungry (hunger<5), or tired (stam<30), or was a criminal (criminal=true), or was fighting (combatant!(-null-)).
Any property that is visible with the [props command, can be tested and the value to test against will be the value that appears there (or with the [get propname command)
Mob property triggered spawning is identical to player property triggering except that you specify a mob name in the MobTriggerName field, and then set the property test in MobTriggerProp. This will trigger whenever a player comes within proximity range of the spawner and the uniquely named mob is found and satisfies the property test specified in MobTriggerProp.
Note that this mob can be anywhere in the world, it is the player that sets off the trigger and therefore has to be in range.
These can be combined with any of the other triggering options so that, for example, a player holding a named quest item, could trigger a spawn based upon his fame or karma, (with different fame levels triggering different spawns), depending on the health of a named mob that he was doing combat with.

The description was for the initial implementation. The current version of the spawner also allows triggering without player proximity.
If Mob trigger name and property is set and ProximityRange is set to -1 then the trigger will be checked on each spawner OnTick (min/maxdelay settings) even with no players around.

(edit)

real proximity range npc triggering is really easy to add, but I've never really had a circumstance to use such a thing. I might consider it.
 

snicker7

Sorceror
ah, how could I set it to only trigger when the mobile is in range? I'm trying to set up a small quest where a player accepts an escort and they are then brought to a certain spawner location. when the mobile reaches the spawner location I want them to perform certain actions. My thoughts on the approach were to use a spawner to be triggered by a mobile much in the same way players could, but I soon discovered this was not possible. Any ideas on how to do this? My only other idea was to code a new mobile and just to do a SETONNEARBY every tick on those mobtypes.

I hate to be the guy that is always offering new suggestions, but how difficult would it be to set up an enumerated prop on the spawner for valid trigger-ers? Something like PlayerOnly,NPCOnly,Both (where playeronly is how it is now)
 

ArteGordon

Wanderer
snicker7 said:
ah, how could I set it to only trigger when the mobile is in range? I'm trying to set up a small quest where a player accepts an escort and they are then brought to a certain spawner location. when the mobile reaches the spawner location I want them to perform certain actions. My thoughts on the approach were to use a spawner to be triggered by a mobile much in the same way players could, but I soon discovered this was not possible. Any ideas on how to do this? My only other idea was to code a new mobile and just to do a SETONNEARBY every tick on those mobtypes.

I hate to be the guy that is always offering new suggestions, but how difficult would it be to set up an enumerated prop on the spawner for valid trigger-ers? Something like PlayerOnly,NPCOnly,Both (where playeronly is how it is now)
well, it is really easy to do, but I'm not sure it is the best way to do that. I think that this thing on the todo list might be more effective

- add the DISTANCE,objectname[,objecttype] special keyword that returns the distance of the object from the spawner. This could be combined with the TriggerObjectProperty or MobTriggerProp property of the spawner to control spawner activation when a particular item or mob was in range.
 

snicker7

Sorceror
Ah I could definately use that. In the meantime, I am just going to name the mobiles all the same and do it that way. Thanks again Arte.
 
My spawner spawns special mobile at the TODStart and despawn it at the TODEnd. The problem is to disable autorespawning if this mobile has been killed. How to achieve this? That's for my hybrid Scripts/XmlSpawner quest of Vampire.
 

ArteGordon

Wanderer
snicker7 said:
Ah I could definately use that. In the meantime, I am just going to name the mobiles all the same and do it that way. Thanks again Arte.
I dont think that you have to name them the same. If you give an empty name to SETONNEARBY then it should ignore the name and just check the type.

SETONNEARBY,10,,troll/hue/50

will set the hue of all nearby trolls to 50 regardless of their name.
 
Top