Embed Campaign Properties into token

Show off your RPG maps, campaigns, and tokens. Share your gaming experiences and stories under General Discussion and save this forum for things you've created that may help others run their own games. Use the subforums when appropriate.

Moderators: dorpond, trevor, Azhrei, Gamerdude

Post Reply
ntzrmtthihu777
Cave Troll
Posts: 31
Joined: Sun Sep 23, 2012 4:34 am

Embed Campaign Properties into token

Post by ntzrmtthihu777 »

Is it possible? Because I have a very nice Barbarian token in the works, but to use it the GM will have to import the .mptprops file. The idea is to have a token fully portable from campaign to campaign, as far as possible.

I see that the .mtprops file just contains 2 xml files, one merely a version holder, the other containing the real data. Would it be possible to some way append the content.xml data from the mtprop file to the content.xml file in the rptok file? I don't see why it wouldn't be, in theory, possible, but the current MT may or may not support this.
Dropbox Referral Link - Join with this, and both you and I get an extra .5 gigabytes of storage, 2.5 total for you.

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Embed Campaign Properties into token

Post by wolph42 »

i can tell you that currently it can't be done, im wondering ever, im also wondering how you would see these properties merged in existing property set (which is also currently not possible).

Dorn
Cave Troll
Posts: 55
Joined: Sat Mar 30, 2013 8:59 am

Re: Embed Campaign Properties into token

Post by Dorn »

I have to say, I'm not entirely sure what you're looking to do. If you want to save a token with any properties you've set included on it, that can absolutely be done. Just right click the token and save. That token can then be imported (dragged in from the resource library) into any campaign. But if you need that campaign to support custom properties that were set up in another campaign, that won't work. The campaign would have to already be set up to work with the properties the token has on it. Otherwise they would just be ignored. They would still be on the token, but any macros or anything in that campaign wouldn't be looking at those properties that it wasn't set up to use. Make sense?

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Embed Campaign Properties into token

Post by wolph42 »

Dorn wrote:I have to say, I'm not entirely sure what you're looking to do. If you want to save a token with any properties you've set included on it, that can absolutely be done. Just right click the token and save. That token can then be imported (dragged in from the resource library) into any campaign. But if you need that campaign to support custom properties that were set up in another campaign, that won't work. The campaign would have to already be set up to work with the properties the token has on it. Otherwise they would just be ignored. They would still be on the token, but any macros or anything in that campaign wouldn't be looking at those properties that it wasn't set up to use. Make sense?
well... thats not entirely true. If you're talking about e.g. states, then yes they're ignored or even removed (?) But if you're talking about properties like 'HP, Str, Con, etc' and you add a couple then you can ALWAYS access them no matter the campaign. The difference is is that these properties when not placed in the campaign properties, is that they're 'hidden' (e.g. they won't show up on the stat sheet).
To access them simply use: Wiki: getProperty()

User avatar
jfrazierjr
Deity
Posts: 5176
Joined: Tue Sep 11, 2007 7:31 pm

Re: Embed Campaign Properties into token

Post by jfrazierjr »

wolph42 wrote: you add a couple then you can ALWAYS access them no matter the campaign. The difference is is that these properties when not placed in the campaign properties, is that they're 'hidden' (e.g. they won't show up on the stat sheet).
To access them simply use: Wiki: getProperty()
While this is true, it's something you really should not do in isolation from the GM. What happens if you have "HP" for example, and the GM also has a property named "HP". If you use yours for "HitPoints" and the GM uses his for "HeroPoints", the token owner is going to be a world of hurt and confusion. This is one reason why I STRONGLY advocate for everyone building tokens(GM or player) to us custom properties named in such a way as to minimize the possibility of interference. For example, instead of "HP", I would use "props.jfj.HitPoints". Now, even if Wolph42 also has a property he calls "HitPoints"(for short), the actual property might be "w42.HitPoints" and there is no collision. One problem with this scheme does exist though and that is what is show on the popup stat sheet. Personally, I am not too concerned about stat sheet stuff myself since I can create a form for it fairly quickly to do the same thing(and more.), but others might not feel the same way.

The "right" way to accurately "merge" campaign properties is to get the text format strings copied/pasted from within MapTool and use a good text editor to "sort" the strings. It would help immensely if your copy had a postfix so that after your sort, you can easily tell which were from the GM and which are yours(this assumes NEITHER of you use some type of name spacing type scheme as I mentioned in my first paragraph.) Of course, your other option would be to build a program in java, C#, VB, Perl, Ruby, Python, etc to parse the content.xml and slice/dice the properties to make sure there are no duplicates, report any that it finds, and once those are taken care of, rewrite the content.xml back and convince your GM to re-import the properties. Of course, this approach does not automatically solve my first issue above.

Bottom line, work with your GM(s) if you want to build tokens outside of the properties they are using.
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..

ntzrmtthihu777
Cave Troll
Posts: 31
Joined: Sun Sep 23, 2012 4:34 am

Re: Embed Campaign Properties into token

Post by ntzrmtthihu777 »

