RPTools.net

Discussion and Support

Skip to content

It is currently Thu Nov 23, 2017 4:01 am 






Reply to topic  [ 77 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Dragon
 
Joined: Fri Dec 18, 2009 2:33 am
Posts: 382
Location: San Diego
 Post subject: Raoden's Quick'n'Dirty Token Manager
PostPosted: Sat May 15, 2010 6:34 am 
07/06/10: v2.0 uploaded
New features:
  • New user interface, utilizing a frame instead of a dialog. Separate "tabs" in the frame for managing Properties and Macros. Frame is compatible with the new version of my Mood Manager that I'll be releasing soon.
  • JSON Editor hopefully works flexibly, finally.
  • JSON Editor can now edit the order of JSON Arrays, using little "up arrow" and "down arrow" links.
  • Like v1.4, should automatically adapt to your MapTool build when deleting unwanted properties or displaying capitalization of Property names.

07/02/10: v1.4 uploaded
New features: Should detect MapTool build automatically and adapt to new macros available subsequent to 1.3.b63.
In b64 and later builds, this means capitalization of token properties should now be preserved.
In b68 and later builds, this means erasing unwanted properties from the token no longer involves using a "Clone Token."

05/28/10: v1.3 uploaded.
New features: Rumble's Macro Deletion utility; Macro Import/Export functions by CoveredInFish and aliasmask. Links to all these new functions are available in the Property Editor frame.

05/28/10: v1.2 uploaded.
New feature: "delete" unwanted properties (including "hidden" properties) by copying most of a token's information over to a new token, but leaving out unwanted properties. Thank you for getting this started, CoveredInFish.

------------

OK, I wasn't planning to post this as an independent User Creation, as I know there are already some similar things floating around. But there's been some interest expressed in this tool, and as far as I know there isn't currently any other tool on this Forum that has all of this utility.

Instructions
  1. Download the attached token
  2. Place it in your campaign
  3. Copy the main macro -- the red one -- to Campaign Macros
  4. Select or impersonate on the token whose properties you want to edit
  5. Click on the new Edit Token Properties Campaign Macro

Features
  • Interface should be pretty self-explanatory
  • Accesses all of a token's properties, whether defined in Campaign Settings or "hidden"
  • Can work with token properties that use JSON structures (of any reasonable depth). To make a token property into a JSON, or to add a nested layer to an existing JSON, just enter {} or [] when prompted for a value of a property.

One thing I've noticed it can't do is change the order of elements in a JSON array. If such a feature would increase the utility significantly, let me know and I'll work on it.


Token Manager v2.0.rptok [56.75 KiB]
Downloaded 544 times

_________________
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed."
- G. K. Chesterton

Wonderful HTML/CSS reference * Color Manager * Token Manager 2.0


Last edited by Raoden on Tue Jul 06, 2010 3:41 am, edited 8 times in total.
Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Mon Jun 29, 2009 9:37 am
Posts: 3108
Location: Germany
 Post subject: Re: Quick'n'Dirty Token Property Editing Dialog
PostPosted: Sat May 15, 2010 6:43 am 
Pretty handy tool. Nicely done!

_________________
HELP: GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC.

most complete list of my maptool stuff


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Fri Dec 18, 2009 2:33 am
Posts: 382
Location: San Diego
 Post subject: Re: Quick'n'Dirty Token Property Editing Dialog
PostPosted: Sat May 15, 2010 6:44 am 
Thanks, CIF.

And, a screenshot.


PropEditorDemo.PNG
PropEditorDemo.PNG [ 194.1 KiB | Viewed 6042 times ]

_________________
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed."
- G. K. Chesterton

Wonderful HTML/CSS reference * Color Manager * Token Manager 2.0
Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Sun Feb 25, 2007 11:53 am
Posts: 3775
Location: MD
 Post subject: Re: Quick'n'Dirty Token Property Editing Dialog
PostPosted: Sun May 16, 2010 1:48 pm 
Nice tool, thanks.

Could you distinguish between which properties are "Hidden"? Maybe make them display in italics if they are?


And since you put this tool together, I figure you might know the answer to this question... I understand that it's impossible to truly "delete" a hidden property (or any property) within MT. Has anyone made something that makes it easier to do that outside MT either directly with an RPTOK file or by selectively reading the right info from the xml file inside the RPTOK file?

_________________
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Fri Dec 18, 2009 2:33 am
Posts: 382
Location: San Diego
 Post subject: Re: Quick'n'Dirty Token Property Editing Dialog
PostPosted: Sun May 16, 2010 2:12 pm 
Full Bleed wrote:
Nice tool, thanks.

Could you distinguish between which properties are "Hidden"? Maybe make them display in italics if they are?

That's a good idea. I'll work on it.

Quote:
And since you put this tool together, I figure you might know the answer to this question... I understand that it's impossible to truly "delete" a hidden property (or any property) within MT. Has anyone made something that makes it easier to do that outside MT either directly with an RPTOK file or by selectively reading the right info from the xml file inside the RPTOK file?

Nope, can't help you myself. I know nothing about XML (yet).

_________________
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed."
- G. K. Chesterton

Wonderful HTML/CSS reference * Color Manager * Token Manager 2.0


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Mon Jun 29, 2009 9:37 am
Posts: 3108
Location: Germany
 Post subject: Re: Quick'n'Dirty Token Property Editing Dialog
PostPosted: Sun May 16, 2010 4:55 pm 
Full Bleed wrote:
I understand that it's impossible to truly "delete" a hidden property (or any property) within MT.

You could create a new token, copy and set all except the stuff you'd like to delete.

_________________
HELP: GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC.

most complete list of my maptool stuff


Top
 Profile  
 
User avatar  Offline
Site Admin
 
Joined: Mon Jun 12, 2006 12:20 pm
Posts: 12103
Location: Tampa, FL
 Post subject: Re: Quick'n'Dirty Token Property Editing Dialog
PostPosted: Sun May 16, 2010 6:45 pm 
AFAIK this is the only way to do it within MT.

I'm not inclined to work on fixing this myself, but if someone else wanted to create a patch I'd look at it.

I expect that 1.4 will use a completely different approach to properties (in terms of how they're managed internally) so to me there's not a compelling enough case.


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Sun Feb 25, 2007 11:53 am
Posts: 3775
Location: MD
 Post subject: Re: Quick'n'Dirty Token Property Editing Dialog
PostPosted: Mon May 17, 2010 4:59 am 
CoveredInFish wrote:
You could create a new token, copy and set all except the stuff you'd like to delete.


Is there a way to do this with a macro?

The I/O Macro you and Alias made helps with getting all the macros onto a new token, but moving over the other properties can be time consuming.

_________________
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Mon Jun 29, 2009 9:37 am
Posts: 3108
Location: Germany
 Post subject: Re: Quick'n'Dirty Token Property Editing Dialog
PostPosted: Mon May 17, 2010 6:12 am 
I have a macro that makes a complete copy. You'd have to create the UI to select properties to exclude.

Code:
[h'<!-- get source and destination via user input -->']
[
htokens getTokens()]
[
hnames ""]
[
h, foreach( idtokens ): names listAppend(namesgetName(id))]

[
hstatus input(
    
strformat("srcIdx|%s|Select source|LIST"names), 
    
strformat("destIdx|%s|Select destination|LIST"names)
)]
[
habort(status)]
[
hassertsrcIdx != destIdx "You must select different tokens.")]

[
hsrc listGet(tokenssrcIdx)]
[
hdest listGet(tokensdestIdx)]

[
h'<!-- set states -->']
[
hallStates getTokenStates()]
[
h, foreach(stateallStates): setState(stategetState(statesrc), dest)]

[
h'<!-- set image -->']
[
htoken(src): image getTokenImage()] 
[
htoken(dest): setTokenImageimage )]

