GameMaker: Studio

GameMaker: Studio

Find, play, and make games easily
Discover, rate, and download the best player-created games made in GameMaker: Studio for free. Or try making your own and share with the community. Click here to learn more.
How do you make Dialogue in a game?
< >
Showing 1-6 of 6 comments 1 Nov 7, 2012 @ 3:54am 
There are a few tutorials on this in the Game Maker Community, the forum managed by YoYo Games. Generally, it would be to use the draw_text method, and one simple way of doing it is to get a script, and do this.

switch (argument0)
case 0:
return "This is the first box of text."
case 1:
return "This is the second box of text."

And you can generally work with this and make it more complex to fit your needs. you could have it so that this script could input the quest the player is in, the character, the discussion, and the block of discussion by nesting switch statements.

There are many other ways to do this, like instead of returning a string, you could handle all the drawing here, though that would be repetative unless you intend to make the text be more dynamic. You'd input this into the Draw Event of an obj_misc_dialoguebox.


And you don't have to be limited using draw_text, you could use draw_text_ext to make the text be colored. There are plenty of other things you could do, but this is just a general idea, so look up open source RPGs or tutorials on the matter. ;D
Jester Helquin Nov 7, 2012 @ 12:45pm 
Thanks! whers is a good place to get more tutorals?
The_Sea_Four 2 Nov 7, 2012 @ 1:18pm 
The Gamemaker Community tutorial forum would be the best place, probably.
M.S.T.O.P. 4 Nov 7, 2012 @ 1:36pm 
Another way of doing it is to put all the lines of text into an array, like this:

line[ 0] = "Alice: Hi, I'm Alice"; line[1] = "Bob: And I'm Bob."; line[2] = "Charlie: And I'm Charlie!"; line[3] = "Bob: Go away, Charlie, nobody likes you"; line[4] = "Charlie: :'(";

And have a variable (like "position") to keep track of which line is to be displayed.

You can something like a Keyboard event to change "position" so the player has control of the dialogue flow, or you can use a timeline to have the dialogue proceed automatically.
Last edited by M.S.T.O.P.; Nov 7, 2012 @ 1:36pm
Jester Helquin Nov 7, 2012 @ 5:36pm 
so would i put it in the object or make a tottaly new object?
Darkrain 2 Nov 8, 2012 @ 10:26pm 
Both suggestions are good ones, but because of how many different ways of displaying text there are the only way you're going to get all of your questions answered is to get in there and try it for yourself. I know that sounds cliche, but it really is the truth.
< >
Showing 1-6 of 6 comments
Per page: 15 30 50