Dialogue in 'typewriter text' (Scrolling NPC conversations)

Get help using Construct 2

Post » Fri Jul 17, 2015 7:46 am

Hi all.

I've spend two days trying to figure this out and it's driving me crazy. My logic skills are poor, as you will see by my screenshot below.

Goal: To have one string of text (Currently stored as a global var) be typewritten on the screen. Then, when the string has finished, pause 3 seconds and go to the next line of dialogue. This is basically simulating those old RPGs where character dialogue would scroll until it filled the panel etc.

Now, I have read the guides posted in the FAQ, which work very well, but only for one line of dialogue. I need to be able to jump to the next string, which is what I'm having trouble implementing, and my brain is failing me.

Here is a screenshot of my failed logic:

Image

The issue is to do with loops and the variables I use to keep track of when to jump to the next speaker. After going through the first line of text successfully, the speaker variable just keeps getting bigger and bigger, not staying at the second speaker. I've made a real mess of things and I'm not sure how to fix it despite starting over three times. About to give up on it, but I'd like to see if it's possible. I've tried going through a whole bunch of the examples on the forums that have been linked in the past, but I don't see a good way to implement exactly what I'm after (other than buying a plugin).

Link to my horrible program:
https://www.dropbox.com/s/2czssa7509gyc3v/Not%20working%20example.capx?dl=0

Any light shed would be greatly appreciated. Thanks very much.
B
5
Posts: 10
Reputation: 255

Post » Fri Jul 17, 2015 10:22 am

Your use of functionis correct, however your application of the function is incorrect.
You want your function to standalone,
meaning you call the function and pass the text onto it via param

something like this
screenshot of function

Now use function to type out words by adding those words in param
Typing function using param

The function saves the param text into variable sourcetext
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,708

Post » Fri Jul 17, 2015 10:41 am

Thanks so much for taking the time to investigate the issue for me. I'll try out your advice straight away and let you know how I go. I appreciate your time.
B
5
Posts: 10
Reputation: 255

Post » Fri Jul 17, 2015 11:29 am

Image
B
65
S
23
G
7
Posts: 1,502
Reputation: 10,890

Post » Fri Jul 17, 2015 11:34 am

korbaach wrote:DialogueExample.capx


Holy smokes, that's phenomenal. Thank you so much!!! (And very much above my level of comprehension. Not sure what a lot of these expressions do haha)
B
5
Posts: 10
Reputation: 255

Post » Fri Jul 17, 2015 12:30 pm

DUTOIT wrote:Your use of functionis correct, however your application of the function is incorrect.
You want your function to standalone,


Just tried it and it worked perfectly. You're awesome!

Thank you so much and it allows me to have conversations between a large number of NPCs.

Cheers :)
B
5
Posts: 10
Reputation: 255

Post » Fri Jul 17, 2015 1:35 pm

Ok, I've unfortunately hit on another problem now. I guess by making all these mistakes it's giving me a real good opportunity to learn.

Here is the code thanks to your input so far from the thread:
Image

The issue is that a) The code jumps the first speaker and goes straight to the second speaker. (I can't alternate speakers the way I wanted to.) Furthermore, if I add a third or fourth line of dialogue by calling the 'loadtext' function, it automatically jumps to the last line.

b) I have tried to get a pause between the lines of dialogue using the Wait function, and that doesn't work either. I've read a little bit about how wait doesn't suspend the program as one would expect. Ideally, I'd like a keyboard input to jump to the next text line.

I think these problems are arising because I'm fundamentally misunderstanding how triggers and loops work in the scheme of the whole event sheet.
B
5
Posts: 10
Reputation: 255

Post » Fri Jul 17, 2015 1:50 pm

I know you are asking for help but I can't resist and shamelessly plug my Dialogue system template. You can fiddle with it on the demo page. Here's a short dialogue example that you can load with it.

As for your problem, I guess you could always "stack" the lines of dialogue in an array and pop them one at a time when the DestText.Text = DIALOGUE_PLACEHOLDER (Line fully shown).
B
69
S
28
G
24
Posts: 977
Reputation: 18,739

Post » Fri Jul 17, 2015 1:53 pm

Hi Magistross. Yes I've come across your phenomenal dialogue system in researching answer to my problem. First of all, it looks great and I will end up buying it for future projects because it does exactly what I need. At the moment part of the efforts are in the pursuit of trying to educate myself a little on Construct itself. Thanks for the reference and I look forward to seeing your template in action :)
B
5
Posts: 10
Reputation: 255

Post » Fri Jul 17, 2015 2:01 pm

I edited my message and added a possible for way to deal with multiple lines of text at once. If you need help with arrays I'll be happy to oblige. ;)
B
69
S
28
G
24
Posts: 977
Reputation: 18,739

Next

Return to How do I....?

Who is online

Users browsing this forum: Phacanu, plinkie, zenox98 and 13 guests