Reset Tokens / Strip Tokens of Properties

Thoughts, Help, Feature Requests

Moderators: dorpond, trevor, Azhrei

Post Reply
User avatar
Doc_Waldo
Giant
Posts: 108
Joined: Wed Sep 08, 2010 11:41 pm
Location: Boise, ID

Reset Tokens / Strip Tokens of Properties

Post by Doc_Waldo »

Is there a way to take a token I have created say for Rumbles framework and strip it back to "generic" so I can then use in another framework? I know I can go through and open up the token file and get into the asset to get the image, but I am hoping not to do this. I have a huge number of tokens for Rumbles framework and would like to use them for other frameworks and can't see to figure out how to "reset" a token.
--DOC

neofax
Great Wyrm
Posts: 1694
Joined: Tue May 26, 2009 8:51 pm
Location: Philadelphia, PA
Contact:

Re: Reset Tokens / Strip Tokens of Properties

Post by neofax »

I am pretty positive there is a macro wrote by CoveredInFish/Aliasmask or Rumble that does exactly this. However, could you just change the property switch to Basic and then drop the token to say DeviantNulls FW and change the property to DeviantNull? Never tried it and probably will not work.

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Reset Tokens / Strip Tokens of Properties

Post by Azhrei »

Yes, that would work. But if there were overlapping property names the old values would appear on the token. And if the framework used setProperty to create "hidden" properties, ie. those not listed in the campaign properties, those names could already be in use.

However, it just occurred to me... The Map > Import... function for importing a map automatically strips all properties and macros from a token on an imported map. This was done because there's no way to know if the map uses any particular framework so the only safe thing to do was strip all existing data. He could drop the tokens he wants "stripped" onto a map, export it, then import it back in. :)

(I noticed when I did that recently that the imported map came back in with the same name as an existing map and that's not supposed to happen. Another bug to fix for b76. :))

User avatar
aliasmask
RPTools Team
Posts: 9031
Joined: Tue Nov 10, 2009 6:11 pm
Location: California

Re: Reset Tokens / Strip Tokens of Properties

Post by aliasmask »

I was experimenting with token cloning and clearing token macros and properties. The code is easy enough, but it is time consuming (runtime). If that doesn't matter then I'll post some code for you. How stripped down do you want it? Just keep the image information and token name?

Code: Select all

<!-- get and delete all macros -->
[H: allMacros = getMacros("json")]
[H, foreach(macro,allMacros), code: {
   [H: macroList = getMacroIndexes(macro)]
   [H, foreach(index,macroList): removeMacro(index)]
}]
<!-- get and delete all properties -->
[H: allProperties = getMatchingProperties(".*","json")]
[H, foreach(prop,allProperties): resetProperty(prop)]
<!-- after this you can customize your token -->
[H: setPropertyType("basic")]
[H: setAllStates(0)]
<!-- but there other things you cant do like setting "portrait" image or some token permissions --> 

User avatar
mfrizzell
Dragon
Posts: 762
Joined: Sat Feb 13, 2010 2:35 am
Location: California

Re: Reset Tokens / Strip Tokens of Properties

Post by mfrizzell »

I've dropped veggie tokens on DevNulls framework and caused a raft of problems with error messages.

I've used this simple macro to strip properties from tokens of one framework to be used in another framework.

Code: Select all

[h: names= getPropertyNames()]
[foreach(name,names,"<br>"), code:{
[r: name]
[resetProperty(name)]}]
DCI/RPGA# 7208328396 Skype ID mfrizzell77
Characters:
Strabor - Dwarf Avenger 5th Level
Tikkanan - Human Warlock 2nd Level
----------------------------------------------------
"People are more violently opposed to fur than leather because it's safer to harass rich women than motorcycle gangs."

User avatar
Doc_Waldo
Giant
Posts: 108
Joined: Wed Sep 08, 2010 11:41 pm
Location: Boise, ID

Re: Reset Tokens / Strip Tokens of Properties

Post by Doc_Waldo »

Thanks. I am going to look into several of the solutions and also Rumble did put together a macro stripper for tokens. His original macro was set to make it so you could select each macro, but he then showed me how to put reverse the code so that it was default to strip out all of the macros.

Although stripping the macro's out is one of the solutions, it would be great if there was a way to convert a token from one framework to anther. Example, I have almost all of the dnd 4e monster for Rumbles frameworks, and with this project will start to strip and put together another set to work with DN's framework.

Is it even possible to create a conversation macro?

Link to Rumbles Macro Stripper: http://forums.rptools.net/viewtopic.php?f=8&t=10135
--DOC

User avatar
Doc_Waldo
Giant
Posts: 108
Joined: Wed Sep 08, 2010 11:41 pm
Location: Boise, ID

Re: Reset Tokens / Strip Tokens of Properties

Post by Doc_Waldo »

Yes. Just tried the export and import, no luck, all properties came back with the import.
--DOC

User avatar
Doc_Waldo
Giant
Posts: 108
Joined: Wed Sep 08, 2010 11:41 pm
Location: Boise, ID

Re: Reset Tokens / Strip Tokens of Properties

Post by Doc_Waldo »

Thanks Allasmaks, that worked great. Saved as a global and made sure that run on selected token was selected and it worked great. Don't want to run on 50 tokens at once, but for what I want right now it works great. Thanks.
--DOC

User avatar
CoveredInFish
Demigod
Posts: 3104
Joined: Mon Jun 29, 2009 10:37 am
Location: Germany
Contact:

Re: Reset Tokens / Strip Tokens of Properties

Post by CoveredInFish »

It should be possible to create a conversation macro, it should be simple for properties - might be difficult for macros. But then I dont know the frameworks in question well enough to rate the difficulties.

User avatar
Doc_Waldo
Giant
Posts: 108
Joined: Wed Sep 08, 2010 11:41 pm
Location: Boise, ID

Re: Reset Tokens / Strip Tokens of Properties

Post by Doc_Waldo »

Rumbles to DN's.
--DOC

User avatar
Doc_Waldo
Giant
Posts: 108
Joined: Wed Sep 08, 2010 11:41 pm
Location: Boise, ID

Re: Reset Tokens / Strip Tokens of Properties

Post by Doc_Waldo »

Probably not the right topic, but, what would the macro look like to "reset" or basically remove all conditions and give full hit points back to a token. I am thinking after the players kill off my monsters, to set them back for later. Thanks.
--DOC

User avatar
JonathanTheBlack
Dragon
Posts: 544
Joined: Mon Jun 28, 2010 12:12 pm
Location: I'm the worm...

Re: Reset Tokens / Strip Tokens of Properties

Post by JonathanTheBlack »

Replace: CurrentHP, MaxHP, CurrentSurges, MaxSurges, and Health with the variables you use in your game.

Also, make sure that Apply to Selected Tokens is checked in the macro.

Code: Select all

<!-- Remove all states, heal the token to full health, restore all healing surges to PC's, and reset the health bar to 100% -->
  [h: setAllStates(0)]
  [h: CurrentHP = MaxHP]
  [h, if(isPC() == 1): CurrentSurges = MaxSurges]
  [h: setBar("Health", 100)]

<!-- Suppress text output to chat -->
  [h: abort(0)]

User avatar
Doc_Waldo
Giant
Posts: 108
Joined: Wed Sep 08, 2010 11:41 pm
Location: Boise, ID

Re: Reset Tokens / Strip Tokens of Properties

Post by Doc_Waldo »

Thank you very much. That worked perfect.
--DOC

Post Reply

Return to “TokenTool”