How do I "RPG" some text?

Get help using Construct 2

Post » Thu Mar 24, 2016 6:02 am

I have accomplished getting the text working via Ashley's example, but using SpriteFont+ instead:
https://www.scirra.com/forum/typewriter-text-effect_t63552

The question is, how do I "RPG" this method? IE: How do I load text within the SpriteFont+ box, wait for user input, then continue the text? This would require a "hold button to scroll faster" and a "hold button doesn't continue text, only pressing when text is ready to scroll on" condition. Is there an example of this in action?

To get a better understanding of what I'm talking about, play any RPG ever. :mrgreen:

I do have a few ideas on how to do it, but it would require multiple texts. I'm sure I could also set the text in the code itself instead of calling on pre-defined text, but I'm not sure that would be the best way to go about this.

If anyone has an idea or maybe a forum post I haven't found, please let me know!
B
25
S
6
G
6
Posts: 265
Reputation: 3,696

Post » Thu Mar 24, 2016 6:28 am

I might have a couple examples for you, but how are you actually loading the text? As in, if not from internal system actions (i.e, "set text"), such as a dictionary, .txt file, or array.
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
51
S
24
G
30
Posts: 534
Reputation: 19,620

Post » Thu Mar 24, 2016 6:35 am

https://www.dropbox.com/s/av6kbtg32idgj ... .capx?dl=0

While I don't know how spritefont+ works, this should give you an idea for how to continue.

I highly recommend using a project file to handle your text like I have done - load it in with AJAX. Working with significant amounts of text within C2 is a pretty miserable experience.
Mistakes were made.
B
52
S
26
G
108
Posts: 1,606
Reputation: 61,133

Post » Thu Mar 24, 2016 7:01 am

LaDestitute wrote:I might have a couple examples for you, but how are you actually loading the text? As in, if not from internal system actions (i.e, "set text"), such as a dictionary, .txt file, or array.


I don't have a method yet because I was playing with my options. I suppose I should have also asked about best practices as well. I'm doing a big project that will have a lot of text which is already typed up and ready for production, but I'm just not sure what the best method would be.
B
25
S
6
G
6
Posts: 265
Reputation: 3,696

Post » Thu Mar 24, 2016 7:07 am

oosyrag wrote:https://www.dropbox.com/s/av6kbtg32idgj7u/typewriterprogression.capx?dl=0

While I don't know how spritefont+ works, this should give you an idea for how to continue.

I highly recommend using a project file to handle your text like I have done - load it in with AJAX. Working with significant amounts of text within C2 is a pretty miserable experience.


Sprite font plus works just like sprite font.

I'm on my way to bed but I'll check out your example when I wake up.
B
25
S
6
G
6
Posts: 265
Reputation: 3,696

Post » Thu Mar 24, 2016 7:19 am

roracle wrote:
oosyrag wrote:https://www.dropbox.com/s/av6kbtg32idgj7u/typewriterprogression.capx?dl=0

While I don't know how spritefont+ works, this should give you an idea for how to continue.

I highly recommend using a project file to handle your text like I have done - load it in with AJAX. Working with significant amounts of text within C2 is a pretty miserable experience.


Sprite font plus works just like sprite font.

I'm on my way to bed but I'll check out your example when I wake up.

I would second having some external means to store text, so you can pull it dynamically based on scenario/object/etc.
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
51
S
24
G
30
Posts: 534
Reputation: 19,620

Post » Thu Mar 24, 2016 3:43 pm

oosyrag wrote:https://www.dropbox.com/s/av6kbtg32idgj7u/typewriterprogression.capx?dl=0

While I don't know how spritefont+ works, this should give you an idea for how to continue.

I highly recommend using a project file to handle your text like I have done - load it in with AJAX. Working with significant amounts of text within C2 is a pretty miserable experience.


Do you have this in stable release format? I've run into so many issues using Beta builds versions of C2 that I like to stick with Stable builds. Sorry for the inconvenience. :(
B
25
S
6
G
6
Posts: 265
Reputation: 3,696

Post » Thu Mar 24, 2016 6:21 pm

I think there is actually a typewriter example that comes with Construct as a template (if not I found it as a tutorial, or I could share later).

I would start with that and then speed it up if button pressed/is down.

Basic process is just a txtSource (offscreen) and txtDestination. Start of function will place your desired text in txtSource and every tick will update txtDestination with another letter. I think it was
Every Tick
-txtDestination = txtSource.length(txtDestination+1)

Could have change it to an if else scenario with +2 as the faster one
ImageImageImage
B
40
S
23
G
11
Posts: 498
Reputation: 10,062

Post » Thu Mar 24, 2016 8:15 pm

https://www.dropbox.com/s/a9vurmgzjurgx ... e.PNG?dl=0

There are several ways to handle the text - I've used a simple .txt file with line breaks, and the tokenat expression with newline to break them up. You can use XML as well, or even a spreadsheet .csv and import it into an array.

Also this one instantly completes the current line when hitting space, but let me know if you have trouble modifying it to speed up the rate of display.

EDIT: Here is the one for speeding up - https://www.dropbox.com/s/941g2c2dkjujc ... 2.PNG?dl=0
Mistakes were made.
B
52
S
26
G
108
Posts: 1,606
Reputation: 61,133

Post » Thu Mar 24, 2016 9:24 pm

oosyrag wrote:https://www.dropbox.com/s/a9vurmgzjurgxt9/textexample.PNG?dl=0

There are several ways to handle the text - I've used a simple .txt file with line breaks, and the tokenat expression with newline to break them up. You can use XML as well, or even a spreadsheet .csv and import it into an array.

Also this one instantly completes the current line when hitting space, but let me know if you have trouble modifying it to speed up the rate of display.

EDIT: Here is the one for speeding up - https://www.dropbox.com/s/941g2c2dkjujc ... 2.PNG?dl=0


Your edit was perfect! Exactly what I've been trying to figure out! Thanks a million!
B
25
S
6
G
6
Posts: 265
Reputation: 3,696

Next

Return to How do I....?

Who is online

Users browsing this forum: KTML5 and 31 guests