Reset Tokens / Strip Tokens of Properties
Moderators: dorpond, trevor, Azhrei
Reset Tokens / Strip Tokens of Properties
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
Re: Reset Tokens / Strip Tokens of Properties
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.
Re: Reset Tokens / Strip Tokens of Properties
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. )
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. )
Re: Reset Tokens / Strip Tokens of Properties
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 -->
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Reset Tokens / Strip Tokens of Properties
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.
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."
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."
Re: Reset Tokens / Strip Tokens of Properties
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
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
Re: Reset Tokens / Strip Tokens of Properties
Yes. Just tried the export and import, no luck, all properties came back with the import.
--DOC
Re: Reset Tokens / Strip Tokens of Properties
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
- CoveredInFish
- Demigod
- Posts: 3104
- Joined: Mon Jun 29, 2009 10:37 am
- Location: Germany
- Contact:
Re: Reset Tokens / Strip Tokens of Properties
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.
Re: Reset Tokens / Strip Tokens of Properties
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
- JonathanTheBlack
- Dragon
- Posts: 544
- Joined: Mon Jun 28, 2010 12:12 pm
- Location: I'm the worm...
Re: Reset Tokens / Strip Tokens of Properties
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.
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)]