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!

"accessor" command to access sub-properties

Ingvarr

Wanderer
"accessor" command to access sub-properties

For example I dont know a way currently to set/get attribute (AoSAttributes) subproperties or use them in [condition operators.

For example you cant [global xxx where item attributes.fastcast = 0, you must write a script for that. Some way to access sub-properties will be nice.
 

krrios

Administrator
Yes, this would be a very powerful feature. So, I've implemented it. It's not limited to aos attributes though; it can branch into any object (such as Mobile and Item). To quote the changelog for b37:

[code:1] - Command properties:
- Classes or structs marked with the 'PropertyObject' attribute can be branched into by [props. There are four types currently marked with this attribute:
- Rectangle2D
- Rectangle3D
- VirtueInfo
- BaseAttributes
- Editing these PropertyObjects will remember which object referenced them. Editing is made easier by returning to the property page for the origin object after editing a sub object is completed
- Mobile and Item properties now have a custom interface in the [props gump. This allows them to be nullified, targeted, set by serial, or view properties of the current value
- Properties that do not implement IComparable may still be used in 'where' conditionals when using only equality or inequality operators:
- ... where item map == felucca
- ... where mobile map != malas map != ilshenar
- Commands which reference a property name (such as [get, [set, [add, and 'where' conditionals) can reference more than one property level:
- The first property level is the direct object: [get hue would return the targeted objects hue
- Multiple property levels can be used for properties of type Mobile, Item, or PropertyObjects. Example syntax:
- [get Beard.Hue : returns the hue of the targeted persons beard
- [get ControlMaster.Name : returns the name of a targeted pets master
- [get Weapon.Attributes.CastSpeed : returns the AOS attribute for faster casting of a targeted players weapon
- [set ControlMaster.Weapon.Attributes.CastSpeed 1 : changes the faster casting AOS attribute to 1 for the weapon of a targeted pets master[/code:1]
 
Top