Dialogue in 'typewriter text' (Scrolling NPC conversations)

0 favourites
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • 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:

    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.

  • 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

  • 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.

  • 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)

  • 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

  • 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:

    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.

  • 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).

  • 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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • Hi Magi, thanks for adding your insights. Do you mean adding an 'Else' statement to that first sub event? I appreciate the tip and it sounds promising (also because I've still got nothing haha). I'm curious as to what you mean by 'popping out the array'. I've got a basic working knowledge of arrays, but in this instance I'm not sure how I'd go about using them to get around the issue. Any insights are always greatly appreciated I'll keep playing with it as well haha.

  • Yeah, that's basically adding an else statement to the first sub-event. Here's the capx, with added mumbo jumbo to hide all NPC but the "speaking" one. Not really necessary but I tried to reproduce your events as closely as possible.

  • Just added the above to Magistross example if you want it to wait 5 seconds then switch automatically.

    But, please insert another condition. I didn't add it.

    Maybe a variable called talkingmodeon and set that to 1 for on and 0 for off.

    So it needs waiting to be 1 and talkingmodeon to be 1 to trigger the event.

    So when you want to trigger the talking stuff, you mark it 1, and when you want to deactivate you make it 0.

    There are tons of ways to do same thing, some better than others. As you develop your game further you will find new ways to handle this, that match what you are trying to do

  • If you looked at my wrote-in-three-hours entry for deception jam at https://github.com/paulscottrobson/Deception there is a scrolling three line typewriter which is very primitive but does work.

  • Guys, I don't know what to say - thank you all so much for your collective input and intelligent advice. I've learned so much trying to go through the ropes here and this community I think is a big part of what makes this package so appealing. Thanks again. I only just got back online, but I'll have a look at all of your feedback, try to implement and learn from it, and let you know how it all goes in the finished product. Believe it or not this is for the intro to the game (a simple top down racer), but I've struggled more with this section than any other part, so your help has been appreciated greatly.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)