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

Ingvarr

Wanderer
Well Ive been able to pinpoint the prob - it was due to sector enumeration not called when Ive entered spawn vicinity. ActiveSectorCount was zero even while I was standing right near the spawn. When Ive got HasActiveSectors (it causes sector enumeration), it returned true, ActiveSectorCount became one, and in short time spawn was re-spawned.

Dunno if above fixes will fix it, Ill try to install em now and will see if it will help
 

ArteGordon

Wanderer
Ingvarr said:
Well Ive been able to pinpoint the prob - it was due to sector enumeration not called when Ive entered spawn vicinity. ActiveSectorCount was zero even while I was standing right near the spawn. When Ive got HasActiveSectors (it causes sector enumeration), it returned true, ActiveSectorCount became one, and in short time spawn was re-spawned.

Dunno if above fixes will fix it, Ill try to install em now and will see if it will help

I think the fixes will handle that. Let me know how it goes. Just be sure to reset the smartspawning either by respawning them or by doing the "[global xmlset isinactivated false where xmlspawner" when you test it out.

(edit)

I added one more minor change the update. Try downloading it again and testing the current version.
 

paole

Wanderer
[xmlnewloadhere: height(z)-problem

hi again.

one thing i always notice is, that the spawner loads at the wrong height when i do a xmlnewloadhere. for example i got a 2-story-house and i'm staying in the 1st floor and do the load, the spawner is getting loaded on ground floor. staying on ground floor, the spawner gets loaded on 1st floor.

not really tedious, but sometimes bothering. :eek:
 

ArteGordon

Wanderer
Elementi said:
Ok Arte another question for you. I have read the previous threads in here, and read where you can add custom locks / traps to a chest. My question is using xml spawner would it be possible to create a door that can be destroyed (bashed), that can have multiple lock types and trap types set on it. I'm wanting to implement destroyable doors into the world im creating. Where if a fighter type player bashes a door until it has 0 hp left it vanishes and all traps go off at once on that player (or anyone around if it is set as an area effect spell). Im trying to implement multiple crafter occupations in my world. For example if a person has carpentry they can create the door, and if they also have tinkering they can create the locks / traps and set them to the door. Would it be possible to do this with the xml script so that they basically go through the steps of the script but the spawn controlling the stats of the door / locks / and traps are automatically set to the door upon completion of said steps. This way when they place the door in a door frame the door and the controlling spawner is all set into place.

*** edit ***

The reason I'm asking if this is possible (thought I better add this) is that with the npc army option we talked about a while back it would be nice to have this. Say army A is invading Town b, and beat them pretty good. The ruler of Town B can they issue an order to fall back to the castle / keep with in town b. Once inside the army of town b can then lock the gates to the castle / keep, can continue to fight from within. Now Army A has to bash down the gates of the castle / keep in order to conquere the town by using cannons , ballista's, etc. This would bring the wars a new factor and more life to the battles. Especially if the objective to end the war is to kill the king and control the keep for a certain amount of time. Upon which if successful then Town B is now under the control of Race B and its ruler.

Yes, it would be possible to script an item such as a bashable door that would do the things that you describe, and have it create a spawner to go along with it that would allow it to be reset, trapped, etc. and maybe even spawn guards or other mobs when it had taken enough damage. You could also just script the item to do all of these things without a spawner. I would say it would depend on just how flexible you wanted the thing to be.
 

ArteGordon

Wanderer
paole said:
hi again.

one thing i always notice is, that the spawner loads at the wrong height when i do a xmlnewloadhere. for example i got a 2-story-house and i'm staying in the 1st floor and do the load, the spawner is getting loaded on ground floor. staying on ground floor, the spawner gets loaded on 1st floor.

not really tedious, but sometimes bothering. :eek:

I'm going to have to think about this a bit more. The issue is that when you do a loadhere it causes the placement algorithm to autocalculate z (since it cant really just do a relative shift in z for all of the loaded spawners based on the placers location the way it can in x and y). In the example you gave, it makes sense to shift it up to the second floor, but in other cases it would not. It can be done but I'll have to do some testing.
 

Knightshade

Wanderer
one thing i always notice is, that the spawner loads at the wrong height when i do a xmlnewloadhere.

wouldn't placing an asterisk (*) before the spawn name fix this? I'm not familiar with the xmlnewloadhere command, so perhaps that isn't valid.

Anyways, on to my real topic.

Arte, I'm not sure if I missed something somewhere, or this is a bug, so I'm posting it just in case. I noticed that when I create spawns which point to waypoints, save those spawns to a file, and then wipe them ([xmlspawnerwipeall) and load the back up ([xmlspawnerload filename.xml)...they lose the waypoint information! :eek: Am I doing something wrong? Or is this a bug?
 

ArteGordon

Wanderer
no, the asterisk allows spawns to ignore the normal surface requirement for placement (allowing spawns in things like water). In this case the loadhere commands are intentionally placing spawners at ground level as their safest placement guess.

Waypoints dont get restored because they involve items that the spawner doesnt control (waypoints) and so on loading it would have to find those items again in order to restore them.
For those properties that do involve restoring references to other objects in the world, they look them up by name, which means it is portable as long as the target object with that name exists in that world.
Waypoints could be handled in a similar fashion, so that if you gave a waypoint a unique name, then it could be restored. It doesnt currently do that, but it is a good idea.
In principle it could save serial information on the waypoint object and try to look it up again, but serials are only really valid within an existing world context, so you couldnt load the .xml on another world for instance.
 

Ingvarr

Wanderer
Prob with smartspawning just happened again (with all of 2.56a fixes)

Example spawn that was inactive:
Code:
  <Points>
    <Name>#Cov1Harpy1</Name>
    <UniqueId>91964cbc-dd39-45c9-8cca-c4c92998e3a6</UniqueId>
    <Map>Felucca</Map>
    <X>5471</X>
    <Y>1876</Y>
    <Width>15</Width>
    <Height>15</Height>
    <CentreX>5471</CentreX>
    <CentreY>1876</CentreY>
    <CentreZ>0</CentreZ>
    <Range>25</Range>
    <MaxCount>6</MaxCount>
    <MinDelay>1</MinDelay>
    <MaxDelay>10</MaxDelay>
    <Team>0</Team>
    <IsGroup>False</IsGroup>
    <IsRunning>True</IsRunning>
    <IsHomeRangeRelative>True</IsHomeRangeRelative>
    <Objects>harpy=6</Objects>
  </Points>

[xmlget IsInactivated
true

[xmlget ActiveSectorCount
0

[xmlget HasActiveSectors
true

[xmlget ActiveSectorCount
1

[xmlget IsInActivated
true

<if i will leave and enter vicinity it will respawn now>

So the problem still same - sometimes sector check timer just seems to stop or something, so active sectors list is not refreshed when player enters the spawn vicinity.
 

Knightshade

Wanderer
no, the asterisk allows spawns to ignore the normal surface requirement for placement (allowing spawns in things like water).

Yes I realize that was the original intention, however, when placing spawns in multiple levels, often times, the spawns would spawn on the ground floor when I wanted them to spawn on the second floor (spawner located on the second floor but still placing them on the ground floor). I've found, that by placing an asterisk in front of the spawn name, it allows the spawn to be placed on the floor where the spawner is located.

In principle it could save serial information on the waypoint object and try to look it up again, but serials are only really valid within an existing world context, so you couldnt load the .xml on another world for instance.

Is it possible to do this? We make heavy use of waypoints on our shard, and the shard's spawn system is setup in a very modular way which involves frequent loading and unloading of the world spawns (for development - and when released, for quests and maintenance). A large reason for using your spawn system is this kind of flexibility, but not being able to save the initial waypoint in a spawner is a huge problem. It makes about 25-35% of our spawners invalid, as they depend on that initial waypoint to give the spawn direction.

We're not interested in saving all waypoint data, just the ability to tell the spawn that, upon spawning, it needs to go to "this waypoint." I assumed since it was in the properties it would save with the rest of them.

On that note, are there any other properties that don't save? We put hours of work into setting up our spawns, and finding that some properties aren't saving is a major blow to our development cycle. :(
 

ArteGordon

Wanderer
Knightshade said:
Yes I realize that was the original intention, however, when placing spawns in multiple levels, often times, the spawns would spawn on the ground floor when I wanted them to spawn on the second floor (spawner located on the second floor but still placing them on the ground floor). I've found, that by placing an asterisk in front of the spawn name, it allows the spawn to be placed on the floor where the spawner is located.
yes, it is a similar issue with automatic spawner placement. It just needs a sensible way to tell it when to override the default placement restrictions.


Knightshade said:
Is it possible to do this? We make heavy use of waypoints on our shard, and the shard's spawn system is setup in a very modular way which involves frequent loading and unloading of the world spawns (for development - and when released, for quests and maintenance). A large reason for using your spawn system is this kind of flexibility, but not being able to save the initial waypoint in a spawner is a huge problem. It makes about 25-35% of our spawners invalid, as they depend on that initial waypoint to give the spawn direction.

We're not interested in saving all waypoint data, just the ability to tell the spawn that, upon spawning, it needs to go to "this waypoint." I assumed since it was in the properties it would save with the rest of them.
There is no problem in doing it, and as I mentioned, other properties that refer to objects like SetItem or TriggerObject do restore the object references by looking them up again by name when the spawners are reloaded.
The best solution would be to assign unique names to the waypoints that you want to restore and then they could always be restored. Doing it with serials would work most of the time, but it would definitely be less flexible.
One possibility would be to have it try to restore them by name if the waypoints were named, but then do it by serial as a fallback.
I think this is how I'll do it.

Knightshade said:
On that note, are there any other properties that don't save? We put hours of work into setting up our spawns, and finding that some properties aren't saving is a major blow to our development cycle. :(

no, the object-referencing properties are special cases, and actually the waypoints were an oversight. They should have been handled the same way that the other object-referencing properties are handled. Sorry about that.

I'll have it in the next release.
 

ArteGordon

Wanderer
Ingvarr said:
Prob with smartspawning just happened again (with all of 2.56a fixes)

Example spawn that was inactive:
Code:
  <Points>
    <Name>#Cov1Harpy1</Name>
    <UniqueId>91964cbc-dd39-45c9-8cca-c4c92998e3a6</UniqueId>
    <Map>Felucca</Map>
    <X>5471</X>
    <Y>1876</Y>
    <Width>15</Width>
    <Height>15</Height>
    <CentreX>5471</CentreX>
    <CentreY>1876</CentreY>
    <CentreZ>0</CentreZ>
    <Range>25</Range>
    <MaxCount>6</MaxCount>
    <MinDelay>1</MinDelay>
    <MaxDelay>10</MaxDelay>
    <Team>0</Team>
    <IsGroup>False</IsGroup>
    <IsRunning>True</IsRunning>
    <IsHomeRangeRelative>True</IsHomeRangeRelative>
    <Objects>harpy=6</Objects>
  </Points>

[xmlget IsInactivated
true

[xmlget ActiveSectorCount
0

[xmlget HasActiveSectors
true

[xmlget ActiveSectorCount
1

[xmlget IsInActivated
true

<if i will leave and enter vicinity it will respawn now>

So the problem still same - sometimes sector check timer just seems to stop or something, so active sectors list is not refreshed when player enters the spawn vicinity.

hmm, I'll take another look at it. Do you know if this occurred after a server restart?

(edit)

try making this modification to the ResetSectorList method in xmlspawner.cs

Code:
private void ResetSectorList()
        {
            sectorList = null;
            UseSectorActivate = false;
            IsInactivated = false;
            // force an update of the sector list
            bool sectorrefresh = HasActiveSectors;
        }

BTW, thanks for helping with this Ingvarr, I really appreciate it.
 

Fluke

Wanderer
I had the same problem, after server restart some spawners did not spawn. But this do the trick for now :).
10x Arte, always intime.
 

Fluke

Wanderer
One more question, it is not for xmlspawner but I has a litle problem with seting some props with spawns. Can I use command "set" to set properties on some condition, for example:
[global set smartspawning true where xmlspawner
to be only for spawnrange=0.
10x.
 

ArteGordon

Wanderer
Fluke said:
One more question, it is not for xmlspawner but I has a litle problem with seting some props with spawns. Can I use command "set" to set properties on some condition, for example:
[global set smartspawning true where xmlspawner
to be only for spawnrange=0.
10x.

yes,

[global set smartspawning true where xmlspawner spawnrange == 0

make sure you have spaces between spawnrange, ==, and 0
 

Fluke

Wanderer
I notised now that this change:
Code:
private void ResetSectorList()
        {
            sectorList = null;
            UseSectorActivate = false;
            IsInactivated = false;
            // force an update of the sector list
            bool sectorrefresh = HasActiveSectors;
        }
now generates lag some times. Is it possible reason or it is something else?
 

Fluke

Wanderer
And another thing, some players sad that when they fight something and then left the monster for a while it then is gone. May be if there can be set timer when to remove spawns or something like 10-30 minutes.
My shard has litle players on a week server and many places are not visited often. Smartspawning is great idea but if you can tell me how to set this timeout (if there is something like that) will be great.
 

ArteGordon

Wanderer
What the above change will do is when a spawner is moved, or has anything that would affect its spawnrange changed, it recalculates its sector activation to reflect the new conditions (that's what the call to HasActiveSector does), and then allows the spawner to reset itself through the normal process of spawning back to full, and then inactivating (thats what setting IsInactivated=false does).
It is the respawning that you might be noticing as a transient lag.
Do you notice this after a server restart?
I'll look into some optimizations of the server restart behavior.
 

ArteGordon

Wanderer
Fluke said:
And another thing, some players sad that when they fight something and then left the monster for a while it then is gone. May be if there can be set timer when to remove spawns or something like 10-30 minutes.
My shard has litle players on a week server and many places are not visited often. Smartspawning is great idea but if you can tell me how to set this timeout (if there is something like that) will be great.

yes, you could get this behavior if the spawner was full, and someone started fighting a mob but didnt kill it (so the spawner was still full), on the next OnTick of the spawner, if no players were around, it would inactivate. I can see how players would notice this since a key assumption in smartspawning is that respawning a spawner that was full will be seen as the same as just having a spawner that was full. If there is a mob that was damaged, it would violate that condition and would be noticed as a difference.
Adding in a test for damaged mobs before smartspawning is a good idea. I'll test that out.

(edit)

tested it out and it looks good. I'll add it to the next release. Thanks!

One thing to note. If you are spawning things that get assigned random names, like orcs for example, when they smartspawn they will probably not have the same names as before, so if players are keeping track of mob names, they might notice when they leave and come back later that the names have changed.
 
Top