[
h'<!-- copy properties -->']
[
hallProps getPropertyNames(","src)]
[
hexcludeList ""]
[
h, foreach(propallProps), code: {
    [
h, if(listFind(excludeListprop)!=-1), code: {
       [
hsetProperty(propgetProperty(propsrc), dst)]
    };{}]
}]

[
h'<!-- misc  -->']
[
hsetName(getName(src)+" copy"dest)]
[
hsetGMName(getGMName(src), dest)]
[
hsetLabel(getLabel(src), dest)]
[
htoken(src): notes getNotes()]
[
htoken(dest): setNotes(notes)]
[
htoken(src): notes getGMNotes()]
[
htoken(dest): setGMNotes(notes)]
[
h, if( isPC(src)): setPC(dest); setNPC(dest)]
[
hsetSize(getSize(src), dest)]
[
hsetVisible(getVisible(src), dest)]
[
hsetPropertyType(getPropertyType(src), dest)]

[
h'<!-- macros -->']
[
hallMacros getMacros(","src)]
[
h, foreach( macroallMacros ), code: {
    [
hindexes getMacroIndexes(macro","src)]
    [
h, foreach( indexindexes ), code: {
        [
hprops getMacroProps(index"json"src)]
        [
hcreateMacro(propsdest)]
    }]
}]
Token [r:getName(src)] copied

