I've been digging though hundreds of posts and tutorials all day trying to get the proper syntax for this to work. If it's wrong, the spawner will give you error, but I've had multiple variations check out without errors and I still can't get it to attach to a player. So, I'm testing this with a player character and have tried:

SETONTRIGMOB/ATTACHMENT,XmlValue,X,1/ ATTACH/<XmlValue/X,1/> SETONTRIGMOB/<ATTACH, XmlValue, X, 1/> SETONTRIGMOB/<ATTACHEMENT, XmlValue, X, 1>
etc...
I've also set up a Proximity Message so that I know when the spawner is being triggerd properly, so the property settings are correct.
It's been a while, but I seem to remember this is possible. What is the syntax to add and XmlValue to a player via an XmlSpawner?
 
That sadly didn't work either. I also found:

SETONTRIGMOB/ATTACHMENT,xmlvalue,XS,value/34

in another tutorial, but that didn't work either. Does the value have to exist on the player before a spawner can change it? Is that the issue?

I keep seeing "see attachtest1.xml for an example" in many tutorials too, but I don't seem to have that file. Where can I find that?
 
The work of the XMLspawner system has been cut down in the SerVUO and this functionality no longer works. You need to reinstall this system to get all the functions working again.
 
Interestingly enough though:

SETONTRIGMOB/ATTACHMENT,xmlvalue,XS,value/34

Does work if the property already exists on a mobile. It just wont add a new one. So, I guess that if I can predefine how to get these set to a player on character creation, I can manipulate the values via the xmlspawner.

So, that's progress. Oh! I should mention I'm using an older RunUO (2.0?) server. I'm not sure which version or update of xmlspawner 2 I'm using.

Oh! And thank you for your reply!

*EDIT*
So, I've got the following working to set XmlValue and XmlData in charactercreation.cs
(XmlValue is for integers, XmlData is for strings from what I can tell.)

XmlAttach.AttachTo(newChar, new XmlData("mydatastring")); XmlAttach.AttachTo(newChar, new XmlValue("con",10));

To explain, the first string added "mydatastring" to the player.
The second added "con" at a value of 10 to the player.

These can be used in a ton of ways, but for example... here's how I pull the "con" data for a Gump:

XmlValue con = (XmlValue)(XmlAttach.FindAttachment(from, typeof(XmlValue), "con"));

Also, instead of the above SETONTRIGMOB/ATTACHMENT,xmlvalue,XS,value/34

/34 at the end can also be /INC,1

This would increase the value of XS by 1 (INC = Increment) This will be good for setting data during sequential spawning, etc...
 
Last edited:
Well, you were right if the value already exists, lol. Initially I wanted the spawner to add a new value. But now I'm just hard coding the values during character creation, and using the spawner to update the values.

I'm not sure if it's possible to add new xmlvalues from the spawner directly. Id love it if it was possible, not I'm not sure if it is.
 
Yes it is possible:

C#:
SETONTRIGMOB/ATTACH/XmlValue,XS,0
Will attach to the player the Xmlvalue called ''XS'', value 0
Go to the spawner props and set the NonTriggerOnCarried option:
C#:
ATTACHMENT,XS,xmlvalue
So the spawner wont trigger again if the player has the attach already
Im very rusty when it comes to xmlspawner, it used to play with spawners all day, its a great tool for beginners

The next thing is the condition syntax
C#:
#CONDITION,GETONTRIGMOB,[ATTACHMENT,XmlValue,XS,value]>19 ; GIVE/VikingSword/name/CaCa
C#:
SETONTRIGMOB/ATTACH/XmlValue,NoMoreVikings,0
Add both lines to Group 1


If the triggering mob has the Xmlvalue called ''XS'' value more than 19 it will give him a VikingSword named ''CaCa''
To avoid infinite VikingSwords and infinite items whenever you give items, keep in mind the NonTriggerOnCarried option


Go to the spawner props and set the NonTriggerOnCarried option:

C#:
ATTACHMENT,NoMoreVikings,xmlvalue

Always add Refractory Min Max of few seconds if possible.

The name is case sensitive, hope it helps
 
Last edited:
I am absolutely going to try to get this working. I've added a ton of xmlvalues to charactercreation.cs and most of them make sense to have available when a new character is created.

But I'd like to use xmlvalues to track if a player has reached certain locations for the quest system I'm building, and adding them live is much easier.

Thank you for explaining! I'll let you know if I run into any other issues with this. I'm excited to get this working this way!

I'm trying this:
ATTACHMENT,XS,xmlvalue with proximity triggering and it's not attaching a new value. It works for changing existing values though. Is the syntax somehow different? Or do I just have a different version where this wasn't implemented yet?

EDIT:

I'm not sure what I did, but something made it work. I'm going to start a fresh spawner and figure out what happened. I tried a ton of things, but I'm not sure which one was correct. The errors on the spawner don't clear unless you reset the spawner, so I'm going to do some trial and error to figure out the exact settings I used.
 
Last edited:
I'm not sure if these are any help to you, but I found them in an old folder I had on XML spawners.
 

Attachments

  • How to Attachments.rar
    208.1 KB · Views: 10
Back