<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<object>
  <spriteName>&lt;undefined&gt;</spriteName>
  <solid>0</solid>
  <visible>-1</visible>
  <depth>0</depth>
  <persistent>0</persistent>
  <parentName>&lt;undefined&gt;</parentName>
  <maskName>&lt;undefined&gt;</maskName>
  <events>
    <event eventtype="0" enumb="0">
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>/// Initialize the variables
message = "";            // Player input message  
text1 = "";             // Each of the text(n) is a line in the dialog
text2 = "";
text3 = "";
text4 = "";
text5 = "";            // This is the last line in the dialog but you could add more
                       // More about this ^ in the step event 



text_cursor = "|";
delay = 20;             // Blinking cursor variables 
alarm[0] = delay;


</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="2" enumb="0">
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>/// Create the  Blinking cursor
if (text_cursor == "|")    // if the text_cursor == "|"
{
    text_cursor = "";      // Turn it into a blank string 
}
else                       // when the alarm runs again and it's  
{                          // !text_cursor == "|" 
    text_cursor = "|";     // make it == "|"     
}                          // creating the blinking cursor  

alarm[0] = delay;
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="3" enumb="0">
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>/// Track the message  
// Main part of the dialog engine 
message = keyboard_string;          // Takes in players key inputs       
                            

if (!message == "")     //Makes sure message is not blank before you can press enter
{                                   
if (keyboard_check_pressed(vk_enter))
{
    if (!text4 == "")            // This ordering leads it to check the top to bottem
        {                       // Rather than bottem to top which can cause erros
            text5 = text4; 
        }                       
    if (!text3 == "")       // &lt;--------------- This is the "text chain"
        {                   
            text4 = text3;       // Info on how this works | 
        }                        //                        v
    if (!text2 == "")                
        {                   
            text3 = text2; 
        }
    if (!text1 == "")                
        {                   
        text2 = text1; 
        }
    keyboard_string = "";  
    text1 = message; 
}
}
// When you hit enter, keyboard_string will be turned into a blank string
// while making text1 = whatever message was
// The next enter press will make text1 = whatever message was
// and text2 = whatever text1 was
// and so on till you get to text5 and gets replaced
// It's stores the string of the last text and make the next text = that
// with each enter press. 

// Leading to many possibilities and with the example I made with it.. 
// in obj_game, I made a mock up of what you could do in this engine, making small talk 
// with the player which could lead to events, talk with npcs and so on and even make 
// Text combat with mobs(Such as obj_mob_rat, which I didn't get to yet!)

/*
to add another line 
1. Create another text(n) variable
2. Add another  
if (!text5 == "")                
        {                   
            text6 = text5; 
        }
to the top of the "text chain"
3. add it to the draw event --&gt;  draw_text(x,y+10,text6);
4. change the y values of the other text(n), till it fits!
And you have yourself another line. 
*/
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="8" enumb="64">
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>/// Draw the text
draw_text(x,y+160,message+text_cursor);     // Draws Each text1,2,3..
draw_text(x,y+130,text1);                   // and draws the blinking cursor
draw_text(x,y+100,text2);
draw_text(x,y+70,text3);
draw_text(x,y+40,text4);
draw_text(x,y+10,text5);
</string>
          </argument>
        </arguments>
      </action>
    </event>
  </events>
  <PhysicsObject>0</PhysicsObject>
  <PhysicsObjectSensor>0</PhysicsObjectSensor>
  <PhysicsObjectShape>0</PhysicsObjectShape>
  <PhysicsObjectDensity>0.5</PhysicsObjectDensity>
  <PhysicsObjectRestitution>0.100000001490116</PhysicsObjectRestitution>
  <PhysicsObjectGroup>0</PhysicsObjectGroup>
  <PhysicsObjectLinearDamping>0.100000001490116</PhysicsObjectLinearDamping>
  <PhysicsObjectAngularDamping>0.100000001490116</PhysicsObjectAngularDamping>
  <PhysicsObjectFriction>0.200000002980232</PhysicsObjectFriction>
  <PhysicsObjectAwake>-1</PhysicsObjectAwake>
  <PhysicsObjectKinematic>0</PhysicsObjectKinematic>
  <PhysicsShapePoints/>
</object>
