Full Version : How Do I - Set properties on spawns
xmlspawner >>XMLSpawner - How do I? >>How Do I - Set properties on spawns


<< Prev | Next >>

ArteGordon- 12-27-2005
The ability of xmlspawner to assign or change the properties of spawned objects at the time of spawning is one of the most basic and powerful features of the system

The general syntax for any spawn entry (the string that you enter into the spawner gump) is like this

objecttype/propertyname/value...

where objecttype is the type of the item or mob that you wish to spawn, like 'rat' or 'ginseng'

the propertyname, is the name of any public property on the object. Typically these will be the properties that you see when you use the [props command on the object, but XmlSpawner actually has access to all public properties, whether or not they appear in the [props gump.

An example of some common properties that you might want to set would be
Name or Hue. To set those you would use a spawn entry like

rat/name/Tooth Gnasher/hue/500

that will change the name of the rat to "Tooth Gnasher", and set the hue to 500.

Notice that you can set more than one property on a single line by just separating them with '/'.

The slash '/' is the general separator used by xmlspawner and is a special reserved character (dont use it in names or other strings etc.)

Jack Frost- 01-25-2006
I am trying to set a spawner with

factionberserker/faction/minax

hoping that this will create a faction berserker of the Minax faction, but alas this did not work. I am relativly new to this and would like a nudge in the right direction.

godfood- 01-25-2006
I Haven't played with the faction stuff yet, but I'll take a look right now.

(EDIT) I thought you were refering to Arte's MobFaction's System. What faction system are you using?

(EDIT) Ok, I tried this out myself, and I was unable to get it to set the faction, I was also unable to [set faction minax.

It probably has something to with the basefactionguard. Not being able to write the faction prop to it.

ArteGordon- 01-26-2006
yes, it is because that property is a custom enum type. I will have to take a look at that.

(edit)

fixed for v3.07

Jack Frost- 01-26-2006
Cool Thanks for the lightning fast response. I'm also glad it wasn't just me. Hey since I have your attention, The guy who has the server, and runs our shard doesn't like to update the xmlspawner. He says it's really time consuming do to he can't just load the new one straight in he has to do bits and pieces because he doesn't want to mess up alot of his custom mods. So my question is, in the newer versions do they load in without changing everything that you built or changed? I think we are on V 2.63 or there abouts. I would like to upgrade, since I do most of the quest building at this point.

ArteGordon- 01-26-2006
you should just be able to replace the old xmlspawner installation with the latest one by dropping it in. Just copy the new scripts over the old ones. That's all that I do, just drag the new xmlspawner installation folder over, drop it on the old one, and let it 'replace all'

The only reason that you would have to make any additional changes was if you had made custom modifications to the xmlspawner scripts themselves.

Nothing that you have already made with the old versions will be changed by upgrading to new versions.

He may be thinking of some of the optional installation steps, which are the only things that involve changing any distro scripts. To fully access all of the xmlspawner and quest features, he would probably want to make those mods, but even if he doesnt, things will run just fine, there will just be some features that will not be available.

Note, those changes only have to be made once, not every time you upgrade to the latest version.

Jack Frost- 01-26-2006
Awesome thank you, I'll let him know.

Jack Frost- 01-26-2006
Ok I'm going to bug you one last time. I talked him into looking at it. I guess he had made some changes that make it not such a drag and drop operation.

"The reason I don’t just replace them is I’ve made other MOD’s to the files he updates that are not related to XML Spawner. There are actually a LOT of changes in the distro scripts I’ve made and since the updates involve replacing some of those to accommodate his updated scripts, I have to check the modify dates and scan them to make sure I haven’t made any additional changes.

Sockets are a good example- I’ve edited that in the scripts a lot. Skill cap, backpack size, mob drops. There are a lot of changes."

He did agree to look at the newest version though. I just wanted to know if the above update is added to the current 3.07 beta zip? If not I will have him wait until that is included. I might not get another update for awhile, so I have to get the most bang for the buck. Thanks again for making our UO lives alittle easier, and more entertaining.


ArteGordon- 01-26-2006
Any existing mods to non-xmlspawner scripts will not make any difference in upgrading. The suggested installation mods to non-xmlspawner scripts are optional.

You can still upgrade by just replacing the old xmlspawner scripts with the new ones. If you dont make the optional non-xmlspawner script mods, that just means that those features wont be available.

The current beta_307 attachment has the support for setting custom enums.

Zyle- 01-27-2006
Well I keep running into issues today... I'm having a bit of trouble adding armour attributes via the spawners now.

My string looks like this:

Platechest/name/Christian's Breastplate/hue/91/energybonus/5/firebonus/5/attributes.luck/100

I tried everything I can think of, including:
armorattributes.luck/100
AOSAttributes.luck/100
attributes.aosattributes.luck/100
luck/100
, instead of /

but nothing seems to work. (Only the luck doesn't attach, the rest works perfectly.) If I do [set attributes.luck 100 ingame that works fine but the same thing through the spawner it keeps telling me that it's not properly formatted. The equivalent method for weapons works fine so I can't understand what I'm messing up... blink.gif

ArteGordon- 01-27-2006
hmm. I just tried cutting and pasting that exact string and it worked fine.

Maybe there is some hidden character in there. I would just try entering it again.

Zyle- 01-27-2006
I'm such an idiot that it physically hurts. I had a > on the end... I don't know which is worse - the fact that I spent 45 minutes trying to figure it out and didn't realise it was there, or the fact that I bugged you about it. There really must be something wrong with me today - sorry!!

*goes and stands in the corner*

ArteGordon- 01-27-2006
aww, and I was just going to post a picture for you

user posted image

Zyle- 01-27-2006
hehe biggrin.gif

Well, at least I learned todays valuable lesson - if it doesn't work for some seemingly inexplicable reason, stop trying to edit it and start over wink.gif

Zigamus- 03-02-2006
I'm trying to make a spawner that creates a Marked Rune.

I have the Description working, & Marked True, and Targetmap set.

But I cannot get the PointDest variable to set to the destination I need.

It is probably because this variable is a multi part one (eg: 5200 1090 1)

Can you assist me on the sentax for this plz? I hope this will assist alot of folks that need to manage odd paramaters.

I have a Travel Center on my shard, with moongates to all towns, dungeons, and mines. I'm trying to setup an instantly respawning marked rune to this Center, that players can take one and put in their runebooks. Am I crazy?

If other folks like this idea I can also post a rather nice 'castle' that has seperate towers for Towns, Dungeons, Mines and Specials (locations) where you place moongates to the desired locations. I have recieved a few compliments on this, so if anyone wants a copy of it, let me know and I'll post it for ya