"SetSate()" not working

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
BluePhoenix175
Kobold
Posts: 2
Joined: Thu Sep 22, 2022 12:03 am

"SetSate()" not working

Post by BluePhoenix175 »

I have tried several variations of a state toggle macro, and none of them seem to work. i can turn it on, the state img shows on the token, and the right click token menu shows the check mark(that i can use to turn it off). but turning it off via macro does not work.

Code: Select all

[h, if(GetState("Blinded") == 1): SetState("Blinded", 0), SetState("Blinded", 1))]

Code: Select all

[h: setState("Blinded", getState("Blinded")-1)]
when i add

Code: Select all

{GetState("Blinded")}

it returns 0 even if clicking the macro added the img to the token.

the framework(?) is failing in the same manner which is what prompted me making my own.

Code: Select all

[if(state.Blinded == 1), CODE:
{
     [h:state.Blinded=0]
};
{
     [h:state.Blinded=1]
     <b>[r:token.name] is <u>blinded</u>!<br></b>
*A blinded creature can&#39;t see and automatically fails
any ability check that requires sight.<br>
*Attack rolls against the creature have advantage, and
the creature&#39;s attack rolls have disadvantage.
}]
im not going crazy right? all of the above code should work?

User avatar
wolph42
Deity
Posts: 9973
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: "SetSate()" not working

Post by wolph42 »

it won't work in the latest beta version, cause that was reported as a bug.

In other words: which version are you using?

BluePhoenix175
Kobold
Posts: 2
Joined: Thu Sep 22, 2022 12:03 am

Re: "SetSate()" not working

Post by BluePhoenix175 »

im using v1.12.0

User avatar
aliasmask
Deity
Posts: 8810
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: "SetSate()" not working

Post by aliasmask »

Known bug. It's been fixed in 1.12.1

Post Reply

Return to “Macros”