How do I make lines of text move up as new messages come?

  • Hello, I am trying to make a text based rpg system similar to MUD rpgs, but the one problem I am having here is that while I have a text area that text enters into under new lines, once the text reaches the bottom, the previous lines do not move up. My question is how can I make the text move up a line each time a new line is inserted? Or how can I add a scroll bar?

    Here is my event sheet as it is right now.

  • I haven't tried it, but maybe this plugin will help:

    If not, scrolling with events may be difficult as different browsers render text differently.

    Also, if you are making an RPG with lots of lines of dialog, hard-coding lines of text into events is a bad idea. There are few tutorials on how to make dialogs properly in FAQ.

    Here is one example that uses XML file to store dialog options:

    (Working link to capx file in comments)

  • I'm testing the plugin out and so far when I tell it to scroll or scroll to the next line everything just disappears, but I will work with it some more and test it out.

    And there will be a lot of text in general, dialog and occurrences, but they are all tied to events that happen based on what the player types, sort of like running commands through a command prompt. Since there is a lot that is tied to each line of text I feel it will be fine that I have the text directly in, I will just make sure to keep each occurrence in the game tied to a group of events so that I can condense them and edit them if need be without getting things mixed up.

    edit: By setting the vertical alignment of the text at the bottom I was able to get what I wanted, even if it doesn't scroll.

    Thank you for the help though, this plugin may come in to help em later.

  • If your game flow will be "linear" you might get away with hard-coded dialogs.

    I suggest to make gaps in your Mode values though. Instead of (1, 2, 3..), use values (10, 20, 30...). This way, if in the future you decide to insert some additional dialogs between 10 and 20, you will not have to shift Mode values in your entire project.

    If your game is non-linear, thing may quickly get out of control. I highly recommend using some dialog engine.

    As for your troubles with the plugin - read comments to that post, there may be a solution.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok, so ran into a problem when I realized that once the Text_Area had maximized the number of lines within it, it no longer showed lines that were suppose to appear as new lines. So I went back and tried it as a Textbox and it didn't work out because things weren't coming in as separate lines. So I went back to that scroll plugin, and it is shifting to the new lines perfectly, the only problem is it is only allowing 3 lines at a time and erasing any lines prior to that rather than filling up the size of the Text_area object. I'm a little confused how I could set how many lines may be displayed at a time, because there is a line sample on the plugin's website that has lines filling up the size of the object, but I don't understand looking at the event sheet why it works in the example and not my .capx

    Edit, also, I will look into that dialog example and see if there's a way I can condense the text, I'm just unsure if it will work since so many events and variables are tied to each thing.

  • pez263 Could you share your capx file?

  • Ok, You will need that plugin you mentioned earlier.

    https://drive.google.com/open?id=1XxjYF ... EIK-1Mk6l3

  • pez263

    Fixed:

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

    It kills me to see such inefficient code.. I made some changes, hope you like them. There are two function that display text in two different ways, you can delete the one you don't need.

  • This is perfect! I haven't quite looked into how functions work exactly before this so I wouldn't have guessed to use them, but I like both methods of how lines are inserted, I think I can use both to further distinguish dialog and narrative. Thank you so much for helping with this, I wouldn't have figured this out otherwise.

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