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

Corbomite

Wanderer
Setting spawn Home at triggering

Anyone know the easiest way to get a mob to spawn say 3 tiles from a triggering player? I want to use one spawner to cover a large area, and have the mob spawn near but not directly on the triggering player (based on use of a skill) who can be anywhere in the proxtrigger range. I think I can set the X,Y and Z of the triggered mob to {GETONTRIGMOB,x} but i suspect that parameter will not handle an addition operator such as {GETONTRIGMOB,x+3}. Even setting the center of the spawn range of the mob to the triggering player's position would work for me.
 

ArteGordon

Wanderer
Corbomite said:
Anyone know the easiest way to get a mob to spawn say 3 tiles from a triggering player? I want to use one spawner to cover a large area, and have the mob spawn near but not directly on the triggering player (based on use of a skill) who can be anywhere in the proxtrigger range. I think I can set the X,Y and Z of the triggered mob to {GETONTRIGMOB,x} but i suspect that parameter will not handle an addition operator such as {GETONTRIGMOB,x+3}. Even setting the center of the spawn range of the mob to the triggering player's position would work for me.

you can do it in two steps using the INC keyword like this

orc/x/GETONTRIGMOB,x/y/GETONTRIGMOB,y/y/INC,3/x/INC,3

that will first set x,y to the location of the triggering mob, and then increment x and y by 3.
 

ArteGordon

Wanderer
Erucid said:
In the course of an XML dialoge, is there a command to make the NPC bow to the player?

If you check out the upcoming update, there is a new ANIMATE keyword that will allow you do to things just like that. In fact, I had used the bowing animation as an example.
http://xmlspawner.15.forumer.com/index.php?showtopic=53

To use this in an XmlDialog you would set the Action field to something like

SETONTHIS/ANIMATE,32,5

where 32 is the action for bowing, and 5 is the number of frames in that animation.

(edit)

here is what it would look like
 

ArteGordon

Wanderer
Make creatures only attackable by questers

here is a handly little mod based on a suggestion that LordHogFred made a while back that people might find useful.

The following modifications to PlayerMobile.cs and BaseCreature.cs will allow you to spawn creatures that can only be attacked by players carrying a specified named item, such as a questholder.

Once you have made these changes, to create a creature that can only be attacked by a quester, simply spawn them with an XmlData attachment named "RestrictAttack" with the Data assigned the name of the item the player must be carrying to attack it. Like this spawn entry

dragon/ATTACH/xmldata,RestrictAttack,Dragon Quest

This dragon can now only be attacked by, and will only attack players carrying the item named "Dragon Quest".

http://xmlspawner.15.forumer.com/index.php?showtopic=410
 

ArteGordon

Wanderer
updated to version 3.09

from the changelog

New to version 3.09
updated 5/7/06

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

- fixed a parsing problem with extended compound conditional tests in the TriggerOnCarried or NoTriggerOnCarried strings. (thanks to Corbomite for pointing this out)

- added support for exporting custom houses using the [WriteMulti command.

- added support for specifying an empty escortable name in the ESCORT quest objective. (thanks to Zyle for the suggestion) The new syntax makes the mobname optional

ESCORT[,mobname][,proptest]

So using an objective string like

ESCORT

will allow you to satisfy the objective by escorting any talkingbaseescortable regardless of their name.

- added the ANIMATE,action[,framecount][,repeatcount][,forward true/false][,repeat true/false][delay] keyword to add animations to any mobile.
For example,

SETONTRIGMOB/ANIMATE,32,5,1,true,false,0

would cause the triggering player to bow.

Or used in the Action field on an XmlDialog it could be used to make an npc bow, like

SETONTHIS/ANIMATE,32,5,1,true,false,0



You can use InsideUO to find the animations available for different bodies and figure out the corresponding action numbers based on their order in the list (starting with zero).

- added the XmlFreeze[,seconds] attachment that allows you to permanently or temporarily freeze a mobile in place. If attached with no duration argument, they will remain frozen until the attachment is removed.
This can be used with the ANIMATE keyword to keep mobs from moving while animations are applied.

orc/ATTACH/xmlfreeze,10

would spawn the orc frozen for 10 seconds.

SETONTRIGMOB/ATTACH/xmlfreeze,10/MSG/You are frozen with fear!

would freeze the triggering player for 10 seconds and send them a message.

- 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.



- modified some of the stat and skill mod attachments such as XmlStr, XmlDex, XmlInt, XmlSkill and the fame, karma, and virtue attachments XmlAddFame, XmlAddKarma, XmlAddVirtue so that spawners dont report an error when they attach them.
The functionality remains exactly the same, it just eliminates the error messages reported by spawners that were inaccurately indicating that the attachments had not worked even when they had.

- added the new OFFSET,x,y[,z] keyword that can be used to shift the location of an object in a single operation.

SETONTRIGMOB/OFFSET,5,7,3

would move the triggering player by the specified x,y,z amount. This is the same as incrementing the individual x,y,z values like

SETONTRIGMOB/x/INC,5/y/INC,7/z/INC,3

but it does it in a single step and so is smoother in appearance.
 

ArteGordon

Wanderer
updated to version 3.09a

from the changelog

New to version 3.09a
updated 5/8/06

- added two new spawn position control keywords, #PLAYER, and #WAYPOINT.

#PLAYER[,range] - places the spawns around the triggering player.

#WAYPOINT,prefix[,range] - places the spawn at the location of randomly selected waypoint runes that start with the given prefix.

spawn a group of orcs within 2 tiles of the triggering player.


place spawns at the randomly selected named waypoints


- 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]