_________________
HELP: GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC.

most complete list of my maptool stuff


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Sun Feb 25, 2007 11:53 am
Posts: 3775
Location: MD
 Post subject: Re: Quick'n'Dirty Token Property Editing Dialog
PostPosted: Mon May 17, 2010 8:06 am 
CoveredInFish wrote:
I have a macro that makes a complete copy. You'd have to create the UI to select properties to exclude.


I tried, but ran into problems with properties that had pipes in them and my UI failed. Too much trouble to figure it out.

How do I use the excludeList? I put some property names inside the quotes, separated with commas, and they still copied over. And, strangely, some other properties that I wanted to copy over didn't.

_________________
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Mon Jun 29, 2009 9:37 am
Posts: 3108
Location: Germany
 Post subject: Re: Quick'n'Dirty Token Property Editing Dialog
PostPosted: Mon May 17, 2010 8:21 am 
Hmm .. pipes in property names will be always a problem when you use input(). You could replace them with something and replace them back after the dialog.

The excludeList should be a string list of property names.

All properties retrieved by Wiki: getPropertyNames() should get copied. If Wiki: listFind() returns -1 for a prop vs the excludeList it skips setProperty.
I dont see where this would fail ...

If this topic keeps growing we should stop hijacking this thread :oops:

_________________
HELP: GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC.

most complete list of my maptool stuff


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Sun Feb 25, 2007 11:53 am
Posts: 3775
Location: MD
 Post subject: Re: Quick'n'Dirty Token Property Editing Dialog
PostPosted: Mon May 17, 2010 3:41 pm 
CoveredInFish wrote:
The excludeList should be a string list of property names.

Can't get it to work. Can you show me an example of what it should look like?


Quote:
All properties retrieved by Wiki: getPropertyNames() should get copied. If Wiki: listFind() returns -1 for a prop vs the excludeList it skips setProperty.
I dont see where this would fail ...

It most definitely is not copying over *any* properties for me. The only properties showing on the new token are the defaults. Maybe I'm using it wrong. All I did was put the code into a macro in the Campaign Window. Run it. Selected the token I wantd to copy and the "blank." It says it copied... changed the name of the new token it in the popup. Selected a "blank" for the copy. It seemed to copy everything over by the properties and the vision type.


Quote:
If this topic keeps growing we should stop hijacking this thread :oops:

Well, I figure if I keep bumping the topic enough, maybe Raoden will think it's a cool idea to turn his "Edit Token Properties" macro into an "Copy/Edit Token Properties" macro by incorporating your code. ;)

But you can go ahead and start a thread with your duplicateToken as a drop-in if you'd like. We can move our discussion there.

_________________
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Mon Jun 29, 2009 9:37 am
Posts: 3108
Location: Germany
 Post subject: Re: Quick'n'Dirty Token Property Editing Dialog
PostPosted: Tue May 18, 2010 7:18 am 
You used it right but i wrote it wrong.

Fixed (it would have copied only props in the excludeList) and added dialog for selecting properties to skip/exclude.

Code:
[h'<!-- get source and destination via user input -->']
[
htokens getTokens()]
[
hnames ""]
[
h, foreach( idtokens ): names listAppend(namesgetName(id))]

