Workflow for displaying text efficiently for C2

  • I am currently creating a dialogue system with C2, and the thing is this: text object works wonder, but there are something that I want to discuss.

    The thing is this, I have a character that talks for about a paragraph or two, and I don't wanna fit the whole thing into one huge text object. I prefer a part of the conversation displayed at once. The character shouldn't speak the whole thing, but rather, a few sentences, with respect to the situation.

    It's like I want:

    "Good morning, Commander."

    "Today, you have an appointment with Alex 9 AM"

    "Please proceed to the meeting room immediately"

    and NOT

    "Good morning, Commander. Today, you have an appointment with Alex 9 AM. Please proceed to the meeting room immediately."

    You see? The feeling is a bit different.

    So I am thinking of two things:

    1. using arrays as instance variables within text objects. I see that number, text and boolean are possible but not array. Of course, I could go with many text variables for each text object instead, but if all text objects may use or may not use all variables. This becomes problematic design-wise and is not practical. The workaround would be too bizarre.

    2. create another Array object and somehow "bind" it with the text object and display it accordingly. I wouldn't mind it if we are writing some scripts here, but drag and drop events in event sheet is kinda slow, for this really. I wish I could write all the event sheet in some form of codes and not just drag and drop somehow...

    I have also looked around the forums regarding dialogues, but I see that workflow-wise, I don't think I see a feasible way for creating a C2 game that is heavy on the dialogue like RPG yet...

    So anybody has a word on this?

  • are you aware of the tokenat() and tokencount() expressions? they might be all you need

    you could store your dialogue in a string variable.. whether global/local or private as an instance variable on a character.

    storing the dialogue like this:

    Good morning, Commander./Today, you have an appointment with Alex 9 AM/Please proceed to the meeting room immediately

    means that you can return parts of it (tokens) using tokenat(text,index,separator)

    indexes start from 0 so it goes like this:

    tokenat(Dialogue,0,"/")

    returns the first part

    tokenat(Dialogue,1,"/")

    returns the second part

    etc

    tokencount(Dialogue,"/") as you've probably guessed returns the amount of tokens.. it'd be useful for automating the dialogue without having to do an event for each line.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I see. That's a new insight. Thank you very much. :D

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