Addling a line break to a variable (or to anything really)

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
Shadow Wizard
Giant
Posts: 192
Joined: Mon Apr 11, 2011 8:11 pm

Addling a line break to a variable (or to anything really)

Post by Shadow Wizard »

I am trying to edit the GM notes on a token, but I need to add a blank line. <br> just literally adds <br> to it, and even <html><br></html> adds that literally to what i am doing. Here is the code I have thus far:

[h:setGMNotes(GetGMNotes()+"<html><br></html>Smite Evil (Su): Once per day a celestial creature can make a normal melee attack to deal extra damage equal to its HD (maximum of +20) against an evil foe.")]

Lil help would be wonderful.

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

Re: Addling a line break to a variable (or to anything really)

Post by aliasmask »

You don't need <html> tags for gmNotes to be displayed when clicking on the token in object layer. But if viewed from the token config, it shows all the literal html. If you want to toss in a CR, you can put a literal CR in the string.

Code: Select all

[H: newNotes = oldNotes + "
New stuff goes here"]
I also do thing like this.

Code: Select all

[H: EOL = decode("%0A")]
[H: newNotes = strformat("%{oldNotes}%{EOL}%{newText}")]

Post Reply

Return to “Macros”