What I'm looking to do: Make the attatched token "standalone", eg able to be transferred into campaigns without neccessitating modification to an existing campaign, so it could be dropped into a brand-new campaign with no custom properties and still be able to function.

Reason I'm asking is the current GM I'm playing with is not using any particular framework (just a handful of 1d20+{0..9}, standard dice 1d{3..12} and a secret roller, and does not seem too tech savvy.

So, if I can access my properties with getProperty(), how do I write to them? For example I have a property Raging, and it is either TRUE or FALSE depending on whether or not I've used the enter rage macro or not. now I know I can check if I'm raging with getProperty(Raging), but how do I toggle that state?

Ah, I seem to have answered my own question here, setProperty(), right?
Attachments
Yersun Rockbreaker.zip
(95.41 KiB) Downloaded 73 times
Dropbox Referral Link - Join with this, and both you and I get an extra .5 gigabytes of storage, 2.5 total for you.

User avatar
jfrazierjr
Deity
Posts: 5176
Joined: Tue Sep 11, 2007 7:31 pm

Re: Embed Campaign Properties into token

Post by jfrazierjr »

ntzrmtthihu777 wrote:What I'm looking to do: Make the attatched token "standalone", eg able to be transferred into campaigns without neccessitating modification to an existing campaign, so it could be dropped into a brand-new campaign with no custom properties and still be able to function.

Reason I'm asking is the current GM I'm playing with is not using any particular framework (just a handful of 1d20+{0..9}, standard dice 1d{3..12} and a secret roller, and does not seem too tech savvy.

So, if I can access my properties with getProperty(), how do I write to them? For example I have a property Raging, and it is either TRUE or FALSE depending on whether or not I've used the enter rage macro or not. now I know I can check if I'm raging with getProperty(Raging), but how do I toggle that state?

Ah, I seem to have answered my own question here, setProperty(), right?
Yes. However, my first paragraph still applies. Even if THIS GM is using few to no properties/macros, you should not assume any other GM you play will with will not. Creating slightly longer property names using some naming format will seem like extra work in the short run, but you will be very thankful(if you do and cursing if you don't!) when you play with a GM who uses the same property names as you do but in a different way. Likewise, while your current GM may be ok with this approach, other GM's might have a high tech level and want things done a certain way and all your work may not carry over... it really just depends on what your long term expectations are in the other possible GM areas. Personally, I would far rather work work with the GM to ensure things don't break by having the same states/properties vs trying to handle it all yourself. This ALSO has the added benefit that if any other players for that same GM have the inclination to take that next step, you both have a common frame of reference(ie, you can handle healing(or any other concept) the same way for example...) This also gives the GM a chance to expand without forcing him to while maintaining future compatibility if he does so choose to.
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..

ntzrmtthihu777
Cave Troll
Posts: 31
Joined: Sun Sep 23, 2012 4:34 am

Re: Embed Campaign Properties into token

Post by ntzrmtthihu777 »

Understood, I shall be speaking to said GM at next skyping. I can still export the mtprops and have him import it, and if some other players do the same I can easily merge the two mtprops files (just a matter of copy-pasting in the content.xml file). Either way I'm gonna code for portability, setProperty and getProperty everywhere :P

With the information you have provided I've been able to use my token in a virgin campaign with full functionality as far as macros; I don't suppose there is a way to do the on-mouseover popup in the token if the campaign properties do not exist? or will I have to code a character sheet of my own?
Dropbox Referral Link - Join with this, and both you and I get an extra .5 gigabytes of storage, 2.5 total for you.

User avatar
jfrazierjr
Deity
Posts: 5176
Joined: Tue Sep 11, 2007 7:31 pm

Re: Embed Campaign Properties into token

Post by jfrazierjr »

ntzrmtthihu777 wrote:Understood, I shall be speaking to said GM at next skyping. I can still export the mtprops and have him import it, and if some other players do the same I can easily merge the two mtprops files (just a matter of copy-pasting in the content.xml file). Either way I'm gonna code for portability, setProperty and getProperty everywhere :P
Well.. you still have to be careful though. Importing will blow away his, so unless he currently uses NO custom properties, you just need to be careful and keep in sync with what the GM is doing.

ntzrmtthihu777 wrote: With the information you have provided I've been able to use my token in a virgin campaign with full functionality as far as macros; I don't suppose there is a way to do the on-mouseover popup in the token if the campaign properties do not exist? or will I have to code a character sheet of my own?
You would have to code your own sheet to be 100% sure of supportability.
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..

ntzrmtthihu777
Cave Troll
Posts: 31
Joined: Sun Sep 23, 2012 4:34 am

Re: Embed Campaign Properties into token

Post by ntzrmtthihu777 »

jfrazierjr wrote: Well.. you still have to be careful though. Importing will blow away his, so unless he currently uses NO custom properties, you just need to be careful and keep in sync with what the GM is doing.
As of this moment the GM has none, but by exporting the properties from his campaign and the test bed for tokens I have you can easily merge the traits without overwriting, just a matter of merging the contents of contents.xml in the .mtprops zip file.
Dropbox Referral Link - Join with this, and both you and I get an extra .5 gigabytes of storage, 2.5 total for you.

Post Reply

Return to “User Creations”