Dialogues like in a JRPG

For questions about using Classic.

Post » Thu Feb 18, 2010 3:11 am

I want dialogues like in a Japanese RPG, where there is a portrait of the character talking, and lots of text to read for each character.

I was trying to learn how to use the Text Manipulator object to try to do this, and some advice on how to use it would help since I could not find out how.

I want to be able to read all the dialogues from files, so I can write all the text for a character and not worry about measuring it to fit on the text box, so if the text loaded into the text box reaches two lines of text, it automatically stops reading the text from the file and waits player input so it can display other 2 lines of text until the dialogue for that character is over, then it switches to another character dialogue text.

If possible, I want to be able to read from a file the name of the character, all it's dialogue, what portrait to show and the position of the text box. That would be all I need, for now.

How could I achieve this?.
B
5
G
2
Posts: 46
Reputation: 817

Post » Thu Feb 18, 2010 6:17 am

I am doing a similar game Making a Panel Object visible with a picture and text box Object on it. Mine is much simpler so all my test is embedded in to the program.

If you really want to read it form a file the simpler way might be to pre-format it onto files and then read thew one you need with an INI Object.

Unless you have so much text that it bogs down your program I suggest you put it all in the game. This way no one can pre read it.
B
28
S
8
G
8
Posts: 530
Reputation: 7,154

Post » Thu Feb 18, 2010 5:31 pm

Man, I've done this once, when I was doing a platform-rpg (like Flashback), but I lost everything :(

I was using the Timeline object, and using the parameters on each step to determine which character was saying. It was working perfectly! :? :?
The timeline object is VERY powerful, but it is a bit stiff right now (you can't add step in the middle of the timeline, and you can't rearrange them...)

I'll try to make a .cap this weekend, when I'm free, to show it.
B
107
S
40
G
10
Posts: 456
Reputation: 13,202

Post » Thu Feb 18, 2010 7:50 pm

Great, Thanks both. I figured a nice way to do it just using Timeline object, like this:

I create a timeline with no periods, an empty one, and I add periods with events, each calling the textbox with the desired text and eny other action I want. I also put a text object called "Text_test" with a private variable called 'text number' to be able to switch to the next timeline period when a key is pressed. Make sure to uncheck the Timeline not to load on start on the properties bar.

For example:

+On Collision between Player and Character
-Timeline: Load and Play Timeline "Timeline1"
-Timeline: Add str(Text_test('text number')) period <-- I use a private variable with a starting value of 1

+On Period "1" begin: Write Text "First dialogue Text"
+On Period "2" begin: Write Text "Second dialogue Text"
+On Period "3" begin: Write Text "Third dialogue Text"

+On any key pressed AND Player Overlaps Character:
-Timeline: Finish time period str(Text_test.Value('text number'))
-Text_test: add 1 to 'text number'
-Timeline: Add str(Text_test('text number')) period

I hope that helps, and thanks for the ideas!.
B
5
G
2
Posts: 46
Reputation: 817

Post » Thu Feb 18, 2010 8:09 pm

I made these a while back so they're not exactly what you're looking for but give them a peek.

[url:33gntyid]http://www.box.net/shared/8zb2lnnsca[/url:33gntyid]

This first Cap gets dialogue from an INI file and places it into Hash tables at the start of layout so they can be based on levels.

[url:33gntyid]http://www.box.net/shared/xtbcikf6r3[/url:33gntyid]

The second Cap scrolls text but I never added the ability to determine if you're stopping mid-word and cut off beforehand. (You have to type text into the box to see it in action.)
B
2
S
2
G
3
Posts: 114
Reputation: 1,553


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests