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

Text Chat Formatting

Um, probably an odd question, but is there anyway to force a new line in the text chat for keeping macros "clean" and neat. I mean I can do with it with repeated use of " " to create spaces. But that doesn't transfer well from person to person. I've examined the Help Files about the text area but it only gives information on chat commands, not what sort of escape codes can be used. I've seen formatting used for these Power Card things, I'm guessing the code has to be in there somewhere, I'm hoping I'd be able to do this without API because I don't know a single thing about javascript except how to create HTML mouse overs and OnHover.. and that was 10 years ago. But if I have to use API if someone might be able to tell me/point me to where I could learn how to do it. So long as I can stick the function or api " !newline " whatsit into ability macros and can be used by gm and players I'd be happy. ------------- I find it strange that I can use &nbps; and <!-- --> inside of abilities and macros but not <br> or /cr, /nl etc..
1402809150
Pat S.
Forum Champion
Sheet Author
can you show what you mean? My brain is tired right now and is not comprhending rihgt now
1402809883

Edited 1402809979
Toby
Pro
The Forums seem to have striped the "& nbsp;" but all of the whitespace is dozens of those whitespace escape codes. /em @{character_name}'s Turn Undead Turns Per Day: [[@{cha-mod}+3]] Closest first within 60' No LoS but LoEffect (p. 176) Turn Undead: [[1d20+@{cha-mod}]] Most Powerful [[2d6+@{ClrLevel}+@{cha-mod}]] Total HD /w GM Turning Check Result ------------------------------------- | Turn Result | Most Powerful (HD) . 0 or lower ........[[@{ClrLevel}-4]] HD 1-3 .................. [[@{ClrLevel}-3]] HD 4-6 ...................[[@{ClrLevel}-2]] HD 7-9 ..................[[@{ClrLevel}-1]] HD 10-12 ..............[[@{ClrLevel}+0]] HD 13-15 ............. [[@{ClrLevel}+1]] HD 16-18 ............. [[@{ClrLevel}+2]] HD 19-21 ...............[[@{ClrLevel}+3]] HD 22+ ................. [[@{ClrLevel}+4]] HD Produces This: More or less, (To GM): Turning Check Result ---------------------------------------------- | Turn Result | Most Powerful (HD) . 0 or lower ...................8 HD 1-3 ..................... 9 HD 4-6 .................... 10 HD 7-9 .................... 11 HD 10-12 ..................12 HD 13-15 .................. 13 HD 16-18 ................. 14 HD 19-21 .................. 15 HD 22+ .................... 16
1402824510

Edited 1402824519
Lithl
Pro
Sheet Author
API Scripter
You can't simply insert a line-break (a-la <br>) into a macro. Starting a new line in the macro will produce a new line in the output, because you're sending multiple commands to the app at once when you execute the macro; for most people, this is wholly sufficient, however there will be a 7px margin between each line, which is not particularly conducive to table formatting. The power cards script uses the /direct command to send raw HTML to the chat, however /direct is only usable through the API's sendChat function. You could use the same thing to create a !newline command. I can see two ways of doing it: choose an EOL character and send the whole message as one line (eg, "!newline This is the first line|This is the second line"), or store each line in a buffer before flushing it (eg, "!newline This is the first line" "!newline This is the second line" "!flushnewlines").
I have no real knowledge of javascript as I said, however, I am quick study. Problem is all of those weird techno terms, turn my head. I learn by examples and practical trial and error, (and very rarely through hands on tutoring). Can you think of any API that has an example of this so I could take a look at and pick apart.
1402835717
Lithl
Pro
Sheet Author
API Scripter
No, I can't think of a good example for you to pick apart, sorry. The power cards script outputs multiple lines, but it's a lot more complicated than what you're looking for.
I'll take a look, maybe I can get something from them..
1402838664

Edited 1402838988
Just use /direct and format it as an html table with a simple api script.
Thank you for the help, but I still need to teach myself the basics, but now I have starting point. HoneyBadger: Your suggestion is a good one but I dont want to have it entirely written in the API, that would make it very hard for my players to use and modify.