Difference between XObjProperty() and .XProp()

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
User avatar
ncrsn
Grandmaster Poster
Posts: 255
Joined: Fri Feb 10, 2006 12:15 am

Difference between XObjProperty() and .XProp()

Post by ncrsn »

X in subject is Set/Get/Erase.

Some time ago we found that custom properties can be accessed using mentioned object.XProp(CPROPNAME) method. Is there some difference between that and the good old XObjProperty(object, CPROPNAME) from UO module?

I'm asking because I haven't been able to spot one. Yet as far as I can tell this is not documented, so question is, should it be?

If so happens that both ways do the same, is there any reason to keep both or should one be removed from the future cores?
mr bubbles
Grandmaster Poster
Posts: 120
Joined: Thu Jan 18, 2007 2:34 am

Post by mr bubbles »

haha, i can imagine my script changes is getobjproperty is removed :P I think it should be left as is, or get rid of the .xprop method. Who uses this anywhere apart from like data files (guilds/accs) anyway?
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Post by Yukiko »

I don't think you can use the function Get/Set/EraseObjProperty on accounts. As I recall you must use the methods. I could be wrong however. Lord knows I have been mistaken before.

As for removing anything I would rather nothing be removed but I'd vote for methods being removed before the UO.em functions being taken away.
User avatar
itec
Novice Poster
Posts: 42
Joined: Thu Feb 09, 2006 11:48 pm

Post by itec »

mr bubbles wrote:Who uses this anywhere apart from like data files (guilds/accs) anyway?
Me for once, it's faster to write obj.GetProp("Prop"), then GetObjProperty(obj, "Prop"), and the method way feels more like the cprop is part of the object.

If I had to guess, I'd say it's another one of those forgotten features that never made in core-changes. And yeah, this should be added to pol docs under the UObject class. It's working fine and looks much better what the functions do. Just my opinion.
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Post by CWO »

I thought it was GetObjProperty that replaced UObject.GetProp....
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Post by Yukiko »

I think you are right CWO. I assume that the methods were left in place for compatibility reasons. I have never tested GetObjProperty on accounts. I have never seen it used on account references even. Most always the method is used in those cases.
Post Reply