gluii's Forum Posts

  • I've explained in as much details as I could.

    If you want, you can post your project file, mark the events you need help with and I'll tell you how to change them.

    Are you OK with Discord? Or know someone else that might be ok with explaining it to me?

    Sharing my project i dont think is going to do any good if what I'm trying to accomplish isn't clear yet, so mabye I'll say it better if you hear me speak.

  • I suggest you study a few tutorials about arrays and expressions to get a better understanding of your own code.

    Also, refer to the official documentation.

    https://www.construct.net/en/make-games/manuals/construct-3/system-reference/system-expressions

    As you can see in the manual, chooseindex expression has nothing to do with arrays:

    You can get rid of chooseindex, it's not needed in your case.

    chooseindex(Chatposition,Dialuge_System.At(1,1),Dialuge_System.At(1,2),Dialuge_System.At(1,3))

    is the same as this:

    Dialuge_System.At(1,Chatposition+1)

    To make the code easier to read, you can save the result of that expression to a variable, let's call it res. It's up to you if you make it global or local.

    Set res to Dialuge_System.At(1,Chatposition+1)

    Then you can split the result into sentences using tokenat and tokencount expressions. Again, see the documentation about how to use them. For example, tokencount(res, "_") will return the total number of sentences. And tokenat(res, 2, "_") will return the third sentence from the res string.

    DialogueText Set Text to tokenat(res, sentenceNumber, "_")

    I have ADHD, people with this condition have very difficult time processing and understanding information. Things that are normally easy for most to comprehend it is a real struggle for ADHD people. I've watched & read I belive every tutorial on Dialuge out there (cause I cannot find anymore), gone threw the instruction manuel so many times for 2 years just to get this one thing to work. It's not the fault of you or construct its just the Curse of having this Disability and again I apologize for being irritating.

    I know it's very frustrating helping me but I appreaciate the time you've given me.

    Mabye if I verybly ask and explain what I want verbally in Discord it would be better? If your willing?

  • Ok, then see my fist comment. Wrap your expression in tokenat()

    Set text to tokenat(chooseindex(Chatposition,Dialuge_System.At(1,1),Dialuge_System.At(1,2),Dialuge_System.At(1,3)), sentenceNumber, "_")

    or the same but simpler:

    tokenat(Dialuge_System.At(1,Chatposition+1), sentenceNumber, "_")

    .

    On every key press increase sentenceNumber, from 0 to tokencount(Dialuge_System.At(1,Chatposition+1), "_")-1

    oh ok and is "sentenceNumber" a global or local variable?

    and in your first comment, which of the 2 options you gave do I do? is what you just now explained one of those to or am I confusing something?

    Do I....

    -split the result of that expression || tokenat(chooseindex(...), index, separator)

    Or do I...

    -save it to a variable first, and then use tokenat on the variable. ||tokenat(result, index, separator)

    although I read the instruction idk if I do understand them, I think I do but I may not. would you mind explaining these terms if its not to much trouble? just to make sure I understand what they are.

    *chooseindex (this means the text will look inside the array right? and you tell it were to look by typing numbers inside parenthises?)

    *index (is this a number Variable?)

    *Result (idk what this means in this context sorry)

    *

  • You need to post an example of your array! I know what token is, I don't know how are you using it in your project.

    Sorry I ment to send the screenshot but I didn't go threw

    I didn't mention I was using Tokenat to break up sentences the of the NPC's Dialuge? Every time a Key is pressed it PROGRESSES THE DIALUGE (this is what the Tokenat is for). And I'm using "_"

    Hello and welcome to the adventure field._ on your journy you'll face many dangers_ take these weapons s and potions to protect yourself._ good luck.

    <key press>

    Hello and welcome to the adventure field._

    <key press>

    on your journy you'll face many dangers_

    <key press>

    take these weapons s and potions to protect yourself._

    <key press>

    good luck.

  • What do you mean by "11 tokenats", "28 tokenats"?

    You should probably post your project or some screenshots of your array and the result you want to achieve.

    You don't know what a tokenat is?

    You understand I'm using separators right? I know the phrasing is teqnichally incorrect but I was expecting the meaning to get across.

    It's like when people say the Sun is about to set, that's scientifically I acurate but we understand what they mean.

    When using a Tokenat expresstion you have to signify what divider you wanna use to break up the sentences. I'm using the separator "_".

    The Construct website explains how to use it in its instructions section if you need to look it up.

    What do you mean by the result I want to archive? Is that some code terminology? I have read the instructions myself buy I don't understand what you mean. If you mean what I'm trying to achieve I belive I stated in the first part of this post.

    I can screenshot it but I don't think it's gonna help. I've done it before and it hasn't. I don't know why what I'm asking for is so difficult ether for me to explain or for others to understand. And I know I have to be very specific but if you could meat me half way to help me how to ask the question it'd be good.

    At the end of the day I just wanna make a dialuge system using and Array.

  • Do you want to split the result of that expression?

    tokenat(chooseindex(...), index, separator)

    Or save it to a variable first, and then use tokenat on the variable.

    tokenat(result, index, separator)

    I'm sure I understand I'm sorry. what would those options do?

    what I'm trying to do is when a line of Dialgue within an ELEMENT reaches the last separator for the Tokenat it will go down to the next ROW, and when the last separator within the ELEMENT in that ROW is reached, it will go to the Next COLUMN, and when the last COLUMN is reached, go to the Next Sheet. and so forth, like reading a book- Top to Bottom, Left to Right. This is a very Dialuge heavy game so I need something like this. Will the Options you provided let me do that?

    So far I can only, when clicking on an NPC, set text to only 1 ELEMENT that has the text in it with a Tokenat so Im able to put several sentences in and press a Key to Progress Dialuge.

    Or, NOT use tokenat and go down ROWS,COLUMNS,SHEETS but i wont be able to progress dialuge within ELEMENTS as well.

    does that make sense? like a group of 4 ROWS for example

    SHEET.1

    COLUMN.1 COLUMN.2 COLUMN.3

    R1. 6 tokenats E1. 8 tokenats E1. 12 tokenats

    R2. 11 tokenats E2. 14 tokenats E2. 6 tokenats

    R3. 2 tokenats E3. 30 tokenats E3. 4 tokenats

    R4. 28 tokenats E4. 1 tokenats E4. 10 tokenats ---> Next Sheet

    SHEET.2

    COLUMN.1 COLUMN.2 COLUMN.3

    R1. 6 tokenats E1. 8 tokenats E1. 12 tokenats

    R2. 11 tokenats E2. 14 tokenats E2. 6 tokenats

    R3. 2 tokenats E3. 30 tokenats E3. 4 tokenats

    R4. 28 tokenats E4. 1 tokenats E4. 10 tokenats ---> Next Sheet

    SHEET.3

    COLUMN.1 COLUMN.2 COLUMN.3

    R1. 6 tokenats E1. 8 tokenats E1. 12 tokenats

    R2. 11 tokenats E2. 14 tokenats E2. 6 tokenats

    R3. 2 tokenats E3. 30 tokenats E3. 4 tokenats

    R4. 28 tokenats E4. 1 tokenats E4. 10 tokenats ---> Next Sheet

  • is it possible to put a "Tokenat" expression in this line of code for the Text object? i tried putting it everywhere and it doesn't seem to work.

    I'm using an array to put all my story and dialuge in.

    ---set text to

    chooseindex(Chatposition,Dialuge_System.At(1,1),Dialuge_System.At(1,2),Dialuge_System.At(1,3))

  • I don't know what you are using the tokenat expression for. Is it to split the text into multiple lines? In this case you can continue using it of course.

    > And with "Add 1", would I code it to be - on Tapped anywere --> Add 1 to "Row Variable" And it'll make it go down? And so I just make a "Column Variable" and "Sheet Variable"?

    Correct.

    And then use Array.At(columnVariable, rowVariable, sheetVariable) to actually get the value from the array.

    Tokenat is for the Dialuge System. In each element sentences are separated by "_", every time screen is tapped dialuge progresses. When I tell the Text Object what to do I want to be able to keep using it with what you gave me. I guess the picture of my Code is Still not enough to convey what I want. I'm sorry 😞

    I just don't know how to ask my questions.

    I apologize if I was being frustrating. But thanks for the help anyway. I'll use what you given me.

  • Referencing elements in an array with variables is not difficult:

    Array.At(column, row, sheet)

    So you'll need three variables - column, row and sheet.

    Say, if column=1, row=4 and sheet=0, it will return "this is the box for the choicebox" line from your array. Add 1 to row variable and it will return the next line below it.

    I still don't quite understand your idea, but if the plot of the game is linear and dialogues are played one by one, it may work.

    Oh ok, And I can use a Tokenat expresstion with it to? I wanna keep using tokenat if possible.

    And with "Add 1", would I code it to be - on Tapped anywere --> Add 1 to "Row Variable" And it'll make it go down? And so I just make a "Column Variable" and "Sheet Variable"?

    I'm I thinking of it right or understood ya good? Could I see a screenshot of what the code would look like if that's OK?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So let's say the OBI character has 20 dialogue lines. Some are on sheet1, some on sheet2 etc.

    When you collide with OBI, how do you know which dialogue should be played and from which sheet?

    I probably confused everybody with the pick. How I set it up was just for my personal refrance. Is it nessary to know? Just to make a variable that can change columns/rows/sheets?

    Well to answer, OBI would be the main character. And when he collides with any NPC, several characters can be part of that conversation. You know how in other video games just because you walk up and talk to 1 NPC doesn't mean another can't walk up to you in that sense and join the conversation. It's like a scense being played out in a movie ya know? You don't have to walk up to each individually and speak to only 1 NPC at a time. And I want after one NPC finishes saying what they need to say for the row to go down 1 and the next character will say there thing, then down another etc.

    Each ROW (Vertical) = a group of CONVERSATIONS, Each COLUMN (Horizontal) = Represents A TOPIC or Mission, Each SHEET = a new PLOT or Progresstion in the Storyline. And I will have diffrent variables to trigger when a new plot point is finished and has begun (I may have gotten the horizontal/vertical confused). I hope I'm making sense I'm so sorry 😞.

    The characters you see would all play a part in the conversation even if OBI didn't collide with them to begin with. Like it's not like you collide with a particular NPC and you ONLY have a conversation with that one at a time. It's like a movie scene playing out. Another NPC can come in and start talking. And you know how there's a picture of the character and the characters name by the dialuge to? Those change when the player taps and the next character taps.

    Idk. It's just the same as dialuge in a Pokémon game or undertale. I just want that. I feel I'm almost there. Would you like to see the code I have so far for it?

    tokenat(Array.At(0,0),Chatposition,"_")

    Using the Token At expresstion has been so helpful so far. So I was wondering if I could put something within the expresstion mabye to make the text object go down rows/columns/sheets. I was thinking of using the dictionary but it didn't work.

  • I feel so bad for asking cause I've been stuck on this so long.i took a couple months break, But I'm in the middle of making a Dialuge System just like the ones you'd find in any RPG (like Undertale).

    I have an Array with Rows, Columbia and Sheets of Dialuge for my NPCs. Everything's set up when the player collides with them and I can get several lines of speech with the Tokenat. But I don't know how to go about going down rows or across columns or going to the next sheet in the array.

    I just want when the player taps the screen for the text object to read the next row/column/sheet.

    Should I make a variable or idk? I was told to be very percist with my Questions but I'm not sure all the time if I'm asking right so sorry.

  • In the tokenat expression you would change array.at(0,2) to use a variable instead o the 2 so array.at(0,var). Then using a similar condition you have for = 'back', you have = 'next' and then change that new variable, maybe add 2 to it so it skips from 2 to 4. You also need to set chatposition back to 0.

    That would be for column skipping. If you want to change row then you need a variable for the X so array.at(var,2) and then change that variable to signal the row.

    Oh hey thanks for helping me again ^^

    So would I use a global,instance or local variable for the expression then?

    And what about for skipping sheets?

    And when it’s another character’s turn to talk I need the character picture & name text to change at the same time.

  • I am not sure how to phrase this question cause I know my Questions must be detailed or they won't make sense or understood so I'll do my best and I hope what I'm asking makes sense. I can clarify in the comments more if anyone needs me to.

    I am talking with an NPC using an Array for a Dialuge system. In each row and column I have a paragraph or text the character says. Each row or column belongs to a character.

    I use Tokenat to progress the dialuge with "_". And I use "back" to set the conversation to the beginning. I would like to have a tokenat like "next" or somthing to move up and down a row and or go to another column as well as some paramater that'll make the text go to the next sheet of the array so the text advances to the other characters paragraph; and when it does change a Character Profile Picture to the corresponding character and name.

    So far this is the code I use

    CONDISTION

    LIST: selected item is = 0 ------>

    ACTION

    *Set Text to----> tokenat(Dialuge_System.At(0,2),Chatposition,"_")

    *Set List Invisible

    Global variables

    Inchat= 0

    Chatposition= 0

    Selected NPC= 0

    The idea is for the array to act like a screenplay sheet. 1 sheet has a few related missions and when going to diffrent NPCs the text opens up another sheet.

    If I can get this last bit to work my dialuge system will be complete.

    I've had lot of help so far on thanks so much guys.(^-^)

  • My example has several lines in one cell like how you described. For tokenat you just need the text so that will be the array position. Work out how you are changing the array position, array.at(x,y) is what you need. In my example I pull the row from an instance variable on the NPC. I don't see why that would be different.

    tokenat(text,index,separator) is what you need. The index to move across the string is the chatpos variable. The separator is the underscore. You should have all you need really. For choices I hardcoded it to certain rows, so you can do that with list item, if list item 1 is picked then use this row of the array, i.e. set a variable to that row for array.at(var).

    Look at how I change the Y variable based on text object clicked, you would do that with list item instead, that's probably the only change from my example. If you don't want to set it on the NPC (I was doing this to track it better for bugs), you set the dialogue directly in the list object instead of the NPC.

    ok,i got it to work. thanks so much the help^^

  • I don't understand the question because I didn't use your list object. Try and understand my example, see if you can relate it to the list.

    Oh ya I know you didn't use a list object. I was saying I decided to use a list object instead to see if it worked better for me and it did. So I was asking a diffrent question regarding that. I would like to but a Tokenat INSIDE an array so in each element in the array I can write several lines of dialuge instead of 1 line per element.

    Like at

    0,0 Hello, welcome to the adventure field_ you'll need a sword and shild_ and a map to help you navigate_ good luck

    0,1 ah I see you returned safely_now you see how dangerous the path is_ a word form the wise^ always take left turns

    0,2 you are stronger then you let on to be_ not many have made it this far_ you may be the choosen one our village has been hoping for.

    ----> Choice i.e (list object)

    1.thanks nice talking to ya

    2. The chooses one?

    3. It was difficult,you got healing items?

    4. We're is the next path?

    -----On choice 1 tapped

    Exit dialuege

    -----on choice 2 tapped

    1,0 yes you see there was a prophecy about you_you were born with special powers_lemme tell ya about it.

    1,1 but first let's go get some coffee_ its early in the morning and I'm beat_ at the shop I'll tell you all you need to know.

    1,2 OK thanks I appreaciate it_ I cup of coffee would do me good_ I've gotta loosen up.

    -And so forth-

    Thinking of it like a book. I want each element in the Array to be like a paragraph or a small chapter and the whole Array to be a Book if that makes sense. I don't want to only be able to put 1 sentence in each but still tap a button inside one element several times and get several lines of dialuge then when a choice is made I forward to the next element or exit out.