Dialogue System Template (Templates)

3 favourites
From the Asset Store
Fruit Slicer Template & Quality fruit and slice graphics (c3p,png,illustrator files)
  • Alright, this problem is most likely spritefont's height related. Since you are using a very low resolution, you needed to reduce the dialogue height in such a way that there is not enough space to display a single line of text, meaning the system will enter in a perpetual "text overflow" mode, continually prompting the user to continue the dialogue.

    I definitely did not think this would ever happen !

    What you need to do is adjust things a bit so you can better use the space inside the window. First, reduce the DIALOGUE_MARGIN variable to something much less than 16. This number represent the amount of pixels between the window border and the spritefont, normally equal to the 9-patch object's margins. So you could use a low number like 2 and alter the 9-patch sprite to have a single pixel border, and adjust its margin to 2 on all sides. Second, you should probably use a spritefont better suited for such a low resolution. The font I provided with the template is 16x16, which is quite big considering your window size.

  • Success! Still need to tweak the dialogue box, add portraits, get the continue button oriented, but I did add my own font and so far it looks great.

    Thanks for the help!

  • Haha! Good going, nice to see you're getting the hang of my system.

    Don't forget to adjust the other variables if you need. DIALOGUE_PORTRAITWIDTH and DIALOGUE_LINEHEIGHT might need some tweaking. DIALOGUE_HEIGHT - DIALOGUE_MARGIN * 2 should be a multiple of DIALOGUE_LINEHEIGHT, this way the space available will be optimally used. Might also consider tweaking DIALOGUE_ARROWSIZE too if you plan on having dialogues with lots of "choices" ({choice} command with many different inputs), you'd need smaller sprites too for DownArray and UpArrow. The ContinueIndicator could also use a new, smaller sprite, and if you want to change its position, look at events 27 and 30, where it is created.

    Glad I could help!

  • This is such a great template! Had my fair share of doubts but reading through these comments helped me a lot and I got most of the implementation done in a single night (only have to adapt the portrait and I'm set).

    I have a small request though, if possible - for future updates would you consider adding commands buttons on the utility template? That's what I did in mine at least, this way I could add and edit the text much easier.

  • Pretty clever actually, the idea had crossed my mind but seeing it in action sure does help realizing how useful it would be. I'll be sure to add it in the next version!

    That said, that game of yours looks pretty good. If it plays as well as it looks, I'm sure it will be a hit!

  • Magistross Thank you! And I hope that in the end it does play as good as it looks, that's my main concern too.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey I love this dialogue system, took me a bit of reading to get my head around it but I've got it working fine now, I can call saved dialogues on the fly -

    One thing I am having difficulty with, I want to have in-game cutscenes and can't figure out how I would implement things like character movement during dialogue scenes (I know that's not well explained)

    An example would be: Npc says one line of dialogue, when the player hits enter to continue the dialogue the npc that is "speaking" walks to the other side of the room.

    Is there a way to, for example, call a function from within the saved JSON? something like "Hey this is some dialogue" {callfunction : functionname}.

    Sorry if this is poorly worded, I'm not quite sure how to describe what I mean

  • Hey smallrobot, thanks for your kind words!

    It's quite feasible, the "text command" functionality is entirely customizable. You could create a "callfunction" command that accept at least one parameter (a callback function name) and optional parameters to be passed to the callback. Or you could also create a dedicated command called "MoveNPC" that accepts parameters to customize what NPC should move and how it should move.

    To create new commands you simply have to add more events under the "Dialogue_ProcessCommand" function event in the "Text commands" group.

    Let me know if you need further help!

  • Hey Magistross

    Thanks for such a quick reply bud - I don't know how I missed the text commands group, I feel daft now. That worked great, I added commands to select an object from a variable and then move it, change its current animation etc... so now I can just write up entire cutscenes in the dialogue and call them when needed, which is super handy.

    Thanks again!

  • That's pretty neat Good job on sucessfully turning my dialogue system in a full fledged cutscene scripting language.

  • Funny enough I got to the same point this weekend. Working on cutscenes with dialogue and was trying to figure out how to control my characters during and after dialogue. Came here and smallrobot had pretty much asked my exact question Text commands work great! Controlling the cutscenes via the dialogue is really handy. You really thought this asset out well Magistross!

  • Running in to an issue: I'd like to move the dialogue box to a different position for cutscenes. I tried setting up a text command that set the DIALOGUE_POSITIONX and DIALOGUE_POSITIONY when called via dialogue. I couldn't get it to move the dialogue box and I even tried setting the local variables as static.

    I found a temporary fix by doing this:

    Is there a better way to do this? Thanks!

  • bclikesyou That's actually the proper way to do it. The DIALOGUE_POSITIONX and DIALOGUE_POSITIONY are local variables used when creating a new dialogue. Setting them as static is only half the solution, you still have to move the current window/spritefont/portrait. Take note that the variables won't revert to their original values, so you might want to add new variables to store default values and a function to revert to them.

  • bclikesyou That's actually the proper way to do it. The DIALOGUE_POSITIONX and DIALOGUE_POSITIONY are local variables used when creating a new dialogue. Setting them as static is only half the solution, you still have to move the current window/spritefont/portrait. Take note that the variables won't revert to their original values, so you might want to add new variables to store default values and a function to revert to them.

    Ah perfect! Yeah it's working great for me so far.

  • Thanks for this system, a little bit complicated and the workflow with the utility is hard to pick up at first, but got it up and running in my game within an hour. Some documentation would probably be helpful to newer users as I had to read through this thread to get going. Great work Magistross

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