-
I would like to implement a simple system that shows some dots "..." when there is more dialogue to come. My issue is I don't know how to detect if this line is the last one in the dialogue. I see there is resource.lines that contains ALL the titles and all the lines, even if they are not readable, like code or similar. Is there a simple way to apprach this that I'm missing? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
So in the balloon the chain of dialogue is exposed similarly to a tree structure (or linked list if it's linear), where each "line" contains a reference for the next. If the next line is empty, and there are no responses, that means the dialogue ends. Docs reference I gave it a quick test and using the following to debug:
It looks like the dialogue will end when the first expression is null and the second is an empty array, so I'd suggest implementing an if statement in your bubble that disables a three dots UI element if the above occurs. (this requires a custom bubble, which you can get by cloning the default one under |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
So oddly the mutation has to be between a dialogue option and a series of responses for this behavior to occur. Mutations themselves work fine. Simplest solution would be to just avoid that pattern in writing dialogue, but that does seem like it should pass through the response list, so I'd say go ahead and open an issue for this bug. |
Beta Was this translation helpful? Give feedback.
Wow ok, so that was a journey. Long story short, you can check for null types using the
get_line
command (notget_next_dialogue_line
), as it will only return null if the dialogue is ending, and an empty object otherwise. This is not a bug, it's just how the engine works. get_next_dialogue_line just causes problems. You should be able to call get_line from the same method signature. (If you're in C# I opened a PR adding get_line to C# so you'll have to either patch in the extra code or just wait for it to get merged.)