Workflow for displaying text efficiently for C2

Get help using Construct 2

Post » Sun Apr 28, 2013 12:35 pm

I am currently creating a dialogue system with C2, and the thing is this: text object works wonder, but there are something that I want to discuss.

The thing is this, I have a character that talks for about a paragraph or two, and I don't wanna fit the whole thing into one huge text object. I prefer a part of the conversation displayed at once. The character shouldn't speak the whole thing, but rather, a few sentences, with respect to the situation.

It's like I want:

"Good morning, Commander."
"Today, you have an appointment with Alex 9 AM"
"Please proceed to the meeting room immediately"

and NOT

"Good morning, Commander. Today, you have an appointment with Alex 9 AM. Please proceed to the meeting room immediately."

You see? The feeling is a bit different.

So I am thinking of two things:

1. using arrays as instance variables within text objects. I see that number, text and boolean are possible but not array. Of course, I could go with many text variables for each text object instead, but if all text objects may use or may not use all variables. This becomes problematic design-wise and is not practical. The workaround would be too bizarre.

2. create another Array object and somehow "bind" it with the text object and display it accordingly. I wouldn't mind it if we are writing some scripts here, but drag and drop events in event sheet is kinda slow, for this really. I wish I could write all the event sheet in some form of codes and not just drag and drop somehow...

I have also looked around the forums regarding dialogues, but I see that workflow-wise, I don't think I see a feasible way for creating a C2 game that is heavy on the dialogue like RPG yet...

So anybody has a word on this?keroberos2013-04-28 12:36:06
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
24
S
9
G
11
Posts: 408
Reputation: 8,040

Post » Sun Apr 28, 2013 1:55 pm

are you aware of the tokenat() and tokencount() expressions? they might be all you need

you could store your dialogue in a string variable.. whether global/local or private as an instance variable on a character.
storing the dialogue like this:
Good morning, Commander./Today, you have an appointment with Alex 9 AM/Please proceed to the meeting room immediately

means that you can return parts of it (tokens) using tokenat(text,index,separator)

indexes start from 0 so it goes like this:

tokenat(Dialogue,0,"/")
returns the first part

tokenat(Dialogue,1,"/")
returns the second part

etc

tokencount(Dialogue,"/") as you've probably guessed returns the amount of tokens.. it'd be useful for automating the dialogue without having to do an event for each line.
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Mon Apr 29, 2013 3:38 am

I see. That's a new insight. Thank you very much. :D
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
24
S
9
G
11
Posts: 408
Reputation: 8,040


Return to How do I....?

Who is online

Users browsing this forum: Vallar and 20 guests