Resetting token properties to default?

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
User avatar
Shadowfireomega
Giant
Posts: 218
Joined: Thu Dec 23, 2010 12:12 am
Location: San Antonio, Texas

Resetting token properties to default?

Post by Shadowfireomega »

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

User avatar
aliasmask
RPTools Team
Posts: 9029
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Resetting token properties to default?

Post by aliasmask »

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.

User avatar
Tanthos
Giant
Posts: 176
Joined: Thu Mar 28, 2013 6:55 pm
Location: United States

Re: Resetting token properties to default?

Post by Tanthos »

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?
I believe you are looking for getPropertyDefault.

Set one:

Code: Select all

[h:setProperty(cProperty, getPropertyDefault(cPropertyName), currentToken())]
Set all:

Code: Select all

[h:cPropertyList = getAllPropertyNames("Basic")]
[h,FOREACH(cProperty, cPropertyList), CODE:
{
[h:setProperty(cProperty, getPropertyDefault(cPropertyName), currentToken())]
}]

User avatar
Shadowfireomega
Giant
Posts: 218
Joined: Thu Dec 23, 2010 12:12 am
Location: San Antonio, Texas

Re: Resetting token properties to default?

Post by Shadowfireomega »

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!
"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

User avatar
aliasmask
RPTools Team
Posts: 9029
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Resetting token properties to default?

Post by aliasmask »

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())]
}]

User avatar
Tanthos
Giant
Posts: 176
Joined: Thu Mar 28, 2013 6:55 pm
Location: United States

Re: Resetting token properties to default?

Post by Tanthos »

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())]
}]
I totally never knew about resetProperty. How did I miss that? :shock:

Good to know. :D

Post Reply

Return to “Macros”