paul Posted March 23, 2009 Report Share Posted March 23, 2009 In ME4 we can display a message using rich text, e.g. we can bold certain parts of our message. And as in ME3, we can display variables, e.g. %T[1]% Now, can we store rich text in a variable and display that? So I want to display this message: Welcome Can I store this formatted string ("W" in bold, "elcome" in italic) in a variable and display it? Quote Link to comment Share on other sites More sharing options...
Cory Posted March 23, 2009 Report Share Posted March 23, 2009 Sure. If I understand you correctly. Let's say "Welcome" in your example could be any word and you want the first letter bold and the remaining italicized. Simply parse the string into two strings, one for the first character and the rest in the second. Then apply the formatting to the variables. <VARIABLE SET STRING Option="\x00" Destination="Test1" Value="W"/> <VARIABLE SET STRING Option="\x00" Destination="Test2" Value="elcome"/> <TEXT BOX DISPLAY Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\b\\f0\\fs16 %Test1%\\b0\\i %Test2%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> Another solution might be to dynamically create a file and use the Load Macro Text File. Quote Link to comment Share on other sites More sharing options...
Beaue Posted February 5, 2013 Report Share Posted February 5, 2013 Hi guys, I realize this thread is rather old, but I'm looking for a method to do something that was mentioned in Paul's original post. I'm wanting to find a method to store rich text in a variable. The clipboard would probably work too, but I would prefer to find a way to just store rich text directly in a variable, to make it easier on the rest of the script. The Text Box Display command doesn't suit my purposes. You kinda lost me when you suggested dynamically creating a file and loading a macro text file. Can ME4 save data to, and pull data from an .rtf file? Is that similar to what you were suggesting? I noticed that the Load Macro Text File command looks for .txt files and .mxe files. Are .mxe files rich text or plain? Quote Link to comment Share on other sites More sharing options...
Cory Posted February 11, 2013 Report Share Posted February 11, 2013 Rich text is a plain text format. IE the tags are normal characters like I'm writing now. EG to make the name Cory bold I write "{\b Cory}". Much in the same way we do with HTML. Open an RTF file created in WordPad in a text editor sometime. It's human readable. So the string in my example here of a bold Cory can be saved in a string variable. But what is it you are trying to do? Please explain. On a lark I'll guess you want to do something that's not immediately available and you might need to use Run Macron in Variable. See help file. It sounds intimidating but it's really not. Just realize that your normal view in the script editor is not how the commands are actually stored but rather a collection of nice dialog boxes to create and edit commands. Switch views to the direct editor and you will see the actual commands they build. All Run Macro in Variable does is literally execute whatever string is in the variable you choose as a macro command. This gives on the ability to modify things that would otherwise be difficult to change. EG you have a bit of string to display in a dialog box to have 4 different words colored 3 possible different ways. Without this command you would need a logic matrix of 12 Message Boxes plus the lines of logic. Often it is easier to modify the text of the command to accomplish this. Anyway just a shot in the dark. Quote Link to comment Share on other sites More sharing options...
Beaue Posted February 21, 2013 Report Share Posted February 21, 2013 Hmm, your post has sparked an idea. I will have to look at the direct editor more and mess with it. In the meantime I found a work-around that I've been using to accomplish the same thing, but it is a little clunky. As soon as I have some time I'll revisit this one. Thanks! Quote Link to comment Share on other sites More sharing options...
Cory Posted February 21, 2013 Report Share Posted February 21, 2013 I can't tell you how many of my clunky short term solutions have never been fixed :-) 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.