Resetting token properties to default?
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
- Shadowfireomega
- Giant
- Posts: 218
- Joined: Thu Dec 23, 2010 12:12 am
- Location: San Antonio, Texas
Resetting token properties to default?
I have some tokens I made before I made a few changes to my properties, is there a way to 'reset' them to the defaults?
"I love being wrong, for if I was always right, there would be nothing left to learn, and that would be a world I would not want to live in."
-Benjamin Fisher
"Knowledge is knowing a tomato is a fruit; wisdom is not putting it in a fruit salad."
-Miles Kington
"Space is his favorite thing in the world!"
-Kayla Kros
"Anything times 1 is 1"
-Kayla Kros
-Benjamin Fisher
"Knowledge is knowing a tomato is a fruit; wisdom is not putting it in a fruit salad."
-Miles Kington
"Space is his favorite thing in the world!"
-Kayla Kros
"Anything times 1 is 1"
-Kayla Kros
Re: Resetting token properties to default?
I'm not completely sure what you're asking for. Token properties have values and if you never change the value and leave the token property default there then that is what the value will be. You can also change the token property default and all the token defaults will change if a value hasn't been input. But if you did change the value then you can use Wiki: resetProperty() for each property on a token, but that would be a pain without writing a macro.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Resetting token properties to default?
I believe you are looking for getPropertyDefault.Shadowfireomega wrote:I have some tokens I made before I made a few changes to my properties, is there a way to 'reset' them to the defaults?
Set one:
Code: Select all
[h:setProperty(cProperty, getPropertyDefault(cPropertyName), currentToken())]
Code: Select all
[h:cPropertyList = getAllPropertyNames("Basic")]
[h,FOREACH(cProperty, cPropertyList), CODE:
{
[h:setProperty(cProperty, getPropertyDefault(cPropertyName), currentToken())]
}]
- Shadowfireomega
- Giant
- Posts: 218
- Joined: Thu Dec 23, 2010 12:12 am
- Location: San Antonio, Texas
Re: Resetting token properties to default?
I was afraid of that, but yes, I had properties change from basic Str:0 to Str:{BaseStr+TempStr-StrDmg-StrDrain+ItemStr} or something like that, the token was before this update, and the Str is stuck at the old value instead of the new equation. I'm just gonna totally redo the entire token, much easier than writing a macro for this xD
EDIT: I had forgotten to hit submit, came back and did so, just saw the newer post, will give this a try with another token, thanks!
EDIT: I had forgotten to hit submit, came back and did so, just saw the newer post, will give this a try with another token, thanks!
"I love being wrong, for if I was always right, there would be nothing left to learn, and that would be a world I would not want to live in."
-Benjamin Fisher
"Knowledge is knowing a tomato is a fruit; wisdom is not putting it in a fruit salad."
-Miles Kington
"Space is his favorite thing in the world!"
-Kayla Kros
"Anything times 1 is 1"
-Kayla Kros
-Benjamin Fisher
"Knowledge is knowing a tomato is a fruit; wisdom is not putting it in a fruit salad."
-Miles Kington
"Space is his favorite thing in the world!"
-Kayla Kros
"Anything times 1 is 1"
-Kayla Kros
Re: Resetting token properties to default?
You can use resetProperty as well in the loop, in fact that may be preferable since the example is writing a string rather than just resetting to display the default. Meaning, if you change it again in the future, it'll need to be updated again, while using resetProperty you won't.
Also, if there are only certain properties you want to reset, you can make the list manually instead of getting all the properties and resetting them, which would essentially just be a new token.
Also, if there are only certain properties you want to reset, you can make the list manually instead of getting all the properties and resetting them, which would essentially just be a new token.
Code: Select all
[h:cPropertyList = "propName1,propName2,..."]
[h,FOREACH(cProperty, cPropertyList), CODE:
{
[h:resetProperty(cProperty,currentToken())]
}]
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Resetting token properties to default?
I totally never knew about resetProperty. How did I miss that?aliasmask wrote:You can use resetProperty as well in the loop, in fact that may be preferable since the example is writing a string rather than just resetting to display the default. Meaning, if you change it again in the future, it'll need to be updated again, while using resetProperty you won't.
Also, if there are only certain properties you want to reset, you can make the list manually instead of getting all the properties and resetting them, which would essentially just be a new token.
Code: Select all
[h:cPropertyList = "propName1,propName2,..."] [h,FOREACH(cProperty, cPropertyList), CODE: { [h:resetProperty(cProperty,currentToken())] }]
Good to know.