- fixed a problem displaying entries with the new control keywords in the properties list during mouseover of the spawner crystal.
 

snicker7

Sorceror
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...
 

Erucid

Sorceror
Having fun spawning statics. You'd be amazed how useful this is. I'm sure that spawning random dungeons where walls and doors change is not far off. For now, I'd like to know how I scan spawn a tree with it's leafs on it please. Thanks
 

ArteGordon

Wanderer
Erucid said:
Having fun spawning statics. You'd be amazed how useful this is. I'm sure that spawning random dungeons where walls and doors change is not far off. For now, I'd like to know how I scan spawn a tree with it's leafs on it please. Thanks

you can spawn trees just like other statics. They are generally made up of several pieces. Note that leaf statics will be automatically hidden/shown based on the map seasonal settings.

A little tip for spawning things that have multiple pieces. You can use the positioning control keywords like #XFILL to position a spawn relative to the last spawn placed. So putting these two spawns into the same subgroup would spawn them at the same location

static,12477
#XFILL,0 static,12463

the first one would be placed randomly, and the second one would be placed relative to the first one in rowfill fashion, with an x increment of 0.

(edit)

which is just a long way of saying "at the same spot"
 

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...


It would be easier to just put the spawners into the crates, but I think that having a position control keyword to put spawns into containers is an interesting idea.

Having the spawner track items that you ADD could be tricky. I would have to think about that.

The GETINCONTAINER idea is interesting as well.

I will think about all of these things as they generally relate to container spawning.
My approach to that sort of thing has just been to put the spawners into the containers, but there could be some interesting alternatives.

(edit)

another way to consider is to spawn xmlspawners with the items that you want on it (xmlspawners are just another item after all).
You can set the "addspawn" property on the spawner to add entries on the fly.
That way the spawners will keep track of the items the way that you were thinking for the ADD keyword.

For example, you can make a spawner with an entry like

xmlspawner/maxcount/2/mindelay/00:02:00/maxdelay/00:05:00/addspawn/gold,500/addspawn/ARMOR,1,1

that would create a spawner with two spawn entries, a maxcount of 2, and a min/maxdelay of 2-5 mins.

That allows one spawner to control a number of other spawners.
Here is an example of that
http://xmlspawner.15.forumer.com/index.php?showtopic=76
 

snicker7

Sorceror
thanks for the consideration, like I said, these are only dreams.

I suppose spawning XMLSpawners would work, the main goal is to just have ONE spawner that could spawn items for any crates/barrels/etc within X tiles. If I spawn the xmlspawner, can I add subgroups with the addspawn command? I would like to make them spawn, and delete themselves (and their spawn) after 12 hours or so.. by which time the master spawner will have respawned some XMLSpawners again.

However, even though it keeps maintenance down on this, it still defeats my goal of as little XMLSpawners as possible to do this. I will try it out though, thanks =]
 

snicker7

Sorceror
running into one problem. how would I get the spawned spawners in containers to self delete? addspawn/<SETONTHIS/DELETE>/ doesn't seem to work.
 

ArteGordon

Wanderer
snicker7 said:
running into one problem. how would I get the spawned spawners in containers to self delete? addspawn/<SETONTHIS/DELETE>/ doesn't seem to work.

You can despawn specific subgroups using the

DESPAWN[,spawnername],subgroup

keyword.

if you wanted to assign a spawn entry string that had restricted chars (like '/') then you would have to put it at the end of the entry string and use the literal string operator '@' so that it wouldnt be parsed and would be treated as a pure string.

addspawn/@SETONTHIS/DELETE

from xmlspawner2.txt

