1. Hey! Guest! The 36th GMC Jam will take place between February 27th, 12:00 UTC - March 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice
  2. NOTICE: We will be applying a Xenforo update on Tuesday 25th of February. This means that from approximately 10:00 to 14:00 BST the forums will be offline (or possibly longer). Sorry for the inconvenience! Official Announcement here.

GML Change Dialogue

Discussion in 'Programming' started by Chope Carne, Sep 4, 2019.

  1. Chope Carne

    Chope Carne Member

    Joined:
    Sep 4, 2019
    Posts:
    1
    Hello, I have a doubt, I'm doing a Textbox, with dialogues and all of that, and I want to put another different dialogue when I've talked to a person. For example, I've finished a dialogue with a person, and if I interact again, I want to another different dialogue. Help please :(.
     
    Last edited: Sep 4, 2019
  2. CedSharp

    CedSharp Member

    Joined:
    Sep 5, 2016
    Posts:
    665
    This means you need to "remember" if you talked to that person or not.
    In programming, we "remember" things very often, by using variables.

    You could do something like creating an array or list of dialogs you want to show.
    You would then create a variables that tracks which dialog should be displayed.

    something like this (pseudo code):
    Code:
    // Create event
    dialogs = [
      dialog_start,
      dialog_continue,
      dialog_end
    ]
    
    current_dialog = 0;
    
    // When you want to display a dialog
    var dialog = dialogs[ current_dialog ];
    show_dialog(dialog);
    
    // If we are not showing the last dialog yet,
    // make the object remember to show the next dialog
    // next time we interact with it
    if(current_dialog < 2) current_dialog++;
    
    Something like this is probably what you are looking for.
    Hope this helps.
     

Share This Page