I may try to add buttons in the near future, but for now, it looks like I may have something that is working to some degree using only strings.

Right now I have working code that makes it so that if I left-click on the witch, this text will appear on the screen:

Code:
Hello, my sweetie!
         Hello.  How are you?
         Get away from me, witch!
  	 (Ignore)



I also programmed it so that if the player clicks on the first response ("Hello. How are you?" - judging by the location of the mouse cursor when the left mouse button is clicked), this text will show up on the screen:

Code:
I am very well.  Would you like to buy a potion?
         Yes, I would.
         No thank you.
  	 (Ignore)



The only problem is that the second set of text overlaps over the first set of text, so that you are able to see both sets of text simultaneously. I want to make it so that if the player clicks the first response ("Hello. How are you?") from the first set of text, the entire first set of text will disappear, and the second set of text will replace it.

Here is the code I am using to try to make this happen:

Code:
...

function witch_event() 
{
   if ((event_type == EVENT_CLICK) && (my.STATE == 2))
   {
      PANEL* talk_panel_0 = pan_create(NULL,0);
      PANEL* talk_panel_1 = pan_create(NULL,0);
      FONT* talk_font1 = font_create("Times#35i");  
      FONT* talk_font2 = font_create("Times#30i");   
      STRING* statement = str_create("Hello, my sweetie!");
      STRING* reply_1 = str_create("           Hello.  How are you?");
      STRING* reply_2 = str_create("           Get away from me, witch!");
      STRING* reply_3 = str_create("           (Ignore)");

      pan_setstring(talk_panel_0,0,300,400,talk_font1,statement);
      pan_setstring(talk_panel_1,0,300,450,talk_font2,reply_1);
      pan_setstring(talk_panel_1,0,300,500,talk_font2,reply_2);
      pan_setstring(talk_panel_1,0,300,550,talk_font2,reply_3);

      wait(13);
      set(talk_panel_0,SHOW);
      wait(120);
      set(talk_panel_1,SHOW);

      while(1)
      {	
         if(mouse_left && (mouse_pos.x > 377) && (mouse_pos.x < 602) &&  (mouse_pos.y > 456) &&  
            (mouse_pos.y < 474)) // Mouse cursor locations of the "Hello.  How are you?" response
	 {
	    statement = NULL;
	    reply_1 = NULL;
	    reply_2 = NULL;
	    reply_3 = NULL;	
				
	    statement = str_create("I am very well.  Would you like to buy a potion?");
	    reply_1 = str_create("           Yes, I would.");
  	    reply_2 = str_create("           No thank you.");
  	    reply_3 = str_create("           (Ignore)");
				
	    pan_setstring(talk_panel_0,0,300,400,talk_font1,statement);
	    pan_setstring(talk_panel_1,0,300,450,talk_font2,reply_1);
  	    pan_setstring(talk_panel_1,0,300,500,talk_font2,reply_2);
  	    pan_setstring(talk_panel_1,0,300,550,talk_font2,reply_3);
  			
  	    wait(13);
  	    set(talk_panel_0,SHOW);
  	    wait(120);
  	    set(talk_panel_1,SHOW);
  	 }
  	 wait(1);
      }
   }
}

...



Does anyone know what I am doing wrong to make it so that the first set of text disappears when I click on the first response:

"Hello. How are you?"

...and the second set of text replaces the first set of text?

Last edited by Ruben; 05/17/14 23:10.