- Added a literal modifier for setting of property values with otherwise invalid chars. Preceding a property value with the '@' sign will cause the remainder of the line to be assigned as the value. This can be used to assign strings that contain otherwise illegal chars such as the '/'. For example, to set the new Rewardstring property on a quest object you might use the spawn spec "questnote/name/blazequest/Rewardstring/@GIVE/<longsword/name/Blazer/weaponattributes.hitfireball/50>" this would set the Rewardstring property on the questnote to the string "GIVE/<longsword/name/Blazer/weaponattributes.hitfireball/50>". When combined with the new substitution delimiters, a reward spawner could read the Rewardstring property and spawn the string that it contained by using the spawn spec "{GETONCARRIED,blazequest,Rewardstring}" which would then become the spawn spec "GIVE/<longsword/name/Blazer/weaponattributes.hitfireball/50>".

to manipulate the settings for particular spawn entries (such as assigning subgroups), you can use the SETONSPAWNENTRY keyword

- added the new "SETONSPAWNENTRY[,spawnername],entrystring/prop/value/..." keyword, that allows you to modify the individual spawn entry properties on a spawner. (thanks to Todo for the suggestion) The entrystring argument will be used to find all spawn entries containing the specified string. If the spawnername argument is omitted, then the current spawner will be used. If the entrystring is a numeric value, then it will be used as a zero-based index into the spawn entry list rather than as a string match.

For example, the entry

SETONSPAWNENTRY,testspawner,orc/maxcount/5/subgroup/1

would find all entries containing the string 'orc' on the spawner named 'testspawner', and set the maxcount of those spawn entries to 5 and their subgroup to 1

SETONSPAWNENTRY,testspawner,0/maxcount/5/subgroup/1

would find entry number 0 (the first entry) on the spawner named 'testspawner', and set the maxcount of that entry to 5 and its subgroup to 1


Spawn entry properties that are accessible to this keyword include:

string TypeName
int MaxCount
int SubGroup
int SpawnsPerTick
int SequentialResetTo
int KillsNeeded
bool RestrictKillsToSubgroup
bool ClearOnAdvance
double MinDelay
double MaxDelay.

Note that these are all properties that can also be seen and set in the expanded spawner gump.

- added the example spawnerspawner.xml that demonstrates the use of the new SETONSPAWNENTRY keyword by spawning an xmlspawner with specified spawn entries.
 

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...


one approach to this would be to add a

DELETECONTENTS[,name][,type][,recurse]

keyword, that could operate on containers or mobiles, so that you could do something like

SETONNEARBY,3,,largecrate/DELETECONTENTS,,banana

Another possibility would be to add an additional argument to SETONNEARBY to allow it to access contents of containers or mobiles like

SETONNEARBY,range,name[,type][,searchcontainers][,searchmobiles]/prop/value/prop/value...

that would let you do

SETONNEARBY,3,,banana,true/DELETE

I'll think about that.
 

ArteGordon

Wanderer
a quick update to v3.09b

from the changlog
New to version 3.09b
updated 5/9/06

- fixed a problem with the GUMP keyword not bringing up gumps in the latest v3.09 release. If you had already installed v3.09a, just replace the v3.09a version of BaseXmlSpawner.cs that is in XmlSpawner2-v309b-2of3.zip
 

Corbomite

Wanderer
Quote:
Originally Posted by Corbomite
Anyone know the easiest way to get a mob to spawn say 3 tiles from a triggering player? I want to use one spawner to cover a large area, and have the mob spawn near but not directly on the triggering player (based on use of a skill) who can be anywhere in the proxtrigger range. I think I can set the X,Y and Z of the triggered mob to {GETONTRIGMOB,x} but i suspect that parameter will not handle an addition operator such as {GETONTRIGMOB,x+3}. Even setting the center of the spawn range of the mob to the triggering player's position would work for me.

you can do it in two steps using the INC keyword like this

orc/x/GETONTRIGMOB,x/y/GETONTRIGMOB,y/y/INC,3/x/INC,3

that will first set x,y to the location of the triggering mob, and then increment x and y by 3.
__________________

Works Beautifully. Thanks Arte!
 

ArteGordon

Wanderer
Corbomite said:
Works Beautifully. Thanks Arte!

You can now also do this with the #PLAYER[,range] spawn position control keyword. Just put it at the beginning of the spawn entry and it will automatically put the spawn around the triggering player.

#PLAYER,3 orc
 

Erucid

Sorceror
ArteGordon said:

static,12477
#XFILL,0 static,12463

the first one would be placed randomly, and the second one would be placed relative to the first one in rowfill fashion, with an x increment of 0.

(edit)

which is just a long way of saying "at the same spot"
Nope, I got the creatures to BOW properly in XMLdialoge when I want, so I'm using the most recent version but I get an error message in the spawner gump saying Invalid # specification :#XFILL,0 Any Advice?
 

ArteGordon

Wanderer
Erucid said:
Nope, I got the creatures to BOW properly in XMLdialoge when I want, so I'm using the most recent version but I get an error message in the spawner gump saying Invalid # specification :#XFILL,0 Any Advice?

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

get the most recent v3.09b for that
 
Top