I am far from being programming savvy and I'm sure the way that I am doing this is extremely clunky. Here is the code that I am using in the campaign properties:
Code: Select all
*Blinded:[R, IF(getState("Blinded") == 1): "1/2 speed, -2 AC, no Dex AC, -4 Search," ; ""]
* :[R, IF(getState("Blinded") == 1): "-4 Str/Dex skills, 50% miss on attacks" ; ""]
Code: Select all
[h: SelectedTokens=getSelected()]
[FOREACH(TokenID, SelectedTokens, " "), CODE:
{[h: NewState=if(getState("Blinded",TokenID)==1,0,1)]
[h: setState("Blinded",NewState,TokenID)]
}]
[H: abort(0)]
Code: Select all
*Slowed:[R, IF(getState("Slowed") == 1): "Take only 1 standard or move action," ; ""]
* :[R, IF(getState("Slowed") == 1): "1/2 speed, -1 attacks, -1 AC, -1 Ref" ; ""]
I no longer want a macro for each state. Instead, a single macro that will popup a list of all my states with the ability to turn a state on or off (ability to turn multiple states on/off) would be better I believe. Also, an easier way to get the state descriptive text to appear on the token portrait mouseover would be great. Now that I know more about what MT can do, I'm wondering if this type of thing is better accomplished using the Tables or something? Would I type in all of my conditional text in a table and have the macro reference that table in order to display the text in the portrait window area?
It would be great if someone could help me get this set up. I am really not good at coding and pointing me to the wiki pages as if I can do this on my own has never worked for me. Could anyone help me out here?