rtf in mmf2

illegalbloodmarket's picture

I'm having trouble figuring out how to use rtf inputs in MMF2. What I'm trying to do is pretty simple, I want the text typed into the rtf input object to be remembered and then displayed later on in a different frame. It's pretty much just a 'What is your name?' input screen to be used in an rpg. I'm going to have a lot of other similar objects where text input, selection from a drop list, etc is remembered and then displayed later on.

How do I do this?

illegalbloodmarket's picture

Actually, do I even use rtf?

Actually, do I even use rtf? lol

Danni's picture

Are you sure you want to use

Are you sure you want to use a Rich Text editor if you're only using it to get the player's name? A simple Edit Box object will work well enough.

As for storing the information, if you just want to keep it in memory, the built-in Global Strings will work fine. If you need to save the information to disk, you have a few options:

- The INI Object saves information out to human-readable files.
- The Array Object saves binary-encoded files, but is limited in that you can only have the file include all numbers or all strings, and you have to deal with fixed dimensions.
- The Named Variable Object provides a key/value store where you can store numbers and strings, each one associated with a name (key), and save out to various file formats.
- Several other extensions also provide similar functionality.

And if you want to slip the player's name into a string, you'd use an expression like this:

"Yahoo! Hi, " + {retrieve data from object} + "!"

Where {retrieve data from object} is where you click on the "Retrieve data from an object" button and select the object you want to get the string from.

illegalbloodmarket's picture

This worked! Thank you. One

This worked! Thank you.

One more thing,
I have a scroll list object in a frame and I want a text object to appear when one of the selections in the list is clicked on (list of character classes, player clicks on one and the description of the class is displayed). I'm not sure how to set events to occur when items within the list are clicked on. I can't seem to find conditions pertaining to individual lines of the list. The class selection also needs to be remembered at a later time.

Danni's picture

You'll want to use the

You'll want to use the "Selection changed" event and then, in your expression, use "Get current line number".

illegalbloodmarket's picture

So I have the condition

So I have the condition 'Selection Changed' for the List and under the List events, which event do I use to set an expression? Set line data>retrieve data from object>Get current line number?

illegalbloodmarket's picture

I've figured out how to

I've figured out how to display different images based on the selection in the list by adding a counter with a 'get current line number' expression and then if the counter is equal to a number, such as counter=2 (line two in list), then a text appears. Thanks.

pensive-mosquitoes