Legacy GM Does any one how to create a dialogue.

M

Mombos

Guest
Hey .

I want to make the player to talk to other characters in the game but u don't know how .
Does any one have a good tutorial.
Or a good way to do it .

Especially for one that fits a rpg game .
 
C

Chris S.

Guest
making a dialogue system on your own with a tutorial is not that different, i made mine by reverse-engineering the engine in the video i posted
I suppose it'd just be a bit easier to see why the code does what it does by having someone actually take you through the process.
 
M

Mombos

Guest
making a dialogue system on your own with a tutorial is not that different, i made mine by reverse-engineering the engine in the video i posted
So you think that making dialogue with an engine is better than coding it by myself ??
 

sp202

Member
He just meant that he learnt how to create a dialogue system by examining the system used by the previously posted engine. In the end, it's best that you create your own because only you know what your requirements are, and this sort of thing is good design and programming practice.
 
W

Wraithious

Guest
I find the easiest way to do it is define a global array variable called global.convo[ i ]=""; (where i is the number of players that talk)
then a local variable myconvo=""; and text_size1=1; and text_size2=1; in a text display object's create event,
and a local variable convo_num=0; in the talking players create event,
and a script that holds all the convos. In this way you can set the local variable to whatever text is needed from either the global variable or by setting the local or global variable from somewhere else. So an example would be something like:
script convos:
Code:
if(argument0 = 0)//first npc's convo
{
  if (global.level=1)//depending on level, or character, house #, shop # etc...
  {
    if convo_num=0 //this variable would increase as the conversation progresses
    global.convo[argument0]="Hello want to buy this rusty sword?";
    if convo_num=1
    global.convo[argument0] = "No? you're missing out, it's a diamond in the rough";
   }
}
}
If you need to you can set convos easilly for multiple npc's (even if they are all the same object) in the same room by using their create event

Code:
if(room = mess_hall)
{
with instance_create(x,y,text_pop)
{
text_size1=1.2;
text_size2=1.2;
myconvo="I wouldn't buy that sword if I were you"
}
with instance_create(x+40,y,text_pop)
{
text_size1=1.2;
text_size2=1.2;
myconvo="I would buy it, there's something odd about it";
}
}
text_pop create event
Code:
text_size1=1;
text_size2=1;
myconvo=global.convo[i];
draw event
Code:
// Edited, copy and paste error of convo variable name sorry about that
draw_set_color(c_black);
draw_roundrect(199,0,199+((string_width(myconvo)*text_size1)+32),8+(string_height(myconvo)*text_size2),0);
draw_set_color(c_lime);draw_text_transformed(199,8,myconvo,text_size1,text_size2,0);
draw_sprite_stretched(spell_ani,1,202+(text_size1*string_width(myconvo)),0,32,32);
From here you can do pretty much anything, hope this helps get you started!
 
Last edited by a moderator:

andulvar

Member
if you plan to have more than one dialogue sequence in your game, you will need a text engine. Whether you create it yourself or import something externally it'll need to be done. I'd highly recommend going through the the tutorials posted and looking in the marketplace for something to get you started. From there you can decide if it fits your game or if you need to make adjustment based on your overall design.
 
Top