[
hstatus input(
    
strformat("srcIdx|%s|Select source|LIST"names), 
    
strformat("destIdx|%s|Select destination|LIST"names)
)]
[
habort(status)]
[
hassertsrcIdx != destIdx ,"You must select different tokens.")]

[
hsrc listGet(tokenssrcIdx)]
[
hdest listGet(tokensdestIdx)]

[
h'<!-- set states -->']
[
hallStates getTokenStates()]
[
h, foreach(stateallStates): setState(stategetState(statesrc), dest)]

[
h'<!-- set image -->']
[
htoken(src): image getTokenImage()] 
[
htoken(dest): setTokenImageimage )]

[
h'<!-- copy properties -->']
[
hallProps getPropertyNames(","src)]

[
h'<!-- build dialog -->']
[
hfields ""]
[
h, foreach(propallProps): fields json.append(fieldsstrformat("exclude%s|0|%s|CHECK"propprop))]
[
hstatus input(json.toList(fields"##"))]
[
habort(status)]
[
hexcludeList ""]
[
h, foreach(propallProps), code: {
    [
h, if(eval("exclude"+prop)==1): excludeList listAppend(excludeListprop)]
}]

[
h, foreach(propallProps), code: {
    [
h, if(listFind(excludeListprop)==-1), code: {
       [
hsetProperty(propgetProperty(propsrc), dest)]
    };{}]
}]

[
h'<!-- misc  -->']
[
hsetName(getName(src)+" copy"dest)]
[
hsetGMName(getGMName(src), dest)]
[
hsetLabel(getLabel(src), dest)]
[
htoken(src): notes getNotes()]
[
htoken(dest): setNotes(notes)]
[
htoken(src): notes getGMNotes()]
[
htoken(dest): setGMNotes(notes)]
[
h, if( isPC(src)): setPC(dest); setNPC(dest)]
[
hsetSize(getSize(src), dest)]
[
hsetVisible(getVisible(src), dest)]
[
hsetPropertyType(getPropertyType(src), dest)]

[
h'<!-- macros -->']
[
hallMacros getMacros(","src)]
[
h, foreach( macroallMacros ), code: {
    [
hindexes getMacroIndexes(macro","src)]
    [
h, foreach( indexindexes ), code: {
        [
hprops getMacroProps(index"json"src)]
        [
hcreateMacro(propsdest)]
    }]
}]
 

_________________
HELP: GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC.

most complete list of my maptool stuff


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Fri Dec 18, 2009 2:33 am
Posts: 382
Location: San Diego
 Post subject: Re: Quick'n'Dirty Token Property Editing Dialog
PostPosted: Tue May 18, 2010 1:16 pm 
Full Bleed wrote:
Well, I figure if I keep bumping the topic enough, maybe Raoden will think it's a cool idea to turn his "Edit Token Properties" macro into an "Copy/Edit Token Properties" macro by incorporating your code. ;)

Sure, I'm fine doing that, as long as CIF does all the hard work. :wink:

_________________
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed."
- G. K. Chesterton

Wonderful HTML/CSS reference * Color Manager * Token Manager 2.0


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Sun Feb 25, 2007 11:53 am
Posts: 3775
Location: MD
 Post subject: Re: Quick'n'Dirty Token Property Editing Dialog
PostPosted: Tue May 18, 2010 2:18 pm 
CoveredInFish wrote:
You used it right but i wrote it wrong.

Fixed (it would have copied only props in the excludeList) and added dialog for selecting properties to skip/exclude.


Dangit. Still can't get this to work. I got a prompt for a property value:

Code:
value for excludedamage


I think the problem is that I had a white space in a property called "Damage Reduction." I changed the name in Campaign properties but, of course, it is already on the token incorrectly.

Any way to deal with that? Or am I going to have to go into xml?

Oh yeah, and thanks for the check boxes! :)


Raoden wrote:
Sure, I'm fine doing that, as long as CIF does all the hard work. :wink:


Looks like the hard work at this point would be setting up the UI.

_________________
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 77 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next

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 are 0 users online :: 0 registered, 0 hidden and 0 guests (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 0 guests





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

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman