Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Old trick for getting line breaks inside textarea fields.

1659402590

Edited 1659402696
vÍnce
Pro
Sheet Author
Just thought I would share this. Button roll on the sheet includes two attributes in the roll. 1. a global attribute for whispers 2. macro-text from a textarea field  Typically the macro-text field is user editable and includes a macro using a roll template (ie everything to make a typical attack roll). In theory, you can delete the entire macro and enter whatever you want.  Basically anything you can type into chat "should" execute and post as expected. I would like to use an api/mod command only. !foo --stuff PROBLEM: What happens is that it simply posts the text into chat and doesn't get executed.  I thought it might need a newline to execute.  I tried '\n' and %NEWLINE% in front of the commands.  Same text-only output. ;-( I tried a hard return on the keyboard.  Same text output. SOLUTION: I conjured up an old trick I learned here on the forums (THANK YOU, whoever you are), I used Shift+Return in the textarea field on the sheet to make the newline.  And it worked. ( more info on textarea fields and new lines )
1659409341
GiGs
Pro
Sheet Author
API Scripter
Nice tip! I'd forgotten about this.
1659413138

Edited 1659413170
vÍnce
Pro
Sheet Author
I beat my head against this for about 30min until it knocked the memory loose from my roll20 archives. ;-)
It works! One side effect I noticed is that, even when pointed to a macro, the entire text of the macro script hits the console. Not sure if this could be an issue over the course of a long game (my ScriptCards script is 584 lines and is used for each attack). 
1659463087

Edited 1659463188
vÍnce
Pro
Sheet Author
Hmm.  So you substituted the default macro-text of the attack with your scriptcard macro (macro added after a 'SHIFT+return' line break, right?) and it posts all of your macro in chat and executes the macro?  Screen shot me the attack with the macro substitution and output if you can. Thanks David
Yes and No. So "yes", in that I did sub the default with a shift+enter and put in "#1e-attack1". And "no" in that the macro runs but post the entire ScriptCards text into the server's  Mod Output Console (ie. in the Mod Library tab; ... previously the API Console). I have yet to try this with other macros but I suspect it does the same thing (? -- not sure why it would be unique to ScriptCards). I'm happy to screenshot, but I think you get the idea. Thanks Vince!
1659499911
vÍnce
Pro
Sheet Author
Strange.  I can run a command from the macro-text field without issue.  It doesn't post anything to chat other than what it would normally output based on the scripts setup. This not a completed fleshed out macro, just something I grabbed from the beta game, but it looks like it's just posting the script card as it should. I tried something similar with token-mod and it works as well.  I'm thinking there might be something in your macro that's causing the issue.  Maybe send me your macro.
Vince, everything posts to chat fine. I'm talking about the API Console . Run my macro and look at the console. Sorry for the confusion...
1659550742

Edited 1659550818
vÍnce
Pro
Sheet Author
lol Sorry, I wasn't even thinking about the API console. My bad. I have to believe that the majority of people only look at the api console if there are issues with a given script, troubleshooting, or if the api has failed all together...  I assume the console output is entirely the purview of a particular script.  Not sure.  You might ask Kurt if there's an option to limit the amount of console output for scriptcards.