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

ArteGordon

Wanderer
odd indeed. I havent tested it with the 3d client so it is quite possible there is some issue with text entry.
Unfortunately, there arent many options for text entry in gumps. One thing to try is perhaps changing the text hue.

you can try changing it by going into xmlspawner2.cs around line 7890 and changing

AddTextEntry( 35, 30, 200, 251, 0, 0, str );

to something like

AddTextEntry( 35, 30, 200, 251, 0x384, 0, str );

and see if it changes the behavior.

While it is a minor hassle, one way to edit long text strings in the spawner is to name the spawner, do an [xmlsave tmpxml spawnername, and then open up the tmpxml file, edit the text there, and then load it back with [xmlload tmpxml.
 

nix4

Wanderer
Ok tried changing the color, dosnt help as once the text hits the end of the extended gump it isnt visible via the client, so making it white dosnt make it visible.

wonder if I can find an example of this that works and try to find the function and post it here...I'll give that a shot.

Not sure if it matters but Basebook.cs works fine in my client perhaps that contains a function that might prove useful.
 

ArteGordon

Wanderer
updated to version 2.26

from the changelog

New to v2.26
- Added the "[xmlimportmap filename" command that allows .map files to be loaded.
- Added the TriggerAccessLevel property that lets you set the access level required to proximity trigger the spawner.
- Added the commands [xmlnewload and [xmlnewloadhere.
- modified the [xmlload and [xmlunload commands to also support recursive subdirectory loading/unloading of .xml files.

DESCRIPTION:
- added the TriggerAccessLevel property that lets you set the access level required to proximity trigger the spawner (the level is Player by default). Any player at the specified access level or below will be able to trigger the spawner. This can be used for testing spawner triggering while remaining at admin access levels.

- added the "[xmlimportmap filename" command that allows .map files to be loaded. Note, this will only add, not replace spawners, so calling this more than once with the same .map file will result in duplication. If you wish to be able to [xmlunload spawns defined in .map files, you should import them and then [xmlsave them into an xml file. You can then unload and load them as you could any xml spawn file. If a directory name is specified as the filename argument, then the directory will be recursively searched for all .map files beneath it.

- modified the [xmlload and [xmlunload commands to also support recursive subdirectory loading/unloading of .xml files. when a directory name is given instead of a filename.

- modified MinDelay and MaxDelay properties to readjust the spawn timer immediately when they are set. Previously the timer would retain the previous countdown until the next OnTick so that when min/maxdelay values were modified they would not take effect immediately.

- added the commands "[xmlnewload filename [spawner prefix]" and "[xmlnewloadhere filename [spawner prefix][-maxrange range]" which are the same as the [xmlload and [xmlloadhere commands except that they do not attempt to replace existing spawners by checking for matching GUIDs (the unique id that every xmlspawner gets), but rather automatically add new spawners and assign them new GUIDs on loading. They also override any specified Map settings in the file and use the players current map instead. This allows you to make a .xml file and use it as a template for creating spawners that can be placed repeatedly. Note, that you will not be able to [xmlunload spawners that are loaded in this way since there would not be a file containing the new GUIDs. If you wish to be able to unload them, then after loading spawners in this way, I would recommend doing an "[xmlsave filename [spawner prefix]" of them so that they are now uniquely defined in their own "[xmlunload"-able file.
The [xmlnewload" command can also be used to copy spawns between felucca and trammel. For example, to duplicate felucca in trammel, go to felucca and do an [xmlsave, then go to trammel and do an [xmlnewload (thanks to Quantos for the suggestion).

- added the -maxrange option to the [xmloadhere and [xmlnewloadhere commands that allows the user to determine the range beyond which spawners will not be loaded with a relative location (i.e. if they are farther than maxrange from the first spawner in the file, which determines the origin for loadhere, then they are loaded with their absolute coordinates as defined in the file. default is 48 tiles). The syntax is "[xmlloadhere filename [spawner prefix][-maxrange range]" or "[xmlnewloadhere filename [spawner prefix][-maxrange range]"
 

ArteGordon

Wanderer
nix4 said:
Ok tried changing the color, dosnt help as once the text hits the end of the extended gump it isnt visible via the client, so making it white dosnt make it visible.

wonder if I can find an example of this that works and try to find the function and post it here...I'll give that a shot.

Not sure if it matters but Basebook.cs works fine in my client perhaps that contains a function that might prove useful.
I've been testing the book idea and it looks good! The books have larger capacity and better editing support as well. Thanks for the suggestion. I may put it in to the next or an upcoming release (depending on testing).
 

Daegon

Wanderer
It might be useful (would for us, at least, if no one else finds it useful, I can do it) if you added an option to find a file.

[xmlload myspawn

would search a root path defined in the script for any file matching myspawn.xml. If multiple files are found, it either fails or dumps text to the user telling them the exact paths to use.

Also, a function to throw a gump to a user showing them all possible XML files with buttons to load/unload them :)

Maybe a bit over the top / or unneeded. We already have ~100 XML files and its getting tough to manage them easily.
 

ArteGordon

Wanderer
I'm working on some gump interfaces for finding items/mobs/spawners and adding .xml files is a good idea. I'll look into it. Thanks for the suggestion!
 

nix4

Wanderer
Efficient Spawning

Okay, so I almost have trammel fully spawned using XMLSpawner and my server.exe for runuo is using up 30 CPU and 172,828 K memory in task manager and thats not good.

So, When using XMLSpawner to spawn mobs there is a setting to not spawn anything till players come within range. Thus reducing overhead of the server.exe

What prop is that? I have looked and there is nothing that seems obvious to me.

Thanks
 

ArteGordon

Wanderer
sounds like you have PlayerRangeSensitive set to false. This allows mob AI to run all of the time, regardless of whether players are around. Check in basecreature.cs. It is around line 3760 in a clean distro version.
What I would recommend to reduce cpu load in that case instead of having the spawner do player-sensitive spawning, is to get the PlayerRangeSensitiveMod in submissions. This will allow you to run with PlayerRangeSensitive set to true, which will inactivate the mob AI when players are not around and is a lot less cpu intensive, but still allows them to continue to run their AI for a time after encountering players, so it largely behaves like having PlayerRangeSensitive set to false.

If you still want to do player-triggered spawning, then you just have to set the ProximityRange property to something zero or greater. The spawner will then wait until a player comes within the tile range specified in the property before triggering a spawn.
Note, that once triggered, the spawn will occur after the min/maxdelay period specified for the spawner has expired.
 

nix4

Wanderer
hrmm..well I went ahead and downloaded it and placed the 2 scripts over the old ones as instructed and rebooted and let the server run for 5 - 10 min and I don't see any difference what so ever...perhaps I need to edit the spawns that are already in game?
 

ArteGordon

Wanderer
With the PlayerRangeSensitiveMod, new spawns will run their AI for the default 2 mins, or whatever you set as the DeactivationDelay in BaseAI.cs
If there is still respawning going on, then let it run until things settle down to see the effect.
If you just added a lot of fresh spawns then there may still be a lot of spawning going on as mobs are gradually added until they they fill up their spawner.

You dont need to modify mobs for it to work.
 

Bane

Wanderer
Great work,

For whatever reason when I use duration, and sometimes proximity props it crashes shard, as in hard crashes, kills server.exe, of course no log here,

Any ideas?
 

nix4

Wanderer
Question: Whats the best method for setting up a xmlspawner for something like reagents? I have a spawner with a spawnrange of 200 or 500 and about 1900 spawns for various reagents. I check the spawner later on and notice there are only 128 out of 1900 spawns still active..how can I set this so it keeps it at 1900 as much as possible?

Thanks.
 

ArteGordon

Wanderer
Bane said:
Great work,

For whatever reason when I use duration, and sometimes proximity props it crashes shard, as in hard crashes, kills server.exe, of course no log here,

Any ideas?
never seen it but describe exactly what you do to produce it. What are you spawning and how are you setting things up, other props you are changing, max values, etc.
 

ArteGordon

Wanderer
nix4 said:
Question: Whats the best method for setting up a xmlspawner for something like reagents? I have a spawner with a spawnrange of 200 or 500 and about 1900 spawns for various reagents. I check the spawner later on and notice there are only 128 out of 1900 spawns still active..how can I set this so it keeps it at 1900 as much as possible?

Thanks.
how are you setting up the 1900 spawns?
The fraction of spawns that will be active at any time will depend on the rate of spawning (min/maxdelay) and the rate of item decay.
So, to keep the spawns as close to max as possible most of the time, reduce the min/maxdelay.
Now, normally the item decay rate would be much longer than the spawn rate so you would be near max most of the time. Unless you have a really short item decay rate, or a really long min/maxdelay setting, it is probably something else.
The maximum number of spawns that will be available at any time will be determined by the maxvalue of the spawners.
 

ArteGordon

Wanderer
ArteGordon said:
never seen it but describe exactly what you do to produce it. What are you spawning and how are you setting things up, other props you are changing, max values, etc.
One thing you could do is to give the spawner a name like "myspawn", then do an "[xmlsave myspawn.xml myspawn" and it will save the spawner spec to the file myspawn.xml in the runuo install directory. Then just post the xml file here and I can test it out.
 

Bane

Wanderer
ArteGordon said:
never seen it but describe exactly what you do to produce it. What are you spawning and how are you setting things up, other props you are changing, max values, etc.

simple stuff, nothing complex, problem is can't reproduce on staging server, only on live server., lol
 

Bane

Wanderer
Bit of Syntax Troubles, more what a few abbriviations mean.

MX=5, max spawns I take it,
SB??
RT= reset timer I take it, what does this do
T0=??
KL=1 take it kills = 1 then

I would like to spawn 5 orcs, when players have killed 5 I would like to spawn 5 ratman, when that is done I would like the spawn to spawn a level1 treasure chest.

I am unsure how to sequence these things. I just clipped and pasted the piece from the xml spawner.


Colors on the spawner,

Looking at your meph champ xml script I noticed that meph is yellow, then 2 dark blues, a couple of purples, then at bottom note is green.

I realize that the groupings are things that spawn together till kill count is reached, but do not understand how to go from grouping to grouping,

Any help would be great, this spawner is awesome, just having a bit of trouble figuring out some of the syntax.

Thanks for posting this.
 

Bane

Wanderer
ArteGordon said:
when you use duration, at what point do you get a crash? When it spawns, or when the spawn is deleted.

i believe it is when the spawn is deleted one of my gm's was spawning dates with the version before this one under date trees, he had m in like 3 places, they would drop to ground, stay there a while then dissapear, but the shard was constantly crashing, we took that out and it stopped.
 
Top