Branching Dialog System with Effects in GMS 2! (Part 2: Branching Dialog)

Поделиться
HTML-код
  • Опубликовано: 29 сен 2024
  • After doing a bit of setup in part 1, this video focuses on implementing the branching dialog and the support systems that make it work. If you're having issues, always remember to check back over the video carefully and double-check your work!
    Support me and these videos on Patreon! / peytonburnham
    My tweets: / peydinburnham
    My Game: peytonburnham....
    Discord: / discord
    My twitch: / peydinburnham

Комментарии • 358

  • @molly16474
    @molly16474 11 месяцев назад +54

    if anyone's wondering how to make certain events/new dialogue trigger based on the player's responses, I just initialized a few global variables in the obj_settings create event and you can change them in the scr_game_text function in each specific case.
    for ex, I set global.quest = false in obj_settings, and then under the specific case i want to trigger something I changed it to true. example:
    case "npc 1":
    if global.quest == false
    {
    scr_text("this text will trigger the quest");
    global.quest = true;
    break;
    }
    if global.quest == true
    {
    scr_text("quest is now triggered!");
    break;
    }

  • @jessejayjones
    @jessejayjones 3 года назад +68

    ❤️ This is so much better explained and organized than any other tutorial out there... I'm also grateful you had all these parts finished when the first part was published. I was worried I'd be waiting months to see the other parts. You are amazing, and all your work is very, very appreciated. Thank you!!!

  • @Lovelandmonkey
    @Lovelandmonkey 4 месяца назад

    Great stuff, glad I've finally decided to follow this tutorial! The only thing that I haven't been able to solve is around the time options are added, clicking on an npc without any dialogue will crash the game instead of making a blank text box. Now, considering you likely won't want an npc to show a blank textbox this shouldn't matter, but it irks me that it doesn't work. Apparently it has something to do with text_x_offset not being set? but it works fine otherwise, in any other case.

  • @mehmetyigitkeskin5049
    @mehmetyigitkeskin5049 3 года назад +1

    Great video as always :D

  • @MyBedIsInAWall
    @MyBedIsInAWall 2 года назад +2

    I've copied everything exactly and no matter what the textbox never shows up unless i put the draw event code in an draw gui event and even then only the first textbox listed is showing
    case "npc 1":
    scr_text("line of text");
    scr_text("line of text 2 , the sequel nobody asked for");
    break;

    case "npc 2":
    scr_text("See you on the other side!");
    break;
    npc 2 never shows at all

  • @greenglubs
    @greenglubs 5 месяцев назад

    i'm very late to the party, but i was wondering if there was a way to make it so when you scroll through the options you can have a sound effect play? i tried to set up something like this
    if keyboard_check_pressed(ord("W")) or keyboard_check_pressed(ord("S")) { audio_play_sound(snText, 8, false); };
    and it works, but it plays the sound every time the player presses those keys, even if the arrow isn't moving.
    so is there a way to make it so when the arrow moves, a sound effect plays? i've been looking through the code and i don't know where i'd put it

  • @Blowitch
    @Blowitch 2 года назад

    I know some people have been having the following issue:
    Opening the dialog box will skip the first page but not the other ones
    Obviously that would happen if the skip key is the same as the key to open the dialog box, which causes the player to open the dialog box and skip the first page simultaneously.
    If you still want both keys to have the same purpose, here's what I did:
    First of all, you must create a variable that allows the player to skip the dialog. This way, the dialog won't be skipped as you open the dialog box anymore.
    Initialize in Create event:
    dialogSkip = false;
    The idea now is to create a "time gap" between both key presses, so they count as separate inputs.
    *First method involves using an alarm, it's the most compact one: (I'll arbitrarily use Alarm 0)*
    Add an Alarm 0 event and inside that event type:
    dialogSkip = true;
    This will ensure pages can be skipped after the end of the countdown.
    In step event:
    if (!dialogSkip) alarm[0] = 1;
    *Second method is just a for loop, for those who don't like alarms I guess:*
    In step event:
    if (!dialogSkip) {
    for (var i = 0; i < 2; i++) {}
    dialogSkip = true;
    }

  • @viperizer0
    @viperizer0 Год назад

    I’ve been having a problem with my dialogue looping after you click an option instead of saying the option. I’m not sure what the issue is and would appreciate some help if anyone is able.

    • @TakornATP
      @TakornATP Год назад +1

      I think I have the same problem. I'm trying to fix it.

    • @viperizer0
      @viperizer0 Год назад

      @@TakornATPLet me know if you figure it out! I’ll do the same!

    • @TakornATP
      @TakornATP Год назад

      I got it!! It was my mistyped. I was checking for hours until I saw it. 😅😅

    • @viperizer0
      @viperizer0 Год назад

      @@TakornATP Okay!! So it might be a mistype somewhere?? Do you know where so I know where to start looking?

    • @blobof4294
      @blobof4294 3 месяца назад

      @@viperizer0 heya havin the same problem, do you know how to fix this?

  • @everydaygremlin
    @everydaygremlin Год назад +57

    Ive seen some people wondering how to make the game pause when theres a textbox onscreen, and to do that you just go into the pauser object (from the room transition video) and set it as the parent for the textbox object. I hope this helps someone!

    • @Draightmare
      @Draightmare Год назад +2

      yeah, and for people who dislike using parent systems, the best and easiest way imo is to just set a variable that either hides or disables any interaction with the textbox.

    • @00nex
      @00nex Год назад +1

      Oh my gosh, thank you so much. I've been trying to write down a way to pause the character when there's text, and this whole time, i already had an object to do it for me.

    • @Ark-mm6lt
      @Ark-mm6lt 6 месяцев назад +2

      When I used this, it just forces the player into an unstoppable loop of dialogue, is there any way to fix it??

    • @CalbDoesStuff
      @CalbDoesStuff 2 месяца назад

      @@Ark-mm6lt same issue, did you end up solving it?

  • @noahkelley9019
    @noahkelley9019 2 года назад +53

    Just a quick comment to recommend something to make the scr_game_text easier to navigate. While you can just add a comment like "// Conversations for Room 2" or something like that, you could also combine that with "#region" and "#endregion" to make it collapsible code (Or folded code, depending on what you call it). An example would be the following:
    #region// TEMPLATE
    case "":


    break
    #endregion
    Which ends up looking like the following when collapsed:
    #region// TEMPLATE
    Hope my comment helps other people who also found this video very helpful but have issues with too much text becoming hard to search through.

    • @bilagiatta
      @bilagiatta Год назад

      this is very helpfull thanks dude

    • @i6ey
      @i6ey 38 минут назад

      t h a n k y o u

  • @RedStrings
    @RedStrings Год назад +9

    so i keep getting an error with the "textbox_x + text_x_offset[page]" it keeps giving me an error

    • @katychidavid7862
      @katychidavid7862 6 месяцев назад +2

      Yeah me too,still haven't found the solution 😭

    • @RedStrings
      @RedStrings 6 месяцев назад

      i found out what it was, problem is i forgot what the problem was in the first place, but it had something to do with in what order you place things. if something is defined after an equasion uses it, the game cant use it@@katychidavid7862

    • @ghost2130Main
      @ghost2130Main 3 месяца назад +1

      @@katychidavid7862 did you fix yet?

  • @Learnjapanesefromsomeguy
    @Learnjapanesefromsomeguy 3 года назад +29

    Another excellent tutorial! Thank you so much for doing these.
    [SOLVED}
    I have not seen the other videos of this series, so perhaps you go over this, but I would also like to learn how to press a button in order to initiate a conversation with an NPC, as opposed to clicking them.
    I tried doing something like this:
    if(keyboard_check_pressed(ord("F"))) //press F to talk to NPCs
    {
    switch(face) //see which way the player is facing
    {
    case RIGHT: //If the player is facing to the RIGHT
    if(place_meeting(x+move_spd,y,obj_npc)) //if there is an obj_npc directly RIGHT of the player
    {
    create_textbox(obj_npc.text_id); //create a textbox using that NPC's text_id
    }
    break;
    ....}
    This, as you can imagine, does not work the way I intended. It does not pass that particular NPC's text_id to the create_textbox function.
    I tried setting it up similar to what was in the obj_speak_block Step event using (create_textbox(text_id);), but I get an error because it is trying to read the obj_player's text-id, which it does not have.
    I am not sure how to pass the obj_npc's text_id to the create_textbox function.
    Again, I (and I am sure everyone else) really appreciates your efforts in making these.
    EDIT:
    I was able to solve my problem. Instead of using the place_meeting(), I used the instance_place(), as it returns an instance's ID (while place_meeting() does not).
    Just in case anyone else would like to do the same thing, here is the basic code I used to be able to press a button ('f' in this case) and talk to an NPC:
    if(keyboard_check_pressed(ord("F")))
    {
    switch(face)
    {
    case RIGHT:
    var inst_npc = instance_place(x+move_spd, y, obj_npc); //get the instance id of the obj_npc and store it in the inst_npc variable
    if(inst_npc != noone) //check if someone is there (or that nobody is not there)
    {
    create_textbox(inst_npc.text_id); //if someone is actually to the RIGHT of the player, create the textbox
    }
    }
    }

    • @peytonburnham4316
      @peytonburnham4316  3 года назад +8

      Nice job figuring this out! These videos are intended to be supplementary to your own work so it really makes me happy you were able to apply this to your own system!

    • @erraww
      @erraww 3 года назад

      Cool system! 👏👏
      (if someone needs it, here is full: )
      if(keyboard_check_pressed(ord("F")) && !instance_exists(oPlayerFreezer)){
      switch(face){
      case RIGHT:
      var inst_npc = instance_place(x+movesp, y, oTbTrigger);
      if(inst_npc != noone){
      create_Textbox(inst_npc.text_id);}
      break;
      case LEFT:
      var inst_npc = instance_place(x-movesp, y, oTbTrigger);
      if(inst_npc != noone){
      create_Textbox(inst_npc.text_id);}
      break;
      case UP:
      var inst_npc = instance_place(x, y-movesp, oTbTrigger);
      if(inst_npc != noone){
      create_Textbox(inst_npc.text_id);}
      break;
      case DOWN:
      var inst_npc = instance_place(x, y+movesp, oTbTrigger);
      if(inst_npc != noone){
      create_Textbox(inst_npc.text_id);}
      break;}}

    • @garburias
      @garburias 2 года назад +1

      I tried to use it but it said
      ERROR in
      action number 1
      of Step Event0
      for object obj_speakblock_test_button:
      Variable obj_speakblock_test_button.face(100040, -2147483648) not set before reading it.
      at gml_Object_obj_speakblock_test_button_Step_0 (line 3) - switch(face)
      ############################################################################################
      gml_Object_obj_speakblock_test_button_Step_0 (line 3)
      Where do I need to set "switch(face)" at though?

    • @garburias
      @garburias 2 года назад +2

      Alternative method
      var _s = id; //just like what Peyton said in the video
      if place_meeting(x,y, obj_player) //so we can use our player object to collide with the text object itself
      && keyboard_check_pressed(ord("Z")) //you can use any button that you want to use, but in this case I want to use "Z" button
      {

      with( instance_create_depth(0, 0, -9999, obj_textbox))
      {
      scr_game_text(_s.text_id);
      }
      }
      //the rest is identical to the video
      I'm not that good with English though so you may have a hard time to understand on what I'm trying to say here.

    • @MasterSasori
      @MasterSasori 2 года назад +3

      What if i want to use the same KEY to speak with the "speakblock" and flip pages and so prevent that pressing the interaction key during the dialogue may cause some bugs? What happens is a bit weird because every time you press the button a new texbox may appear ,i've tried to do so only if an instance_exist of a Textbox and its partially ok but when i get to the option its just bugs out..
      I've tried something like this in the step event of the speakblock, where is_txbt_open = instance_exists(obj_textbox);
      if place_meeting(x,y,obj_player) & keyboard_check_pressed(ord("Z"))
      {
      if !is_txbt_open
      {
      dir = obj_player.face;
      create_textbox(text_id);
      }
      }

  • @RedStrings
    @RedStrings Год назад +15

    this man is the Bob Ross of coding

  • @season-null
    @season-null 4 месяца назад +4

    Wow. For anyone stuck on the text_x_offset not being set..... make sure you remove the textbox object from the room.... I didn't realize he deleted it at 4:36

    • @eogabs_
      @eogabs_ 3 месяца назад

      lol, same

  • @Livonade
    @Livonade 2 года назад +14

    Love you videos, man! Never change the background music for these tutorials, it never fails to put me in a relaxed coder mood.

  • @imjujubells
    @imjujubells Год назад +17

    For anyone having problems with the very first text box not typing out but every other box until you select a new option, I have the solution!
    In your "Flip through the pages" section, after the "If not done typing" section to this:
    //* If not done typing
    else if draw_char != text_length[page] && draw_char > 1
    {
    draw_char = text_length[page];
    }
    It took me awhile to find the solution and have been pulling my hair out over it lol, but it fixed it for me!

    • @badSynth
      @badSynth Год назад

      thank you!!!

    • @DelphineEraklea
      @DelphineEraklea Год назад

      this works over depth issue in the comment below at least for me

    • @Glitchof2003
      @Glitchof2003 Год назад

      you are AMAZING, thank you so much for this

    • @johntitor107
      @johntitor107 Год назад

      Thank you some much

    • @viperizer0
      @viperizer0 Год назад

      YOU SAVED ME SO MUCH TIME THANK YOU SO MUCH

  • @koolgool
    @koolgool 2 года назад +18

    Not sure why, but after I select a dialogue option the follow-up dialogue box instantly fills out its text. The following boxes progress as normal, though.
    EDIT: Solution found! You need to make sure when you create the new textbox with the instance_create_depth function that the depth is the same as what you set in the Textbox object itself. If it's different, for some reason unknown to me, the text won't type out properly.

    • @beep6510
      @beep6510 2 года назад +2

      THANK YOU SO MUCH FOR THIS IT WAS KILLING ME TOO TRY TOO FIND OUT WHAT WAS WRONG 🙏🙏🙏🙏

    • @Shot666
      @Shot666 Год назад

      thank you jeeeeeeezzzzzzzzzzzzz

    • @TheCListerz
      @TheCListerz Год назад

      THANK YOU i've been confused for literally months!!!! 😭

    • @NotserpHrrib
      @NotserpHrrib Год назад

      Thank you so much I was about to spend the next 2 hours trying to fix what I thought was it getting the space input again somehow. You are a lifesaver

  • @pedrohenriquegardinallidel6608
    @pedrohenriquegardinallidel6608 3 года назад +8

    I"m having a big problem text_x_offset not set before reading
    pls somebody help me

    • @alwaysonward
      @alwaysonward 3 года назад +3

      I got that issue too. I'm on v2.3.4. I ended up putting this line in the create event of the textbox object and it seemed to fix it:
      text_x_offset[0] = 0;

    • @mersonkrazyTV
      @mersonkrazyTV 2 года назад

      @@alwaysonward Where did you put it in the create event? Because I tried putting it there in multiple places and it only makes a blank text box

    • @alwaysonward
      @alwaysonward 2 года назад

      @@mersonkrazyTV towards the end I think, I don't think it should matter as long as you put it in that event, maybe your issue is somewhere else then

    • @SpicySpeg
      @SpicySpeg 2 года назад

      @@LUISSKSOUZA I had the same issue, had to look thru my code for 20 minutes to find a minor typo

  • @lightd2471
    @lightd2471 3 года назад +15

    Amazing, I cant wait Rose of Starcross to be released

  • @drizzlysunny382
    @drizzlysunny382 2 года назад +8

    Oh my gosh. I literally was fumbling the bag with how i could not figure out for the LIFE OF ME how to set up branching dialog. I've watched a few of your tutorials before, and honestly, as someone with ADHD and a really short attention span, I found myself actually following along (if only I could do that in school) with what you were saying, and how you were saying it made so much sense! You are literally the only reason I know how to move around GMS 2, so uh, thanks for that!

  • @kittycitykat
    @kittycitykat Год назад +5

    By the way! If anyone is looking to make an animated arrow, what you need to do is similar to the textbox. You need to create two variables ex: Arrow_img = 0; , arrow_img_spd = (your fps) / 60. Then when you make your arrow you type this:
    if option_pos == op
    {
    arrow_img += arrow_img_spd;

    draw_sprite((your arrow sprite), arrow_img, _textb_x, _textb_y - _op_space*option_num + _op_space*op);

    }
    This will make your arrow animate. (At least for me it does lol.)

    • @bey7668
      @bey7668 7 месяцев назад

      thx

  • @luckydrago5420
    @luckydrago5420 2 года назад +7

    question, so ive finished this tutorial(which is SO GOOD THANK YOU), but i was wondering if you can make selecting a certain option and setting a flag true to give quests and progress story?

    • @sledge1693
      @sledge1693 2 года назад +4

      i would add a global variable that says whether or not a quest is active, then make it true in the case thing.

  • @creepary6856
    @creepary6856 3 года назад +6

    Hey pey! I hope all is well: D
    I have a problem, which can be easily solved, but I don't know how to do it haha.
    When in the Create event of the text box I put text [0] = ""
    every time I enter into a dialogue with someone, I have to press Enter before they speak (obviously because the "" means that it has nothing to say)
    But I want this not to happen, and enter the dialogue directly. How can I achieve this?

    • @creepary6856
      @creepary6856 3 года назад +2

      ​@LiterallyNick Yeah, I know, but if I do this, In every npc that I can speak, would appear that text

  • @mcdaysalive6586
    @mcdaysalive6586 2 года назад +3

    So I just somehow corrupted my entire project, removing all the code from the game including my player, walls, backgrounds, etc. Easily 10+ hours of work gone. No idea how to recover it. I am absolutely devastated. I think it's because I had a "backup" file inside my game file thinking I was being clever. I cannot stress enough that you should avoid this pitfall or risk losing a lot of work.

  • @mersonkrazyTV
    @mersonkrazyTV 2 года назад +9

    These have been a fantastic help and have really given me thr motivation to make games, I can't wait to see more!
    I'm having a small problem though- when I click on the speakblock with the options it shows an error that says "text_x_offset not set before reading it", I can't seem to figure it out and I've really been stuck, if anyone knows how to help I'd greatly appreciate it:)

    • @Quentin94
      @Quentin94 2 года назад +1

      I'm having the same issue. Someone below said they fixed it by putting text_x_offset[0] = 0 in the create event for the textbox.

    • @mersonkrazyTV
      @mersonkrazyTV 2 года назад

      @@Quentin94 In the create event for the textbox or text? Because I'm not sure which place it should go, it seems like putting text_x_offset[0] = 0 alongside text[0] = "" would make more sense, at least to me

    • @feverdelta5335
      @feverdelta5335 2 года назад +1

      Hey I found your reason! Look in your gametext script. Its an error in the case your linking your option too. Make sure the link Is the same when your setting up.options.

    • @mersonkrazyTV
      @mersonkrazyTV 2 года назад

      @@feverdelta5335 I'll try that, thanks!

    • @heroflame4588
      @heroflame4588 2 года назад

      @@mersonkrazyTV Hey did it work out for you? Because I'm having the exact problem as you and I don't know what to do.

  • @techman9514
    @techman9514 3 месяца назад +1

    So if you try to make a dialogue option end the conversation, you get an error message. Is there a way around this?

  • @kallenamos1085
    @kallenamos1085 2 года назад +4

    I like this video series for the most part, but given a lot of your tutorials feed into the next tutorial series, you might want to be more careful with your variable naming. I know for a fact "option" is used in a different video as I already had one set up prior to this. In fact, if you watch carefully, you already have it assigned as well, as it comes up in the auto-complete box.
    On an unrelated note, I REALLY wish more of your tutorials had mouse support implemented, not a lot of modern games (but particularly RPGs, which was your initial selling point for these tutorials) just use keyboard inputs for everything.

    • @lunastifaliamusic
      @lunastifaliamusic Год назад

      It's because RPGs originated on consoles and they use a layout similar to that of a keyboard where you select things through an option bar that locks onto something until you select another option, so this is mainly for making retro-styled games. It also let's us stay within the keyboard at all times since movement and interactions usually happen with the arrow and z keys. It would be awkward to have to switch to our mouse when selecting an option.

  • @r1arr
    @r1arr Год назад +3

    ERROR in
    action number 1
    of Draw Event
    for object obj_textbox:
    Variable obj_textbox.text_x_offset(100041, 0) not set before reading it.
    at gml_Object_obj_textbox_Draw_0 (line 75) - var _txtb_x = textbox_x + text_x_offset[page];
    ############################################################################################
    gml_Object_obj_textbox_Draw_0 (line 75)

  • @_bubblezzzzzz_
    @_bubblezzzzzz_ 2 года назад +7

    Great explanation and easy to understand. You truly are a great teacher. Thanks!

  • @PlaceHolderGuy
    @PlaceHolderGuy 2 месяца назад +1

    9:00, i got a error
    ___________________________________________
    ############################################################################################
    ERROR in
    action number 1
    of Draw Event
    for object obj_textbox:
    global variable name 'font_main' index (100033) not set before reading it.
    at gml_Object_obj_textbox_Draw_0 (line 12) - draw_set_font(global.font_main);
    ############################################################################################
    gml_Object_obj_textbox_Draw_0 (line 12)

    • @dramaticcheese_
      @dramaticcheese_ 2 месяца назад

      I got that error too idk how to fix it

  • @viperizer0
    @viperizer0 Год назад +2

    Hey, I’m trying to get it to where the textbox remembers whether or not you have interacted with it or not and says something different. Does anyone have any idea as to how to do this because I have been fiddling with it for a bit and don’t feel any closer. I’m thinking of making a function that rings up as true or false but I’m not sure where to go from there. Any advice would be appreciated!!!

  • @sahya3577
    @sahya3577 Месяц назад +1

    Hello i have a question about dialogue tutorial
    I have a problem if i press on the obj_speakblock when dialogue is going and you press on that block again the last word will repeat as long as long as you press on obj_speakblock

    • @kakyoindonut3213
      @kakyoindonut3213 28 дней назад

      you probably already solve this but before doing the instance_create_depth make sure to check using instance_exist(textboxt obj) to check if you already running the textboxt and prevent doing instance_create_depth if you already does

  • @ZDubbz
    @ZDubbz 5 месяцев назад +4

    For people trying to make this look like undertale, the options code needs to be at the bottom, that way the text will draw above the textbox

    • @tntaro
      @tntaro 5 месяцев назад

      Do you know how to use the same code for the dialogue options without using the scripts and just putting every dialogue in the object? (Yes i want my life to be harder)

    • @ZDubbz
      @ZDubbz 5 месяцев назад

      @@tntaro Im pretty sure he explains it earlier in the video, using the text[0] array manually does the trick. You'll have to change the final code a bit tho

    • @tntaro
      @tntaro 5 месяцев назад

      @@ZDubbz yeah i'm trying to understand how do I create the options even if didn't made the script dialogue

    • @ZDubbz
      @ZDubbz 5 месяцев назад

      @@tntaro dunno m8

    • @tntaro
      @tntaro 5 месяцев назад

      @@ZDubbz T-T

  • @janmilewski7111
    @janmilewski7111 Год назад +2

    I have this problem, I wanted to make it so that the textbox appears when the player walks into some kind of trigger, but when I try to do that, it doesn't show up
    EDIT: I solved it, I was using "position_meeting()" instead of "place_meeting()"
    EDIT 2: I have another problem, I want to change the rooms right after the dialogue ends, but when it does, it loops back.

  • @ZeroTheHyena
    @ZeroTheHyena Год назад +3

    EDIT: To anyone else having this problem, put your obj_speakblock in another room. For some reason, putting it in the rm_test_dialogue room makes it bug out. No idea why, but the system works flawlessly in ANY OTHER ROOM. At least, it does for me. Hope this helps. I've spent hours trying to work this out! xD
    Hey, love your tutorials! I'm having a bit of an issue with my option arrow. I've been following along really closesly, but with the "draw_sprite(spr_textbox_arrow, 0, _txtb_x, _txtb_y - _op_space*option_number + _op_space*op);" part, it seems my arrow duplicates itself instead of scrolling up and down, and it doesn't disappear. Does anyone know what I might have done wrong? Like, the arrow starts off just fine (as a single one highlighting an option) but when it moves to the next option, instead of just moving down, it makes another copy of itself below instead and it doesn't get deleted if you move back up to the first option.
    Kind of weird. It's probably a simple error, but I can't figure it out for the life of me.

    • @Ghajlalalala
      @Ghajlalalala Год назад +1

      lmaoooo the first issue you had literally happened to me dude

    • @MonkeStumps
      @MonkeStumps 9 месяцев назад +2

      Ever figure this out?
      Edit: Just figured this out. I didn't have a background on my room, and so the sprite was "cooked" into the background, but wasn't actually there.

  • @BonytoBeastly
    @BonytoBeastly 10 месяцев назад +1

    Whoa, that caterpillar climbing the wall in your game is amazing. How'd you get it to bend without the outlines overlapping?

  • @cobiejohnson6017
    @cobiejohnson6017 2 года назад +3

    I know this won't be answered probably but I'm still going to ask, the type writer effect works perfectly for the normal text, but after clicking an option the first string/page is displayed instantly without, but then the rest have the type writer effect. I refollowed the tutorial completely and it's still doing this, so I don't know what the problem is, I think he skipped something by accident. If I find a solution, I'll post it here.
    (FIX FOUND) EDIT:
    And just like that, a few minutes later, I found a solution to a problem that I probably would have never figured out on my own and saw someone offhanded mention here in the comments. The reason why this happens is because the depth the NEW TEXTBOX CREATED BY SELECTING THE OPTION is created at a DIFFERENT DEPTH from the original. Under "scr create_textbox" in "instance_create_depth", the depth stated there after X and Y MUST BE THE SAME AS THE DEPTH (or "lower" than it, ex original is -10000 new is -9999) UNDER THE CREATE EVENT FOR THE ORIGINAL TEXT BOX or else it will skip doing the type writer effect for the first line for some reason. I have no idea why this is, an explanation would be cool, but I doubt I'd ever get one.

    • @koolgool
      @koolgool 2 года назад +1

      Thanks a million, friend. I would have NEVER figured that out.

    • @softenlive5421
      @softenlive5421 Год назад

      THANK YOU I HAD THE SAME PROBLEM AND YOUR COMMENT SAVED ME

  • @ravenknepp
    @ravenknepp Год назад +1

    Man i love how this looks. But please help. I got the system from the first vid working by adding a step event and setting text_lenght[page] = string_length(text[page])
    Since it just refused to update text_length through the draw event.
    It worked untill i
    Added in the options from here now same issue even with the step event.

  • @ApolloDawn85
    @ApolloDawn85 3 месяца назад +1

    Idk if its the same issue for everyone, but if "text_x_offset not being set" is your error. Make sure that the case "name" in your scr_game_text is the same as the text_id in the Creation Code of you speakblock object! If you change one and forget the other the game will crash.

    • @dramaticcheese_
      @dramaticcheese_ 2 месяца назад

      Heyy would you know how to fix this error
      ###########################
      Error in action number 1
      of Draw Event for object obj_textbox:
      global variable name 'font_main' index (100026) not set before reading it.
      at gml_Object_obj_textbox_Draw_0 (line 12) - draw_set_font(global.font_main);
      ###########################
      gml_Object_obj_textbox_Draw_0 (line 12)
      my game isn't working because of this :')

  • @郭大侠-j7x
    @郭大侠-j7x 3 года назад +3

    thanks your video is really good.. i love you man

  • @danielfoutz
    @danielfoutz 2 года назад +3

    Is the music in these videos from your game? I'm into it wherever it's from.

    • @peytonburnham4316
      @peytonburnham4316  2 года назад +3

      Yep its stuff ive written! Thanks!

    • @poopoopeepee8560
      @poopoopeepee8560 22 дня назад

      @@peytonburnham4316 Same, after working through the tutorial, I'll have it stuck in my head all day! Good loop!!

  • @everydaygremlin
    @everydaygremlin Год назад +2

    I, and probably some other people, kept getting the error "Variable Index [1] out of range [1] - -1.option(100044,1)" and i personally was stumped on it for a while, as other's solutions for it (adding "page_number = 0" inside the textbox's setup loop) didn't work, as I had the pauser object as a parent of the textbox, but I found that the actual error comes from scr_textbox_functions.
    For some reason, GMS2 sets an argument inside of a created function to a *local variable*, so it spits out an error because it's not sure what "option" is as it is a local variable to the textbox_functions script, and therefore the textbox draw event cannot access it. I fixed this error by changing "option" inside "function scr_option(option, _link_id" to "optio" (i just took the n off) and adding "option[option_number] = optio"underneath "option[option_number] = option" (if you don't add the line of code, your option text is replaced with "Warning: Recursive array found"
    I hope this helps someone! (this took like 2 days and many rewatches and rereads of my code to fix) (Edit:spelling)

    • @natk1530
      @natk1530 Год назад +1

      THANK YOU i was stuck on this foreverrrrrrrrrr

    • @Ghajlalalala
      @Ghajlalalala Год назад

      ilysm

  • @JTG448
    @JTG448 3 дня назад

    advice: DOUBLE TRIPLE QUADRUPLE CHECK YOUR BRACKETS.

  • @wolfpawlicki7987
    @wolfpawlicki7987 Месяц назад

    please someone help me my brain is melting
    ############################################################################################
    ERROR in action number 1
    of Draw Event for object obj_textbox:
    trying to index a variable which is not an array
    at gml_Object_obj_textbox_Draw_0 (line 96) - var _o_w = string_width(option[op]) + _op_bord*2;
    ############################################################################################
    gml_Object_obj_textbox_Draw_0 (line 96)
    I have no idea what I did to cause this, I made it all the way to adding the arrow to the menu when I got this error.

  • @markslender7262
    @markslender7262 2 года назад +1

    Thank you so much,you helped me a lot !!!!
    but i have an issue with my textbox : if i place the same speak block object to different room nothing appearing but it works well on the test room,i did the same thing but not drawing textbox or anything if someone knows something about this issue please help...

  • @feverdelta5335
    @feverdelta5335 2 года назад +3

    I deeply appreciate your work and videos! This was extremely helpful!
    The only thing I have to say is that I keep getting the error of "text_x_offset not set before reading it. But it's set as text_x_offset[p] = 44.

    • @feverdelta5335
      @feverdelta5335 2 года назад

      I found the reason lol nvm

    • @Pootzauk
      @Pootzauk 2 года назад +1

      @@feverdelta5335 share your knowlage mister

    • @Seth069
      @Seth069 2 года назад

      please i have the same problem and i have tried to fix it since yesterday
      what did you do about it?

    • @feverdelta5335
      @feverdelta5335 2 года назад +1

      Look in scr_gametext. Its an error in the case you're linking your option too. Make sure the link Is the same when your setting up options.

    • @kyh_senpaiowo
      @kyh_senpaiowo 2 года назад

      @@feverdelta5335 Oh thank god I was having the same problem. I didn't notice that the names didn't match, now it makes sense, thank you for explaining!

  • @Khris-gamin20
    @Khris-gamin20 Год назад +1

    Dude i need help, when i finished the options system and i tried to run the game. It gives me a fatal error that says local variable o(100038) not set before reading it. The error occurred at this line: if (op_pos == o) {
    draw_sprite(spr_pointer, 0, tb_x, tb_y - op_space*op_num + op_space*o);
    }
    (o means op)
    Can you tell me how to fix this.

  • @dramaticcheese_
    @dramaticcheese_ 2 месяца назад

    Can anyone help with this error I'm getting?
    ###########################
    Error in action number 1
    of Draw Event for object obj_textbox:
    global variable name 'font_main' index (100026) not set before reading it.
    at gml_Object_obj_textbox_Draw_0 (line 12) - draw_set_font(global.font_main);
    ###########################
    gml_Object_obj_textbox_Draw_0 (line 12)
    Please help my game isn't working because of this :')

  • @Xarr0w_
    @Xarr0w_ 3 года назад +2

    does anyone know how to fix the option text section to not be out of range. "Variable Index [2] out of range [2] - -1.option(100008,2)" i think its the op variable but no matter what i do its broke. but great vid :]

    • @CharlesThompsonBusyProgrammer
      @CharlesThompsonBusyProgrammer 2 года назад +2

      The scr_text is modifying the current page you are on. Inside your setup if block, in the draw method, right before you say setup=true, add page_number = 0, and I believe that will get you back to good.
      The above is semi-accurate up until the four-minute mark. I ran into the same problem, and that's how I fixed it.

    • @Tom-fw2ls
      @Tom-fw2ls 2 года назад

      Seems like your (draw option text) function isnt contained in the for loop, might be sitting just outside by accident

  • @antoniosanchez3370
    @antoniosanchez3370 2 месяца назад

    Excuse me but I have a problem when adding the scr_option at minute 18:14 in which I get an error that cannot be solved because supposedly I have set everything correctly but it does not come out correctly. In gamemaker the error is the following: E ​​GM1041 The type 'String' appears where the type 'Array' is expected. scr_game_text 11:20

  • @Shesterz
    @Shesterz 23 дня назад

    Can someone help me with my code? because I don’t understand anything, everything seems to be written as in the tutorial, but when activated, the code still gives errors, and if I somehow patch them, other errors appear :(

  • @PocketDeerBoy
    @PocketDeerBoy 3 месяца назад

    Does anybody else just get completely stuck at the for loop under //draw the options? I swear i've been copying this exactly (except for some more personally readable naming conventions) and i've double and triple checked everything for ages and it's not working. It's not drawing any textboxes or anything else i tell it to draw as a test. I looked into how for loops are supposed to work and everything. I think possibly the problem area is the option_number variable? Where is that being set to how many options are in that array? I'm very very confused.

  • @eidy9352
    @eidy9352 2 года назад +1

    Hello, i'm having a small problem. When i build the game, a random textbox without any text appears. I know i need to remove some code, but i dont know which. Can someone please help?

    • @peytonburnham4316
      @peytonburnham4316  2 года назад +4

      Hey you probably just have a blank textbox object sitting in your room from when you were testing it, just take it out!

  • @kakyoindonut3213
    @kakyoindonut3213 29 дней назад

    I just looked up undertale source code and toby fox did exactly this except he uses a global message variable instead of a function that fill the text

  • @Ghajlalalala
    @Ghajlalalala Год назад +1

    hey so in part, you put a bunch of text[0] = , text [1] =, etc... now, with the new script, even though I put in scr_text = "", the text[0] list from the create event of obj_textbox only shows up. if anyone could help that'd be awesome
    edit: i got rid of the words after text[0] but now nothing shows up in the box :/
    EDIT AGAIN: Ok so I got it to work EXCEPT for the very first line, this line shows up blank for some reason. I think it's because in the create event, it thinks text[0] = "" means the text that should be shown initially is " " and therefore skips the first line of text. idk how to fix so :^|
    FINALE! I GOT IT TO WORK!!! for some reason, it works in every single room except the dialouge testing room?? whateva i did it!!!

    • @oliviaforler6360
      @oliviaforler6360 3 месяца назад +1

      Hey! having the same problem, how did you fix it?

  • @Tylerl128
    @Tylerl128 2 года назад +2

    every thing is working besides the text isnt showing in the options text boxes.....

  • @Punkers_
    @Punkers_ 2 месяца назад

    Hiya im having an issue where everything works except going to a branched dialogue option the first option will always work but the second and above options will return a blank textbox with a lone "0"

  • @A-K-12
    @A-K-12 3 года назад +1

    When I but obj textbox in the room it came up with an error maybey if you know what's happening you could help?

  • @daka.notatp
    @daka.notatp Месяц назад

    10:52 if you use the keyword “other” it serves the same goal, it refers to the id of the entity who is excecuting the code instead of the one inside the with() parameter

  • @hunterscrazychannle
    @hunterscrazychannle 4 месяца назад

    I would like to draw the options inside the main textbox, underneath the text. This would make players more likely to wait and read the text before answering the NPC and also looks better in my opinion. I am going to try and solve this on my own but if anyone has any advice please let me know.

  • @mismatchingshoes5249
    @mismatchingshoes5249 2 месяца назад

    i am confused because if i go into actual creation code (from double clicking on the textbox object) then the scr_text works but if i do it it a with loop it said the string is an error and it crashes my game can someone help me
    edit: i fixed it it was a different error that i was running into

  • @TomiPercsi
    @TomiPercsi 2 года назад +1

    Any support for Mouse Detection on the branching dialog? My brain is stumped at this point.

    • @sillylittleboy6361
      @sillylittleboy6361 Год назад

      this is probably super late, but what i did was i set my accept key variable (top of the draw event for obj_textbox) to this :
      accept_key = keyboard_check_pressed(vk_space) || mouse_check_button_pressed(mb_left);
      this lets you click anywhere on the screen, and the pages will flip.

  • @9mmak9
    @9mmak9 Месяц назад

    how can i make an Interaction Button plzz help me when i walk up to the npc the textbox jus pops up

  • @ulebule9850
    @ulebule9850 2 года назад +1

    hey so i got problem that i dont know how to solve i tried everything and it doesent work. Could someone please give obj_textbox draw event script? i am literally begging for this

    • @ItsMe_Victor
      @ItsMe_Victor 2 года назад

      well, you gotta pay for it in the patreon

  • @toastedwalnut
    @toastedwalnut 2 года назад +2

    ive been learning so much tysm for these! its such a good intro for gml

  • @mzrw2096
    @mzrw2096 2 месяца назад

    is there a way to have a voice-over for these dialogues? Like it would be the same as the typing text effect itself but audio?

  • @BBQ_Ch1cken
    @BBQ_Ch1cken 2 года назад +1

    I’m having an issue where the first text box after selecting the option doesn’t draw the text but just has the full text box. Any ideas on how to solve that?

    • @Klasenss
      @Klasenss 2 года назад

      ruclips.net/video/6Bzj7GdSkJI/видео.html bro did you check this screen, I was having the same issue and I didn't have each variable set and declared.
      function scr_option(_option, _link_id)
      {
      option[option_number] = _option;
      option_link_id[option_number] = _link_id;
      option_number++
      }

  • @SouryaLeFunentoi
    @SouryaLeFunentoi 2 года назад +6

    I really like this system, it works great! But I have a little problem with a parameter that I would like to add in my game, but I can't implement it :/. How can I execute a script or change the value of a variable when I reach a page or a textbox ?
    I hope you understand what I'm talking about XD,
    Thanks a lot !

    • @Dorpato111
      @Dorpato111 8 месяцев назад

      a litle bit too late but, did you ever find the solution?

    • @SouryaLeFunentoi
      @SouryaLeFunentoi 8 месяцев назад

      @@Dorpato111 Sup, it sure has been a while lol.
      To answer your question, I could think of a solution right now, it might work.
      If you have any problems, you can tell me !
      First of all, you initialise this value in your create event :
      pageScr[0] = -1;
      Then, you can add this to the scr_text :
      function scr_text(_text, _scriptPressEnter) {
      text[page_number] = _text;
      pageScr[page_number] = _scriptPressEnter;
      page_number++;
      }
      Finally, you can go back into your Draw event in your obj_textbox :
      if (accept_key) {
      if (draw_char == text_length[page]) {
      if (pageScr[page] != -1) pageScr[page];
      if (page < page_number-1) {
      page++;
      draw_char = 0;
      }
      } else {
      instance_destroy();
      }
      }
      Basically, it checks if the player press enter when the text is fully drawn, in which case its going to trigger the script that you created !
      You can use it like that :
      scr_text("Hello everybody !", function() {game_end()});
      In this case, the game will close when you press enter at the end ! You can put -1 if you don't want any scripts to be executed.
      Tell me if it works for you!
      Sorry for my english, it is not my first language haha

  • @shaneduquette
    @shaneduquette 10 месяцев назад +1

    These tutorials are incredible. Thank you!

  • @ryanyoung8010
    @ryanyoung8010 2 года назад +1

    EDIT: FIXED. Turns out my code was a little messed up. I originally had it set where every time a player presses F it activates the text box, so I ended up having a place_meeting with obj_player instead. All works like charm now.
    Hello, thanks for putting this up but I've been experiencing an issue with it, for some reason, whatever text I put into the text_id in the creation code of my speakblock gets globalized to every single textbox that gets created, regardless of what the individual text_ids say, or even whether there is a text_id in the instance's creation code. It even applies to other objects. Not sure what's going on but I've been stuck since Friday =)

  • @angrysoybeanfarmer3453
    @angrysoybeanfarmer3453 3 года назад +2

    at last ... peyton tutorial part 2

  • @matt.137
    @matt.137 2 года назад +1

    hey, i added in the code for the speak block, but when i click on it, the textbox is created as a complete blank instead of reading “Hi, im an Npc”, and when i press z it skips to the next line
    not sure what happened but ive gone through multiple times and still don’t understand what I did

  • @Tomin8r97
    @Tomin8r97 Год назад +1

    Loving these tutorials so far! I am running into a problem though, for some reason none of my responses are generating. Nothing is erroring out, so I didn't break anything, but it's behaving as it was before any options were implemented. I'm currently combing back through, I'll edit this with what I missed when I find out!
    EDIT: Found part of it! I had missed the optionNumber++; portion, so my option number was never changing. I'm still only getting the first option to appear, seemingly with no textbox and overlapping my main textbox, but progress is progress! I'll adjust my values to get a clearer look at it

  • @scootie_scoot
    @scootie_scoot 8 месяцев назад +1

    for some reason, after the last string of dialogue, if i press my accept key (space bar in this instance), it doesnt destroy the text box, but instead keeps looping the last line. anyone else having this problem or know a solution??

    • @scootie_scoot
      @scootie_scoot 8 месяцев назад

      edit: i figured it out! basically i used space bar for both my accept key and trigger key, and this code wasnt compatible with that. I changed my "trigger dialogue" key to shift, and everything works fine. I would like to have them both as "Z" or something though...

    • @scootie_scoot
      @scootie_scoot 8 месяцев назад

      update again: I'm definitely having troubles with the "flip through the pages" section of my draw event in my textbox object. It might be an issue with the page number counter inside the code and the page number counter in the script? Either way, it has a bug where it loops through certain strings, especially if the player is spamming the "accept key"

    • @catalinacerda5723
      @catalinacerda5723 8 месяцев назад +1

      I'm having the exact same problem! I still don't know the answer, but I asked in a page so I'll tell you if I find a solution :33

    • @catalinacerda5723
      @catalinacerda5723 8 месяцев назад

      forget it, everyone threw me shit in the page for being a newbie, IDK how to solve it :/

    • @catalinacerda5723
      @catalinacerda5723 8 месяцев назад +1

      look@@scootie_scoot, I technically fixed it but idk how, I just deleted the script and wrote it again, and it magically worked out

  • @roenais
    @roenais 27 дней назад

    really easy to follow tutorial! this is probably a long shot on an old video, but does anyone know how to make it so you can select options with mouse? trying to frankenstein in code from other tutorials keeps breaking things for me.
    edit: figured it out, jut had to move all the option selection code into the same area as the option box sizing so i could reference the variables!

    • @WispyVee
      @WispyVee 18 часов назад

      hey! any chance you could tell me exactly how you did this? im going through this exact same conundrum x.x

  • @psychopomp4135
    @psychopomp4135 Год назад +1

    This tutorial has mostly worked so far, but I’m currently experiencing an issue where certain text boxes (mainly the first one that pops up) appear without the typewriter effect. Do y’all have any suggestion on how to fix this?

    • @ruben.v4
      @ruben.v4 9 месяцев назад +2

      Did you end up finding a fix for this? I'm having the same problem :(
      Edit: Scrolled down 7 comments to @imjujubells 's comment. Here's the solution if you still need it:
      In your "Flip through the pages" section, after the "If not done typing" section to this:
      //* If not done typing
      else if draw_char != text_length[page] && draw_char > 1
      {
      draw_char = text_length[page];
      }

  • @happy_havok
    @happy_havok 2 года назад +1

    Hey so question. I'm about 12 minutes in, and for some reason, the first line of text that appears just appears, no typing effect. Then the second page of it will do the typing effect. Also any textbox that's left blank will not pop up. It will flicker into existence for just a moment, before being claimed by the void once more. Anyone else having this issue, or know what I did wrong?

    • @68kbeats
      @68kbeats 2 года назад +1

      i have this exact same problem

    • @cobiejohnson6017
      @cobiejohnson6017 2 года назад

      @@68kbeats @HappyHavok
      I found the solution, it has to do with the depth you set under scr create_textbox, if it isn't the same as the depth in the create event of the obj_textbox (or "lower", like if the obj_textbox depth is -10000 and create_textbox is -9999) it'll instantly display the first line for some reason.

    • @psychopomp4135
      @psychopomp4135 Год назад

      @@cobiejohnson6017I’m having the same problem and tried to do this by setting the depth of obj_textbox to -9999 and scr_create-textbox to -9999, but it didn’t work for some reason.

  • @Shifty_Playz
    @Shifty_Playz 2 года назад +1

    The options show up before the question someone please help

  • @mariotheundying
    @mariotheundying 7 месяцев назад

    I dont know what to do here
    I'm having the issue that when I set a global variable for the confirm buttons it doesn't work, but when I put the confirm buttons directly it works fine. To describe the problem a bit more in detail, when the dialogue ends it starts the dialogue once again at the same time for some reason, I even opened an old project and copy pasted literally everything to do with dialogue, the dialogue box and text didn't show up (it was an old version of another project) but judging by the text sound, the debug messages I put and the character actually being able to move afterwards, the dialogue DID end and didn't loop like in my main project, this confuses me, and it confuses me too how the global variable in the main proj. doesn't work but what's inside of the variable DOES work
    this is what i did:
    if (global.confirm_key && distance_to_object(obj_player) < 4)
    {

    if instance_exists(obj_textbox)
    {
    show_debug_message("Not created");
    }
    else
    {
    show_debug_message("Creating a new textbox instance");
    create_textbox(text_id);
    }
    }
    IT DOESN'T WORK
    BUT THIS
    if (keyboard_check_pressed(ord("Z")) && distance_to_object(obj_player) < 4)
    {

    if instance_exists(obj_textbox)
    {
    show_debug_message("Not created");
    }
    else
    {
    show_debug_message("Creating a new textbox instance");
    create_textbox(text_id);
    }
    }
    DOES WORK
    THIS is what the global is (i'm gonna remove the I most likely but not because of this, and yes having this whole thing in the previous code also works, not the variable tho)
    global.confirm_key = keyboard_check_pressed(ord("Z")) || keyboard_check_pressed(ord("I")) || keyboard_check_pressed(vk_enter);
    this global also flips through pages and initiates the text, tho i dont think that matters because it worked in the other project and because it also works when both are not set as global but as it's contents

  • @Yardomaster
    @Yardomaster 2 года назад +1

    I appreciate the admission that your implementations may not be optimal and that each person may need to adapt to specific needs. I've found the tutorial easy to follow so far, and I've been taking breaks in the middle of the videos (sometimes for hours) to iron out integration details particular to my game without getting lost.
    Also, your games look nice.

  • @Aireano80
    @Aireano80 2 года назад +2

    These tutorials have been great! But I do have one question, how would I make it so that I could interact with obj_speakblock with keyboard_check_pressed? Then proceed to make obj_player pause and face the direction of obj_speakblock? Thanks!

    • @mackenzieyang6380
      @mackenzieyang6380 2 года назад +1

      hey! I had the same problem and i put this in step event of my speakblock:
      var _s = id;
      if place_meeting(x +1,y +1, obj_player) && keyboard_check_pressed(vk_shift)
      {
      with( instance_create_depth(0, 0, -9999, obj_textbox))
      {
      scr_game_text(_s.text_id);
      }
      }
      if place_meeting(x -1,y -1, obj_player) && keyboard_check_pressed(vk_shift)
      {
      with( instance_create_depth(0, 0, -9999, obj_textbox))
      {
      scr_game_text(_s.text_id);
      }
      }
      Also, as for the pause, you just need to make the obj_textbox a child to the pauser. so press parent -> obj_pauser! (the pauser is from a different tutorial so if you've been following along with the series you'll know what i mean)

    • @Aireano80
      @Aireano80 2 года назад

      @@mackenzieyang6380 oh my god thank you so much 🙏🙏🙏

    • @mackenzieyang6380
      @mackenzieyang6380 2 года назад

      @@Aireano80 there's also a way to make the interact button the same as the textbox button without creating multiple textboxes! Lmk if ur also having a problem with that!

    • @Aireano80
      @Aireano80 2 года назад

      @@mackenzieyang6380 hey, the multiple textbox things are happening, think you can help me out with that? whenever i finish the text lines it just keeps repeating. sorry for asking for so much

    • @mackenzieyang6380
      @mackenzieyang6380 2 года назад +1

      @@Aireano80 no problem! happy to help because it took me like 2 full days to figure it out and gave me so much stress.
      basically all you need to do is to change the if statement so that it only works when the textbox does not exist. the fixed code goes like this.
      var _s = id;
      if place_meeting(x +1,y +1, obj_player) && keyboard_check_pressed(vk_enter) && !instance_exists(obj_textbox)
      {
      with( instance_create_depth(0, 0, -9999, obj_textbox))
      {
      scr_game_text(_s.text_id);
      }
      }

      if place_meeting(x -1,y -1, obj_player) && keyboard_check_pressed(vk_enter) && !instance_exists(obj_textbox)
      {
      with( instance_create_depth(0, 0, -9999, obj_textbox))
      {
      scr_game_text(_s.text_id);
      }
      }

  • @ruedischmuedi780
    @ruedischmuedi780 7 месяцев назад +1

    Hey, I need help.
    I changed some things, mostly related to how the speakblocks are "activated"
    Now for some reason the first line of dialogue doesnt have the typewriter effect of appearing letter by letter

    • @bey7668
      @bey7668 7 месяцев назад +1

      okay so if u search trough comments, someone found the solution to this
      In your "Flip through the pages" section, after the "If not done typing" section to this:
      //* If not done typing
      else if draw_char != text_length[page] && draw_char > 1
      {
      draw_char = text_length[page];
      }
      i didnt write this i found it in the comments

    • @drrigel63
      @drrigel63 2 месяца назад

      @@bey7668 you saved me lol thanks

    • @bey7668
      @bey7668 2 месяца назад

      @@drrigel63 yw

  • @isabellibukala9934
    @isabellibukala9934 5 месяцев назад

    i dont know why but after i put in the text id, the npc name, the textbox of the npc doesnt get the dialogue from the scr_game_text, it just repeat the text id name D: can someone help me?

    • @_slemm
      @_slemm 5 месяцев назад

      maybe you forgot to put "switch(_text_id)" in the scr_game_text script

  • @zouofzouey
    @zouofzouey 3 месяца назад +1

    This is a really great tutorial! You did a great job explaining everything! But just as a side note:
    For anyone like me who wanted a key press to interact with an NPC and the speak box object (As in RPG movement and if you get close to the NPC you can press a key and interact you just have to put:
    *keyboard_check_pressed(ord("E")) && distance_to_object(oPlayer) < 10*
    // 10 is how many pixels away from the object it has to be to work and oPlayer is just whatever your player character is or the object you are controlling.
    in the oSpeakBox step event instead of
    *position_meeting(mouse_x, mouse_y, id) && mouse_check_button_pressed(mb_left)*

    • @CalbDoesStuff
      @CalbDoesStuff 2 месяца назад

      love you bro, how would you make it so it only works if the player is facing the obj?

    • @dramaticcheese_
      @dramaticcheese_ 2 месяца назад +1

      Also works with *place_meeting(x, y, obj_player)* :D

    • @yousifadam3565
      @yousifadam3565 15 дней назад

      w mans

    • @pawemania5462
      @pawemania5462 6 дней назад

      I've got a problem with this: it ended up for me, with an endless loop of dialogue, when my character is within this pixel range - any idea how to solve that?

  • @OverSteam
    @OverSteam 8 месяцев назад

    a problem occurred with the options where if I pressed up or down, the option arrow disappears. (fixed it! Problem was 'option_pos = clamp...;' i accidentally put '+=' there instead of '=')

  • @Theshadowclaw3000
    @Theshadowclaw3000 2 года назад +1

    Hey good tutorial :) but I have one question... If I want something to happen, for example after reaching the last line of the dialogue, I want to destroy the object that is talking. How would I set this up ? kind of dont understand how to make use of the page numbers. Would be cool if someone can help me

    • @LUPHTIKUS
      @LUPHTIKUS 2 года назад

      Currently struggling with the exact same problem.. If there would be a way to find out when all text has finished drawing (including new textboxes that are created via the option boxes) that would be great, but I can't figure out how ;_;

    • @tottijoao
      @tottijoao 2 года назад +1

      @@LUPHTIKUS you already have a variable to know if the pages are over, that's how the textbox dissappears when the dialogue is over.

    • @lolfun7007
      @lolfun7007 2 года назад

      @@tottijoao Hes talking about the obj_speakbox, we want it to destroy after using it once.

  • @SJdarkdimensions
    @SJdarkdimensions 8 месяцев назад

    Hi, I need some help with scr_text. it is only playing one of the lines. I don't know what to do, I would appreciate some help, thanks.

  • @ThomasFoolery
    @ThomasFoolery 2 года назад +1

    how would I go about changing the arrows to select to options, to using my mouse cursor and selecting them?

    • @ivansosa6377
      @ivansosa6377 2 года назад +1

      if you ever get an answer to this, would you please let me know?

    • @ThomasFoolery
      @ThomasFoolery 2 года назад

      @@ivansosa6377 will do, though I rethought about it and decided I don’t want a mouse in my game due to it feeling like something in a web browser so I decided to go full keyboard controls

  • @Kal-zr6ql
    @Kal-zr6ql 3 года назад +1

    i can't seem to figure out on how the "draw options box" it just won't draw the box and i can't seem to find the solution
    .

    • @RedSW
      @RedSW 3 года назад

      Me too

    • @lop3436
      @lop3436 2 года назад

      me too

  • @spoopythings
    @spoopythings Год назад

    doesn´t work for me. The step part of obj_speakblock keeps saying that the create_ textbox is not set before reading it. After pasting in the code from the textbox instance_create_depth it still doesn´t work.

  • @jazzyfaye6976
    @jazzyfaye6976 9 месяцев назад

    At the part where you first use the switch case for npc 1 and text is only supposed to appear one the one talk box, my text doesn't appear on any of them? please help.
    Ii figured it out, i typed "npc_1" instead of "npc 1"

  • @plagueparchments
    @plagueparchments 2 года назад

    EDIT: SOLVED by putting //draw text before //-------options--------//!
    Hello! I don't know if anyone will see this, but I'm in a bit of a kerfuffle. The only text that shows up for me is the text on the last page, and after the typewriter effect is done. I've followed the tutorial exactly, to my knowledge. If anyone could tell me what I am doing wrong, that would be much appreciated! Thank you!

  • @yey5734
    @yey5734 7 месяцев назад

    These tutorials are amazing! great explanations! I actually understand what I'm doing for once ':) thank you so much!!

  • @AymenZero
    @AymenZero 2 года назад +6

    great tutorial! you are wayyy better at explaining things thann my teacher.
    by the way, how do i make the textbox activate whenever i interact with an npc/object and press z? i'm making an rpg, i've watched your rpg tutorial videos now i'm trying to add a dialogue system into my game.

    • @shukytime3231
      @shukytime3231 2 года назад +2

      In the first line of the obj_speakblock
      Replace the first line with:
      if (distance_to_object(obj_player) < distanceTrigger && keyboard_check_pressed( ord("E") ) && !instance_exists(obj_textbox)){.
      And in the create event type
      distanceTrigger = 2;

    • @shukytime3231
      @shukytime3231 2 года назад

      If the key is the same as the accept key when you interact it on the first page the letter will allready be writing.

    • @AymenZero
      @AymenZero 2 года назад

      @@shukytime3231 holy shit why has no one told me that "distance_to_object" was a thing??? thank you so much!

    • @deymitsjeym
      @deymitsjeym 2 года назад

      @@shukytime3231 that is unless you put a timer where it keeps you from accidentally skipping the first line of text just as the text box is triggered

    • @shukytime3231
      @shukytime3231 2 года назад +2

      Ok. and if you want to make the player stop while text tell me ok?

  • @jeremyulrich1435
    @jeremyulrich1435 2 года назад +1

    Anyone know how to keep the rest of the game paused while the dialog is running?

    • @bendriscoll
      @bendriscoll 4 месяца назад +1

      hi jeremy hope you got it after two years but if not you can set the textbox's parent to your pause object from the room transitions video that peyton did, that should do it 😎

    • @jeremyulrich1435
      @jeremyulrich1435 4 месяца назад

      @@bendriscoll Thanks for your response Ben, I did find a solution on my own that differs from yours but I'll keep that in mind. My solution was to copy the code from my pause object in the player's step event:
      //pause player movement while text is up
      if instance_exists(oTextbox)
      {
      xspd = 0;
      yspd = 0;
      }
      In case anyone was interested, happy game developing everyone.

  • @amalsoappickle
    @amalsoappickle Год назад

    Hey I don't expect this getting a reply... but I have this issue where a blank textbox will show up in the start when i don't want it too? all the other textboxes work fine except this one

  • @M00nH34rt
    @M00nH34rt 2 года назад

    I was going to make a comment about an issue I was having, but just before I posted it I checked my createtextbox script, and realized its depth was different than the depth in my objtextbox.
    Just in case anyone added an extra 9 or something, like I did, that's no good when creating new textboxes.

  • @Mackievellian
    @Mackievellian Год назад

    So somehow a year later my textbox blinks after choosing the branching dialogue option (the instance_destroy() causes this)! I really am not sure how to fix it, any help would be appreciated.

  • @delvanoelvin
    @delvanoelvin 7 месяцев назад

    Reminder of myself: 16:13 because holy crap I've been following the entire RPG series in less than a week with no break

  • @ghas__
    @ghas__ 2 года назад +1

    Im kinda confused, it wont let me run at 27:21 because the option_pos has only been referred once?

    • @lop3436
      @lop3436 2 года назад

      i have the same prob, have you solved yet?

    • @ghas__
      @ghas__ 2 года назад

      Actually yes

    • @ghas__
      @ghas__ 2 года назад

      It was only referred once at that time, it gets referred later in the video

    • @lop3436
      @lop3436 2 года назад

      @@ghas__ thanks for replying bro! i got it!