
Is there a way to do a line break writing a macro... is very confusing to code anything without a linebreak. i.e. ";"
Is there a way to do a line break writing a macro... is very confusing to code anything without a linebreak. i.e. ";"
If you use a roll template, you should be able to use line breaks. Everyone has access to the default template, but what other templates you may have access to will be determined by what character sheet you are using.
Here's what I've got so far:
&{template:2Edefault} {{name=@{selected|token_name} uses Contact}} {{subtitle=Telepathic Science *CompPsi p80*}} {{Power Score=Wisdom}} {{PSP Cost:=?{Target level or hit dice|1-5,3/2|6-10,8/4|11-15,13/7|16+,18/9}}} {{Maintain=1/round}} {{Range=special}} {{Preparation Time=0}} {{Area of Effect=Individual}} {{Prerequisite=None}} {{Check:PS=All established contacts are free for 4 rounds}} {{Check:20=Cannot use Contact on this mind until next level}} {{desc=Life Order:|PS Mod ||Mammal|-1||Marsupial|-2}}
I need to either add line breaks so I can include a couple of tables, or modify the Power Score twice (possibly three times) the same way I'm modifying the cost. The table I'm trying to include looks like this:
Life Order | Power Score Mod | Range | Power Score Mod |
Mammal | -1 | Line of Sight | 0 |
Marsupial | -2 | 1 mile | -1 |
Bird | -3 | 10 miles | -2 |
Reptile/Amphibian | -4 | 100 miles | -3 |
You get the idea. Both tables modify the Power Score. I thought the pipes might function as line breaks or table separations, but they obviously don't.
Edit. Just realized there are two modifier boxes for the die roll on the character sheet.
If I put
?{Life Order|Mammal,-1|Marsupial,-2|Bird,-3|Reptile,-4|Fish,-5|Arachnid/Bug,-6|Monster,-7|Plant-8}
into the first box, and
?{Range|Line of Sight,0|1 mile,-1|10 miles,-3|100 miles,-4|1000 miles,-7|10000 miles,-9}
in the second, it will take care of it for me, I think!
keithcurtis said:
If you could post the macro you have so far, we might be able to offer specific advice.
I think I am being misunderstood. I don't want to do a linebreack on the result I want to be able to do a linebreak in the code itself without affecting the result. For example, I am using the DnD5e spell template here:
&{template:spell} {{level=@{selected|repeating_spell-2_$0_spellschool} @{selected|repeating_spell-2_$0_spelllevel}}} {{name=@{selected|repeating_spell-2_$0_spellname}}} {{castingtime=@{selected|repeating_spell-2_$0_spellcastingtime}}} {{range=@{selected|repeating_spell-2_$0_spellrange}}} {{target=@{selected|repeating_spell-2_$0_spelltarget}}} @{selected|repeating_spell-2_$0_spellcomp_v} @{selected|repeating_spell-2_$0_spellcomp_s} {@{selected|repeating_spell-2_$0_spellcomp_m}} {{material=@{selected|repeating_spell-2_$0_spellcomp_materials}}} {{duration=@{selected|repeating_spell-2_$0_spellduration}}} {{description=@{selected|repeating_spell-2_$0_spelldescription}}} {{athigherlevels=@{selected|repeating_spell-2_$0_spellathigherlevels}}} @{selected|repeating_spell-2_$0_spellritual} @{selected|repeating_spell-2_$0_spellconcentration} {{charname=charname}}
Unfortunately no, you cant. The above code is a rolltemplate, and an entire rolltemplate code must be on a single line. If you put a line break, everything after the linebreak will be treated as not part of the template, breaking the output.
You can put linebreaks in while you're putting the macro together, but you'll need to remove them before you run it. I usually break them apart to edit the bit I need (especially with complex rolls) then stitch them back up.
Just checking - you're not trying to edit these in Roll20, are you? Copy and paste the content to Notepad or something, and stretch the window nice and wide. For macros with lots of long Attribute calls, you can usually get a window width where word wrap will group the lines pretty neatly.
You could also use something like VS Code to edit the macro. That will remove all linebreaks from your selection with a single command.
I am actually using VS Code though I did not know of such command! thanks for the idea!
Oosh said:
You can put linebreaks in while you're putting the macro together, but you'll need to remove them before you run it. I usually break them apart to edit the bit I need (especially with complex rolls) then stitch them back up.
Just checking - you're not trying to edit these in Roll20, are you? Copy and paste the content to Notepad or something, and stretch the window nice and wide. For macros with lots of long Attribute calls, you can usually get a window width where word wrap will group the lines pretty neatly.
You could also use something like VS Code to edit the macro. That will remove all linebreaks from your selection with a single command.