A better way to do this token property code?

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
Oryan77
Dragon
Posts: 452
Joined: Sun Feb 20, 2011 3:14 pm

A better way to do this token property code?

Post by Oryan77 »

I am trying to display a token property that appears on the statsheet, but I want the text to be broken into two lines so that the statsheet window does not appear too wide when adding descriptive text to it.

I have done the following below, but that is actually two properties being displayed for the same descriptive text. I can't seem to figure out how to write the code so that it breaks to a new line within the same line of code. Is this possible with the statsheet properties?

Or is there a better way I should be doing this all together?

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" ; ""]


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

Re: A better way to do this token property code?

Post by aliasmask »

This is the way I do it:

Code: Select all

*@sheet.specialA (Attacks):[r, if(SpecialATK == "NA" || SpecialATK == ""): ""; substring(SpecialATK,0,min(length(SpecialATK),50))]
*@sheet.specialA2 (A -):[r, if(SpecialATK == "NA" || SpecialATK == "" || length(SpecialATK) <= 50): ""; substring(SpecialATK,50,min(length(SpecialATK),100))]
*@sheet.specialA3 (A --):[r, if(SpecialATK == "NA" || SpecialATK == "" || length(SpecialATK) <= 100): ""; substring(SpecialATK,100,min(length(SpecialATK),150))]
I would do yours this way:

Code: Select all

*sheet.blinded1 (Blinded):[R, if(state.Blinded): "1/2 Speed, -2 AC, No Dex AC, -4 Search";""]
*sheet.blinded2 (- Blinded):[R, if(state.Blinded): "-4 STR/DEX skills, 50% miss on attacks";""]

Post Reply

Return to “Macros”