RPTools.net

Discussion and Support

Skip to content

It is currently Thu May 23, 2013 2:13 pm 






Reply to topic  [ 6 posts ] 

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Deity
 
Joined: Tue Jul 01, 2008 6:48 pm
Posts: 6235
 Post subject: [1.3.b49,1.3.b48] getPropertyNames() gets deleted properties
PostPosted: Tue Jan 06, 2009 8:58 am 
In versions 1.3.b48 and 1.3.b49, if you use getPropertyNames(), you will get back not only the properties of the current token, but properties that no longer exist for that property set.

For example, in one campaign I had a separate property to handle vulnerability and resistance to certain damage types. I removed those properties and used a property string instead - however, when I used getPropertyNames(), those deleted properties show up again.

Code:
[h: PropList = getPropertyNames()]

[h,foreach(prop, PropList),CODE:
{
  [IF(substring(prop, 0,1)=="-"): PropList = listDelete(PropList, listFind(PropList,prop))]
}]

[PropList]


Will assign the following to PropList (the following is an excerpt; it seems to get every property that ever existed in that set):

"Weapon2Damage, DefaultStats, ResistFire, Thievery, VulnCold, Wisdom,
ResistPsychic, LastCustomAttack, VulnPoison, IntBonus, Dexterity, GenSaveMod, MiscDamBonus, TempHP, MiscACBonus, VulnRadiant, VulnForce, Endurance, VulnNecrotic, Implement2Crit, Power20, ActionPoints, Religion, Implement2DamBonus..."

The only properties that still exist in that token's property type setting are: LastCustomAttack, Power20, and ActionPoints. Some of those, like Implement2Crit, were deleted from the property set back in...jeez, somewhere around version 1.3.b38.

getAllPropertyNames() does not display this behavior.

_________________

What I'm Working On

MapTool Tutorials:
Introduction to Tokens
Introduction to Properties
Introduction to Macro Writing
Introduction to Light and Sight


Top
 Profile  
 
 Offline
Great Wyrm
 
Joined: Sun Jun 22, 2008 6:53 pm
Posts: 1961
Location: Melbourne, Australia
 Post subject: Re: [1.3.b49,1.3.b48] getPropertyNames() gets deleted properties
PostPosted: Tue Jan 06, 2009 9:37 am 
The reason that this happens is because deleting a property from the campaigns does not delete it from the tokens. Infact there is really no way to delete a property from a token.
If you want only the properties that are defined in the campaign then use getAllTokenProperties() with the type of the token. I know its a pain, but until there is a way to delete token properties getPropertyNames() is going to return them no matter what you do in the campaign properties :\. Campaign properties just determines what the user can edit with the token edit dialog (as well as what is displayed on mouse over etc). It in no way limits what properties can be set on the token (and I think many people are already taking advantage of this).

Edit: So this isn't a bug in getPropertyNames(), not even sure it if is a bug anywhere...


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Jul 01, 2008 6:48 pm
Posts: 6235
 Post subject: Re: [1.3.b49,1.3.b48] getPropertyNames() gets deleted properties
PostPosted: Tue Jan 06, 2009 11:12 am 
Craig wrote:
Edit: So this isn't a bug in getPropertyNames(), not even sure it if is a bug anywhere...


It depends on how you define a bug, I suppose. It's behavior is nonintuitive, at the very least. :)

I made a note in the Documentation Wiki about the persistence of properties vis a vis getPropertyNames().

_________________

What I'm Working On

MapTool Tutorials:
Introduction to Tokens
Introduction to Properties
Introduction to Macro Writing
Introduction to Light and Sight


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri May 12, 2006 7:56 pm
Posts: 6300
Location: Las Cruces, NM
 Post subject: Re: [1.3.b49,1.3.b48] getPropertyNames() gets deleted properties
PostPosted: Tue Jan 06, 2009 9:07 pm 
Craig wrote:
The reason that this happens is because deleting a property from the campaigns does not delete it from the tokens. Infact there is really no way to delete a property from a token.


While I agree that it isn't a bug there probably should be a way to purge properties from a token in the Edit Token dialog. A button for Clear All that clears the visible and (perhaps optionally) removes any properties that aren't in the current Campaign settings.

_________________
Call me, Hex Boy.

Visit http://www.darkisle.com for photos of castles, cairns, standing stones, and other ancient sites in the British Isles.


Top
 Profile  
 
User avatar  Offline
Site Admin
 
Joined: Mon Jun 12, 2006 12:20 pm
Posts: 11622
Location: Tampa, FL
 Post subject: Re: [1.3.b49,1.3.b48] getPropertyNames() gets deleted properties
PostPosted: Wed Jan 07, 2009 12:49 am 
Yes, but you'd have to be careful as loading and using the token in a campaign that doesn't have the right properties shouldn't cause permanent data loss. :( I agree it'd be nice, though.

_________________
Interested in Time Magazine's Best Invention of 2008 Unix-powered laptop? No crashes or lockups. In fact, that series of articles has two such machines. The other is a Dell netbook. :)


Top
 Profile  
 
User avatar  Offline
Codeum Arcanum (RPTools Founder)
 
Joined: Mon Jan 09, 2006 4:16 pm
Posts: 11386
Location: Austin, Tx
 Post subject: Re: [1.3.b49,1.3.b48] getPropertyNames() gets deleted properties
PostPosted: Thu Mar 19, 2009 10:53 pm 
This has been fixed by Craig W

_________________
Dreaming of a 1.3 release


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 6 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 1 guest





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman