How do I delete a sentance? (solved)

0 favourites
  • 9 posts
  • Hi there, I'm wondering is it possible to delete a sentence from an array? Or perhaps select a line of dialogue within text?

  • I assume you have one element of the array that is a block of text?

    you can use find() and rewrite the string and reassign without whatever you find. you could use a combination of the left() and right() or maybe you can use replace()?

  • I assume you have one element of the array that is a block of text?

    you can use find() and rewrite the string and reassign without whatever you find. you could use a combination of the left() and right() or maybe you can use replace()?

    That's a good idea. Using the replace function works! I'm hoping to replace every line as it's presented in text, but for some reason I'm stuck in a text loop. The game keeps showing me the 2nd, and 3rd line of text instead of moving on the next line of dialogue as I've stacked every line in a single array.

    Example: "hi there. how are you. what's that."

  • It seems to delete the sentence the first time, but for some reason returns the sentence already deleted after pressing the button a 2nd time.

  • what are you using those 'wait's for?

  • That's so everything works correctly. I have the code set to wait right after "." appears, then carry the sentence to the next line in array.

  • That's so everything works correctly. I have the code set to wait right after "." is typed, then carry the line to the next array. After that I'm stuck in a constant loop of dialogue.

    For some reason the code will only show me the first 2 lines.

    Line1 "Hi." Line2 "What's up."

  • can you post a simplified .c3 project file? its hard to tell from that snapshot.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Whoops, I just noticed the mistake I made in the code. I've been using the array to compare the 2 text when I should have transferred the array text to a variable. I'm actually shocked how well this works.

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