Dialogue System
A downloadable asset pack
This is a dialogue system for GameMaker Studio (1 & 2). It features:
- Text effects (colours, waves)
- Words spell out like typewriter
- Animated character portraits
- Character voices
- Dialogue choices
- Character emotes
Click here to view/download the asset listing in the GameMaker marketplace. You can use this to download the project contents into your own project, rather than simply downloading my demo project. (Note: only for GMS2. Unfortunately I don't have a license to upload the GMS1 version!)
INSTRUCTIONS
Click here to view the documentation/instructions for this asset.
CREDITS
The character sprites and portraits in the project/previews were made by Buch. The emotes were by Tomcat94. Also, some of the text effects (wave, colour shift) as well as the code logic I'm using for the effects is from this tutorial by diestware.
Importing into Existing Project
For GMS2, you can import the asset from the Marketplace directly into your project. As I said above, I don't have a license to list the GMS1 version. So, here's another method:
Download
Click download now to get access to the following files:
Development log
- Version 1.20Jul 22, 2018
- Version 1.12Jan 14, 2018
- Version 1.11Dec 03, 2017
- Version 1.02Nov 14, 2017
Comments
Log in with itch.io to leave a comment.
doesn't work in gm 1 anymore :(
(or at least for me)
Is there a way to make the wave effect each character independently, rather than the whole string going up and down? I'm trying to achieve more of a ripple effect.
Does anyone know a way to get this to work with non-monospaced fonts?
I banged my head over this for a solid month and found no solution. Sorry, mate!
I ran into an error when running the demo in a new project:
ERROR in
action number 1
of Alarm Event for alarm 0
for object obj_textbox:
DoDiv :2: undefined value
at gml_Object_obj_textbox_Alarm_0 (line 16) - effects_al = array_length_1d(effects[page])/2;
############################################################################################
gml_Object_obj_textbox_Alarm_0 (line 16)
gml_Object_obj_textbox_Step_0 (line 20)
This happens right after hitting "E" to go to the next page, at the first dialogue box.
I have IDE version 2022.5.1.16
same issue
[GMS2 2022.3]
I had a little problem with DialogueSystem_v121.yyz,
when I started the Demo an error ocurred after the first textbox, I could fix it by changing line 10 of Create Event of obj_camera from
[ [1,1, 9,2, 16,4], -1, [1,3]],
to
[ [1,1, 9,2, 16,4], [-1], [1,3]],
search [CTRL + SHIFT + F] for the word "Welcome" to find it.
(GMS 1)
does anyone know how to change the default font color? i know it says to just change "default_col" in obj_textbox but that does nothing at all. i know ive fixed it in projects ive used this for before, but i cant remember how i did it and cant figure it out this time.
EDIT: leaving this up for both future me and anyone with a similar problem. in the actual create_dialogue script it sets the default text color as c_white directly, which seems to overwrite whatever youve set in the textbox. i know the default_col variable does get used in the code of the textbox object but i dont really have the attention span to figure out exactly why it doesnt take effect. i just changed the default in the script.
I wish you still supported this project.
can someone please explain to me how to use the script_execute_alt function
better yet, please explain how do i execute 2 or more different scripts at the same time after going through the dialogue line like:
i++;
myText[i] = "lets go!"
mySpeaker[i] = id;
myScripts[i] = [script_room_goto, room_2]
I want two scripts to happen - room_goto which is working fine but also another script for switching the image_index, how do I do that?
Hey there!
A simple way to do this is use the script event to trigger multiple actions by setting up the condition within the dialog child.
// create
nextroom2 = 0;
//step
if (nextroom2 == 1)
{room_goto(room_2); image_index = new_index; nextroom2 = 0}
//User Event 0 (your dialog script)
[ChooseVariable,object_name,"nextroom2","1"]
did you mean to say "change_variable" for the function name here?
I think you're right! I had changed the default script name for myself and forgot about that.
hey, in case anyone was trying to get this to work on html5: the issue is that sometimes, when pulling from the dialogue youve defined from your speaker, you can leave it blank - since html5 is stricter, this undefined value youve passed in is an error rather than being detected as a 0 and not being passed on
say for example youve not defined colours for a line, instead of it looking like [0,0,0..] (i.e. default colours), it will look like this [undefined,undefined,undefined...]. the main solution is to add a !is_undefined(...) to the value youve passed in from the speaker. i hope this helps somebody!
hey, thanks for posting this -- i know you commented this a long time ago, but i was hoping to get some clarification, if you dont mind, since im having this problem.
when you say "add !is_undefined(...)", where are you actually putting it? i tried to use this solution and i couldnt quite figure it out.
Hey did anyone ever figure this out? I'm getting the same error!
(using GMS 1, so if youre using 2 idk if this will help)
hey! i think i finally figured this one out, though its not a complete solution it looks like. its in the create_dialogue script, down in the switch(arg_count-1) statement.
at the end of each case youll see an if statement that checks if(a[i] != 0) . i added && !is_undefined(a[i]) to each one, and from a quick test it looks like that worked, at least in the base project.
since the text events use a different script than the normal dialogue, however, those are still broken.
OK, I have an issue.
In my project I made an option for players to choose their game target FPS (for different monitors and performance setups) and I adjusted all my object animations and move speeds using delta_time dependent global variable, just a simple multiplier that adjusts all speeds to the selected FPS. So in 144 FPS everything moves and animates at the same relative speed than in 60 or any other FPS (just more smoothly) . It works perfectly. But I can't find how I can adjust character drawing speed in the FC's textbox object. So at high FPS my dialogues are typing too fast.
Is there somewhere a variable or a forgotten magic number in the code that sets up a global typewriter speed or maybe somebody has another idea in mind how to adjust the typewriter's speed?
Edit: Also, how to set up a long dialogue text on multiple pages without breaking it in lots of "Lines"?
OK, I figured it out. I made a kind of step manager that counts steps and authorizes the typewriter to go when necessary delta_time relative value is reached. It is not perfect, because it can work with whole numbers only, but it's overall OK at least for 60-144 FPS setups. For lower framerate it slows down, hélas. Now I need something similar to adapt portrait and mouth animations and I'm kinda stuck with it. Whatever I do, the animation is too fast like if it is not related to my delta_time multipliers at all T_T
Kinda solved the animation problem. The solution was to not link talking mouth animation to vowels and to not link talking animation with typewriter's delta at all. The problem was relative to typewriter's delta-relative counter that works perfectly with characters, but switched on and off too fast for any chosen sprite speed.
Could someone…..anyone…. do a step by step tutorial of implementing this into your project. As a noob I’m having lots of trouble trying to understand this. Also does anyone know of a video tutorial? I’m simply too dumb for the written instructions
If FC won't do it herself the best thing you can do is to follow her Farming RPG series. You will not get the very same result, but you can learn the logic she uses.
Has anyone successfully managed to add gamepad inputs to the dialogue system? Every time I try and use a gamepad input (either via gamepad_button_check_pressed or a similar script value) I either get nothing at all or it instantly triggers all the text at super speed!
I was able to do this!! its a stupid solution, but it mostly works.
if you still need the solution i can tell ya. sorry about how late this is
you might as well tell us the solution, you never know if you can help someone else with the same problem :)
You have to modify the step event in the obj_textbox object to accept more than just keyboard inputs. My recommendation to avoid the instant trigger issue would be to use a script which checks at that instant whether or not a button was pressed, and returns true or false, like this:
If anyone who sees this needs anymore guidance, just reply.There should be a variable somewhere that controls when its day and night. I haven't watched this tutorial but in my game I have a variable called value_ and it goes from 0.0 to 1.0. 0.5 is noon and 1.0 is midnight. I'm sure it's something similar and all you do is update that variable when the game starts.
Darkness variable should be it. I'm guessing 0.7 is the darkest, try changing it to 0.4 or something.
hey the font is too big for my text box, how do i make it smaller?
i fixed it, no worries. got another font, edited it a bit and changed the spacing added borders and everything looks sweet
anybody encounter this error here and know what's up?
likely a 2.3 issue.
EDIT: oh I see someone below posted a solution to this already my bad:
In GMS v2.3.2, there's been a bugfix where array_length returns undefined instead of 0 when you pass in non-array values.
Replace line 16 in Alarm 0 with effects_al = effects[page] != -1 ? array_length(effects[page])/2 : -infinity;
thx toronto!
EDIT2: Looks like I finally get to view the demo project, but some of the text is showing up 'black' instead of with its appropriate style. unless that's just how that portion is supposed to draw :D
Thank you so much! I was stymied by this. Now I can poke around properly!
I tried this, but it's still giving me the same error! I'm on v2.3.6
This was really cool until I broke it and don't know what this error means
This error seems to be related to the 2.3 update. Also can't figure out how to fix it. Did you fix it?
Try to put brackets like this
create_textevent(
[ //myText
load_string_json(global.LANGUAGE, "forest0"),
load_string_json(global.LANGUAGE, "forest1"),
load_string_json(global.LANGUAGE, "forest2"),
load_string_json(global.LANGUAGE, "forest3"),
[load_string_json(global.LANGUAGE, "forest4"), load_string_json(global.LANGUAGE, "forest5")],
load_string_json(global.LANGUAGE, "forest6"),
load_string_json(global.LANGUAGE, "forest7"),
load_string_json(global.LANGUAGE, "forest8"),
load_string_json(global.LANGUAGE, "forest9")
],
[ob, og, og, ob, op, ob, og, og, ob], //mySpeakers
[ [28,4, 42,0], [7,1, 11,0], [21,1, 29,0], [-1], [-1], [1,5, 5,0], [-1], [1,6, 3,0], [-1] ], //myEffects
-1, //myTextSpeed
[0, 0, 0, 0, 1, 0, 0, 0, 0], //myTypes
[0, 0, 0, 0, [5, 7], 0, -1 ,0, -1], //myNextLine
-1, //myScripts
-1, //myTextCol
[0, 3, 2, 1, 0, 5, 3, 1, 2], //myEmotion
-1 //myEmote
);
hello man I love you unfortunately I don't have the money to reward you for creating this tool, so I ask you to come into my house and eat the ass of my whole family as payment =)
In GMS v2.3.2, there's been a bugfix where array_length returns undefined instead of 0 when you pass in non-array values.
Replace line 16 in Alarm 0 with effects_al = effects[page] != -1 ? array_length(effects[page])/2 : -infinity; as a stopgap solution
A good tool for gms2
This has been working very well for me except when it comes to choices/branching dialogue. I get the following error after making a choice (selecting Red, Blue or Green) and I can't figure out why:
Any help would be appreciated! This is what I have in the User Event0 of my custom speaker object.
This looks very cool. I was wondering if you have any advice for how to store dialogue and call it up at the appropriate time. I've heard that using csv or json files is good, but I'm not clear on how to use them in GML.
Thanks!
Made a similar Dialogue System for UNITY: https://narrenschlag.itch.io/better-dialogue
Hello Friendly.C! I'm trying to see if the dialogue can replace the player's sprite for a different one... I have not been able to find a way, could you help??
Switching out the font the text always "kin d a l o ok s l i ke th i s" with spaces between some letters. I've tried different fonts but it always looks off. The "CharSize" variable does change the kerning, but it changes nothing about the character spaces being off in the first place, so you can't fix it by changing that. The random spaces remain.
Does anyone know what this could be about? Is there a way to fix this?
Edit:
To reproduce this, just change the default font to literally anything else. Whatever else I try has the kerning/letter spacing thrown off. Is there any way to fix this, or are you effectively locked to using the font it comes with?
I found the solution, this stuff is only compatible with "monospaced fonts".
the bane of my existence is this right here.
This is literally the most helpful thing I've seen in the history of GMS things.
Thanks so much for this, best of luck to you in your future projects btw!
I'm having a really weird bug importing this into my game. The camera instance works perfectly, when using the player monologue, it draws the textbox about halfway hidden. Specifically, it clips to the bottom of the screen and to the right. I think it could do with something with the gui because my room and camera dimensions are the same (I only plan on playing the game myself, so I set both to 1600x900) I don't mind manually adjusting the positioning, in fact, I would be happy to even just left align everything. I messed around with the xpos and ypos variables and while adjusting the ypos changes the height, the xpos only seems to affect the name box. Can anyone advise me?
I am also having the same issue, any luck?
Uuuuggghh! When I try to import your engine in my GameMaker 1.4, it gives me a bunch of errors. Can you help me just a bit or at least give some clues what I should do?
As stated in the description this is "only for GMS2" and the functions highlighted do not exist. But the good new's is that's your "clue" as to what needs to happen! Break it down line by line and find an alternative method for producing the same result. So for instance if we look at the official documentation for create_array(); [https://docs.yoyogames.com/source/dadiospice/002_reference/001_gml%20language%20overview/array_create.html] it states that it just instantiates (prepares) the array before its used by writing "0" there for as many entries as needed. Could hypothetically use something like this to do it: for (i=0; i < arrLength; i++) { arr[i] = 0; } where arrLength is the numeric value for how many entries you need in the array. put that into a script called "create_array" expecting 1 argument. You may need to play around with this though as i have not had 1.4 loaded onto my pc for a while now but thats the general idea.
Thanks, Leonidus1989!
nnah actually...
yo, I'm super new to itch.io, but you are the only other person I know who has played 'a strange disease' I can't find it on youtube or anything, and I do be stuck 0.0 ... I don't know how to get salt or anything - I appreciate and understand if you wish not to help me (and I'm sorry i didn't direct message you
as I don't know how to yet)Oh my god this is the best thing ever. Thank you so much! I cannot believe it's so robust and especially the fact that its free! This is the best Christmas gift I could've asked for. One thing, I've probably already figured it out by the time you see this, but where is the code that makes the player stop moving? Thank you so much again, this is beyond useful.
hi I ,why is giving me this errors?
Looks like you are using GMS 1.x and its trying to call GMS 2.x functions, but (naturally) they don't exist.
Very cool dialog system! Can't wait to see people transforming this into other dialog system like Undertale or other. Over all best dialog system so far!
Hey there. Does GMS use a version of JS to code? I was wondering if you knew of a similar plugin for RPGMaker MV to do the animated dialogue in text boxes?
GMS uses its own language called "Game Maker Language" which shares similarities to C based languages (and JS by extension). Though it's not a 1 to 1 deal. For RPGMaker i know that yanfly is typically the way to go for that kind of pre-made stuff.
this is so incredibly cool, thank you so much!
gms version doesn't work with html5 =\
This is incredibly helpful (even if I am late to the party). Thank you so much for your tutorials and I will definitely credit and notify you when my game is far enough along. I've learned so much from you so keep up the incredible tutorials and assets! :)