Textbox Tutorial: Game Maker Studio 2 [1/2]

Поділитися
Вставка
  • Опубліковано 21 жов 2024

КОМЕНТАРІ • 250

  • @adamskvorak6865
    @adamskvorak6865 7 років тому +197

    I just started getting into gamemaker, and I spent hours trying to find a good video for text boxes. This was, by far, the most well-explained and well-structured video I found. This was super helpful, keep making videos!

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 років тому +39

      This is such a kind comment - thank you! It honestly made my day :). I'm thrilled you found the video helpful!

    • @PhoenixLabella
      @PhoenixLabella 7 років тому +5

      I must say the same. Her vids are helping me a lot.

    • @afterlifenews2401
      @afterlifenews2401 3 роки тому

      @@FriendlyCosmonaut what are strings?

    • @randomcommentordude4131
      @randomcommentordude4131 3 роки тому

      @@afterlifenews2401 they are like sentences

  • @jessejayjones
    @jessejayjones 3 роки тому +8

    You explain things so clearly and in such an organized way. You made this very complex subject (to me) easy, and fun to follow along with! Great work!

  • @Ninololcss
    @Ninololcss 6 років тому +57

    Finally someone thats not shaun or Benjamin (heartbeast) that makes pretty great in-depth tutorials

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  6 років тому +25

      Haha thank you! Since you're searching for content (and also for others who may be reading this), some other GameMaker creators out there include: BeyondUsGames, GloomyToad, Stefan Randa, Talent Lost, RealTutsGML

    • @Ninololcss
      @Ninololcss 6 років тому +2

      Thanks! i bet that will help us all a lot :D!!

    • @TooWongCool
      @TooWongCool 6 років тому

      THANK YOU!!!!!!!!

    • @null_ham
      @null_ham 5 років тому

      @@FriendlyCosmonaut theres also me

  • @rlindstrom3
    @rlindstrom3 7 років тому +8

    This was a fantastic video FriendlyCosmonaut. This is by far the easiest, most approachable one I have found on adding dialogue to games. Thank you!

  • @FeniksGaming
    @FeniksGaming 7 років тому +15

    Great video please continue to make more we need more tutorials from people who know what they doing. Your teaching is great, organised and easy to follow.And can't wait for you to do more.

  • @hatandhoodie_
    @hatandhoodie_ 2 роки тому

    As someone who's still somewhat new to GameMaker, as well as game development itself, I must say this is a really helpful tutorial!
    Using what I learned here, along with what else I could figure out myself, I managed to code a text box that can have multiple pages of text to cycle through before closing it, as well as making it easier to assign different dialogue to different NPCs, right from the Room Editor.

  • @gabrielasantanadaluz4617
    @gabrielasantanadaluz4617 6 років тому +1

    is difficult to find dialogue tutorials with this quality, thank you very much

  • @joyfulfishman5445
    @joyfulfishman5445 Рік тому +1

    Absolutely the BEST video I found on this subject, thank you SO MUCH!

    • @NotSoSharpGames
      @NotSoSharpGames Рік тому

      if it worked for you, can u help /w my problem

  • @Pratanjali64
    @Pratanjali64 3 роки тому

    I did it! It works!
    Thank you for making these so clear.
    These end up taking me about 4x as long with all the pausing and catching up I have to do, so that was about an hour for me.
    Tomorrow I'll try the next one.

  • @Urto123
    @Urto123 6 років тому

    Really appreciate these videos. From an intermediate perspective, I like the fast-paced no-frills approach. Very educational.

  • @1pessoa523
    @1pessoa523 10 місяців тому

    ther are lots of textboxes in yt tutorial, yours is by far the best!

  • @lytningthief
    @lytningthief 4 роки тому +6

    I've got a question! In your step event at 11:32, why can't you type in "if place_meeting(x,y,obj_player) and mytextbox == noone"? I've tried doing it this way and I know it doesn't work, but I'm curious as to why.

  • @AiguretDuren
    @AiguretDuren 4 роки тому +2

    Hello from 2020, FriendlyCosmonaut. Thank you for the great tutorial!

  • @fratchner7136
    @fratchner7136 7 років тому +5

    Please keep making videos. These are by far some of the best I have seen for GMS2!

  • @setagangastudios574
    @setagangastudios574 2 роки тому

    Wow! I love how simple you made this video. Getting straight to the point but also teaching along the way? Perfect.

  • @chriss6832
    @chriss6832 7 років тому

    Great Quality, it is hard to find straight to the point content like yours. As someone who doesn't have much background in GMS, I enjoy coding along your tutorials. Keep up the great work, you'll become a great asset to this community!

  • @jamiefox
    @jamiefox 4 роки тому +19

    "You can call it whatever you want"
    me: I shall call you WhateverYouWant
    :)
    Merry Christmas everyone !

  • @panzeros5714
    @panzeros5714 5 років тому +2

    I came straight here after the Space Rocks tutorial just to go through all your videos. You're an excellent teacher and I'm a bit in love with your voice. Thanks for putting the effort into these.

  • @beerbub2641
    @beerbub2641 6 років тому

    Man this guide is REALLY helpful and especially kind to noobies, like me
    seriously, you really made someones day here

  • @alinas2452
    @alinas2452 7 років тому

    You're a great teacher! Thank you so much for putting these videos together, they are very helpful for beginners like me. I know just enough code to understand what you're doing, but not experienced enough yet to figure out this stuff on my own.

  • @FaramurDodecuai
    @FaramurDodecuai 6 років тому

    Finally, something I can follow along and understand it. Shaun and Heartbeast are way too good, but sometimes they show no mercy for logic-intelligence challenged plebs like me Dx. Thanks, you're great.

  • @nusratakhiislam2523
    @nusratakhiislam2523 6 років тому +2

    well explained, I was looking for something simple, thanks a lot

  • @isaacformato8210
    @isaacformato8210 3 роки тому +5

    Any idea on why the final step won't work for me? I'm trying to put in "myTextbox.text = "whatever"" but it's still just showing the default code from obj_textbox.
    EDIT: I figured it out, in the obj_textbox having the text variable in draw is breaking it for some reason. Only leave the text variable in create.

    • @kyxor7618
      @kyxor7618 3 роки тому +1

      Hello, i tried removing the ''Text'' from the draw, but it wont let me as it's only 4 variables and it expects 5. What did you replace it with?

    • @hatandhoodie_
      @hatandhoodie_ 2 роки тому

      Thank you, random commenter from 9 months ago, you've just saved me from a long headache.

    • @MrJackRenegade
      @MrJackRenegade Місяць тому

      Thank you, random commenter from 3 years ago, you've just saved me from a long headache

  • @rebelutionarygaming8875
    @rebelutionarygaming8875 7 років тому

    Thank you a whole bunch dear Cosmonaut.

  • @NeverduskX
    @NeverduskX 7 років тому +1

    This is really helpful. Thanks so much for making this video. You explained and showed everything so well.

  • @Lucas-fz6fd
    @Lucas-fz6fd 5 років тому +2

    I'm brazilian and i loved ur videos, thanks for your existence (well, my english is very bad)

  • @eclecticgamerdx9140
    @eclecticgamerdx9140 5 років тому +2

    This is such a great tutorial, very helpful for somebody who's just starting out. Subbed, liked, and thanks :)

  • @charKT-7461
    @charKT-7461 5 років тому +1

    For those wondering if you can make it so the text-box appears at the bottom of the screen, just make it so it draws it at the camera’s x any y coordinates. Then change the coordinates until it looks good.

  • @taoliu7312
    @taoliu7312 6 років тому

    I can not believe such a great video!

  • @berat8924
    @berat8924 7 років тому +4

    WHAAAT! There was a auto word-wrapping and i didn't know. All my work of trying to figure out how to seperate words is gone. The script i writed is doesent matter now i think. But i'm gonna keep it. I put a lot of effort on it. I luv my textbox. Thanks for the tutorial.

  • @ghostysnakier
    @ghostysnakier 6 років тому

    This was really helpful! I love the way you've set up your tutorial! Can't wait to watch more of your videos =]

  • @BarakObobby
    @BarakObobby 3 роки тому

    Thank you so much for these great tutorials!

  • @Silver_Unseelie
    @Silver_Unseelie 4 роки тому +1

    Even though youre sing the gml as a dnd user I can still learn from this, thank you!~

  • @danielv.a.8303
    @danielv.a.8303 7 років тому

    You explain very well, keep going!

  • @distantsails
    @distantsails 7 років тому

    Nice and simple, great tutorial!

  • @RikThunder33
    @RikThunder33 6 років тому +2

    bless your eternal entity! This helped me a lot xD also in different aspects of game maker :D
    as in hovering over items and making so that their name appears beside the cursor. It always bugged out but now I have the solution! ^_^

  • @catherinewest1809
    @catherinewest1809 Рік тому +1

    Love the video! However, with the new update the textboxes only show for a split second on collision before they disappear again :/ I have tried putting the objects on different layers and on the same layer. When resetting myTextbox = noone the textbox is created and destroyed every frame of the game while colliding with 'susan'. Does anyone know a fix for this?

  • @jelenasiric4063
    @jelenasiric4063 5 років тому

    Very well explained, really apreciate it

  • @asi4671
    @asi4671 4 роки тому

    i put enter to be the button of intercting
    so i put
    if(keyboard_check(vk_enter)) {
    instance_create_layer {
    will it work at the same way or it need to be "(mouse_button_pressed_check(" and these things?

  • @meatbleed
    @meatbleed Рік тому

    Thanks for making this. Used it a while ago & recently was able to mod it to allow questions and dialog paths. Perfect foundation to build on.

  • @Vixcitement
    @Vixcitement 3 роки тому

    I was able to follow the guide up until instance layers were brought up as I don't think game maker studio 1 has those, is there an equivalent or should I just look up a gm1 specific tutorial.

  • @TubeRudeYou
    @TubeRudeYou 5 років тому

    Thanks, Shaun. Going the extra mile to help us noobs with coding, we appreciate it :)

  • @boygeeriv170
    @boygeeriv170 4 роки тому +1

    Hey! Excellent video, thank you so much. Just a quick question: how would you make it so that the word would start on the next line (at the end of a line) instead of beginning to write itself then jumping down to the next line? When playing, this comes out very distracting for me and I would love help fixing it, because I can't figure it out myself ahaha. Thanks!
    Example of what I'm talking about if it's unclear:
    If I want to write "He went that way, sir! I saw Timothy heading downstairs."
    ...the game would write "He went that way, sir! I saw Timot" and then would erase "Timot" and bump it down to the next line, so it reads:
    Line 1: "He went that way, sir! I saw"
    Line 2: "Timothy heading downstairs."
    How would I make "Timothy" (and every other word) check that it is too long to fit on that line before it is written and bump itself down?

  • @packagebattos
    @packagebattos 5 років тому +1

    Hey,I have a problem.
    if(place_meeting(x,y,oPlayer))
    {
    instance_create_layer(x,y,"text",oTextBox);
    }
    In the game , I have an Code Error in instance_create_layer(x,y,"text",oTextBox);
    and error is about "text" Pls help me.

    • @jasputin_forever4779
      @jasputin_forever4779 5 років тому

      you have to check text layer is exist.
      sorry. I'm korean. so.. I can't speak English well.

  • @Sunny-hs2mp
    @Sunny-hs2mp 3 місяці тому

    is there a way the text could instead be above the object instead of in the object?

  • @rzzz6184
    @rzzz6184 5 років тому +2

    Im using a viewport and whatever i do my text is always so pixelated, any fixes?

    • @zakthedragonslayer449
      @zakthedragonslayer449 5 років тому

      turn off interpolate between colors in the option menu where she says change the fps to 60

  • @DavidBrocekArt
    @DavidBrocekArt 7 років тому +1

    Great video! :) Helped me a lot. I just have a question...
    There is sh*tload of text in RPGs, do I understand correctly, that for every single sentence, I must write all this code?
    Or is there any other option?

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 років тому +2

      Yeah these tutorials are more for the textbox itself, not really for structuring the lines of dialogue/managing the data - which is a whole other kettle of fish! As you say, for large RPGs you're going to have LOTS of dialogue.
      So you don't have to rewrite all the code, just the "text" variable array. You'll need logic for triggers at certain events, actions, choices, etc in the game). For example, in the speaker object when we pass over all of our variables to the textbox, you could run an event BEFORE creating the textbox (call something like event_user(ev_other, user_event0)) and then in that event (user event 0), put all the logic for the text, like:
      text = -1; //to reset the array to nothing
      switch(events_var){
      case 0: text[0] = "First line of dialogue."; break;
      case 1: text[0] = "Line of dialogue that responds to the fact that an event has happened"; break;
      case 2: text[0] = "Yet another event has happened so we respond differently"; break;
      }
      Or of course you could have more complicated logic for responding to different kinds of things.
      Also, instead of just hard-coding in your text, you might actually want to consider pulling it from some kind of data structure (list, grid, etc) or loading it externally (eg. a txt file or using json).
      Hope that makes sense!

  • @bluemcneil5883
    @bluemcneil5883 3 роки тому +5

    Anyone in the latest version of game maker studio 2, please consider reading any replies to this comment or the rest of it before starting this tutorial.
    -The instance_create_layer(x,y, "text", obj_textbox); in the step event for obj_sally will break. for some reason "Text" is no longer acceptable for this format.
    Tested on feb 21 2021. I say read the replies if the creator or other commenter found a workaround. I'm still a nub, but hope to save yall time.

  • @Cartoonicus
    @Cartoonicus Рік тому +1

    I'm using DnD. So far, everything has translated, but Is there a relative function to the "draw_text_ext?"

    • @AlexianKing
      @AlexianKing Рік тому

      Check the Manual for more useful drawing functions.

    • @Cartoonicus
      @Cartoonicus Рік тому

      @@AlexianKing I have never understood anything that darn manual has had to say. It's like reading Latin.

  • @kitsumizu
    @kitsumizu 6 років тому

    Is there a way I can collide with the NPC and still use this kind of setup?
    I was following Heartbeast's tutorial for a while, but during the dialog video he used some code from a different video that I hadn't used because I didn't wan't it in my game so I'm using physics.

  • @phili4600
    @phili4600 3 роки тому

    Thank you, this was very helpful!

  • @netowgtz
    @netowgtz 4 роки тому +1

    so helpful!, what function do i need to use for creating the textbox instance if my player has a collision_line? (place_meeting doesnt work)

  • @Etsa
    @Etsa 5 років тому +4

    Hiya, I'm using your awesome textbox engine you have available to download. You've helped me out in the past and I'm hoping you can help again.
    So I've run into an issue, where with the portraits I want to change the face that's talking on each page. Matching the characters emotion.
    In the engine you have sub images that you can use for each emotion. The way I'm doing it I want to use a completely different Sprite. I cannot seem to find any way to change the Sprites on the fly. The portraits cant use the mouth animation you put in there since their heads change too much so I wanted to have a different portrait for each emotion.
    Basically I want to change the portrait with each page.
    I want each emotion sprites sub image to be the mouth open.
    Gah, it's hard to explain.
    You have a myScripts but I cant seem to assign a new sprite to myPortrait which is what I was trying to do.
    If you could help me out that would be amazing. It may even help out others but I am unsure.

    • @Etsa
      @Etsa 5 років тому

      I didnt know how to contact you really! If you want to find a better way to chat about this let me know but I'm sure you're also really busy. You would just save me many hours of frusterations trying to do this without breaking the whole thing on accident.

  • @vela7358
    @vela7358 3 роки тому

    thanks i could only find an advanced tutorial that was out of date and impossible to follow for a beginner like me.

  • @aceyv2019
    @aceyv2019 2 роки тому

    uh how do you make the text..... BIGGER
    the font im using right now is kinda THICK

  • @galnefred7895
    @galnefred7895 6 років тому +1

    please help! i did the tutorial and my problem is that when i trigger the text the rows are too far apart, and when i press the trigger button again it normalizes. Why?

  • @alannaokun2842
    @alannaokun2842 2 роки тому

    hi! longshot, but figured I’d ask here if anyone has an idea for a fix - everything is working great, except I can’t figure out how to not have my main character be in active collision, as it were, with an NPC in order to trigger the dialog box. It means she has to keep sort of awkwardly marching up against whoever she’s talking to, rather than standing idle, and that I have to be simultaneously pressing space + whichever arrow key is pointing toward the NPC.
    There’s probably a simple fix for this, but I’m pretty new to GML so appreciate any thoughts! And thank you so much for this clear, useful tutorial, FC - I’m so pleased with how it turned out already, and this feels mostly cosmetic!

  • @masonwhite7235
    @masonwhite7235 6 років тому +1

    Let me first say: thank you for an awesome video. My question though: is this tutorial only compatible with GMS2? I'm still using the original Game Maker Studio, and I'm not sure if I'll be able to port my current game project over to GMS2 from GMS or not.

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  6 років тому +1

      Thank you :). Yes, I think all the functions used in these videos are shared by both GMS2 and GMS1.4 (and if not there will just be a difference in what it is called)

  • @jonus5331
    @jonus5331 Місяць тому

    When im doin myTextbox.text, the word text is red and it dosent change whats is said in the box

  • @MadpolygonDEV
    @MadpolygonDEV 6 років тому +2

    The unique id thing really confuses me as a freshman. I was thinking, isnt this a simpler alternative
    if (place_meeting(x,y,obj_player)) {
    instance_create_layer(x,y,"text",obj_textbox);
    } else if (!place_meeting(x,y,obj_player)) { instance_destroy(obj_textbox);
    }
    just have it destroy the box when the player isnt colliding anymore.

    • @subhue9550
      @subhue9550 4 роки тому

      Thank you!! This helped me out a lot, I kept on getting weird glitches and fatal error messages.

  • @hudsen1
    @hudsen1 3 роки тому

    this is really helpful, thanks!

  • @sanchovii2588
    @sanchovii2588 7 років тому +1

    Hey there, first of all thank you for the video, as a beginner it's the more understandable I met and the system looks adjustable so it's cool!
    Though I have an issue. My textboxes are flickering, I believe my collisions are continuous and so, once I collide with the NPC it keeps destroying the boxes but I can't find a solution.
    Also, from your experience is it hard to create a more "advanced" rpg set-up for the dialogs, with portraits, conditionnal dialogs (like I have this item so the character says this stuff etc) ?
    Thank you again, looking forward to see more of your work.

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 років тому

      Hmmm, could you send me your project file so I can have a look at exactly what the problem is/what your code looks like? My e-mail is friendlycosmonaut@gmail.com.
      Also - a little bit! You'll need more variables to pass on to the textbox (NPC portrait), and change what the textbox draws (co-ordinates of the different elements) so it can draw the textbox too. The conditional dialogues will also introduce a layer of complexity. You'll want to be to be checking things like:
      if(player.hasItem) text[0] = "I see you found my hat."
      else text[0] = "I wish I could find my hat..."
      And this will need to be done BEFORE you pass off the text variables from the NPC to obj_textbox. Perhaps obj_textbox could run a "check" event to "update" the NPCs dialogue.
      In my Farming RPG series, when I do the textbox, I'll likely be covering these additional elements. But it's a bit down the track, at the moment!

    • @loveisthenewpunk
      @loveisthenewpunk 7 років тому

      FriendlyCosmonaut I'm having the exact same issue. Was a solution found?

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 років тому

      Yes -- it was a "grammatical" error. Basically, the code to destroy the textbox (in the else statement) was put INSIDE the if check.
      But generally there's quite a few ways to prompt an error, so your problem might be different. I'd suggest to go through the lines carefully, check your brackets(!!), and make sure the logic flows properly. But if you can't find it, feel free to send me your project and I can take a look! :)

  • @prajawalgurung6121
    @prajawalgurung6121 4 роки тому

    as I got to the 6:27 mark and checked my object like you did my text was on the top right of the sprite I did the code word for word and checked it many times it was the same code. Any solutions to this

  • @wasabi5134
    @wasabi5134 2 роки тому

    So how do you make it so that you can hit space again after the textbox is destroyed and cue the dialogue again? Without recolliding with the NPC I mean

  • @rogerealV3
    @rogerealV3 4 роки тому

    Hi, How I Make The Textbox Appares When I Press "Z"?

  • @Quentin94
    @Quentin94 3 роки тому

    I did everything the same but it's still not wrapping, the text is going beyond the textbox???

  • @ridiculouslycoolguy
    @ridiculouslycoolguy 6 років тому +1

    Do you know how a text box could be autosized to fit the length of the text? Sort of like the GUI in "Kittens Game"?

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  6 років тому

      Yes! You could get string_width of the string that you're drawing, and make the textbox draw at that size (plus the buffer, if necessary). You could update this every step if you want it to change as the text spells out, or get it once at the start. You may also want to play with the horizontal alignment of everything (eg. center justify it) if you want it to be increasing from the middle.

    • @ridiculouslycoolguy
      @ridiculouslycoolguy 6 років тому

      Thank you! Can you help me with the equation on this one? I'm actually trying to extend the height of the textbox. It looks like string_width_ext is the function I'm looking for, but it returns a pixel count whereas draw_sprite_ext uses a percentage for scaling.

    • @ridiculouslycoolguy
      @ridiculouslycoolguy 6 років тому

      I figured it out...I had to move some code from create even to draw event. Thanks anyways!

  • @WurdleOnlyTwiceAsBad
    @WurdleOnlyTwiceAsBad 7 років тому

    For some reason, when I do what's on this tutorial, my game refuses to launch. It doesn't have a crash report or anything, it just says "FAILED: Run program complete". Am I doing something wrong? I can't seem to figure it out.

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 років тому

      Is it just that project? If you create a new one (blank project) does it run correctly? If t does, copy-paste the code, does it run correctly then? This should help you work out if it's the program or the tutorial (although I can't see why the tutorial would cause it). If youre having persistent problems over projects I'd say contact YoYo Games support.

  • @Just_Baba07
    @Just_Baba07 5 місяців тому

    Is there a gml version of this? I really need one right about now.

  • @JEVONGAMEDEV
    @JEVONGAMEDEV 7 років тому

    Nice. But do I make the text box above and at the center of the NPC head?

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 років тому +1

      You would just change the co-ordinates we are drawing the text to. At the moment the textbox will appear where it is created using the instance_create_layer function. We just put in our NPC's (x,y) location, but we can alter this. To get it above the NPC's head, you would move it UP, so change the y to something like "y - [some number]" and over to the LEFT. If you want it centred, then you'll want to move it left by half the width of the textbox. So, "x - (obj_textbox.boxWidth/2)"

  • @MrSoribus
    @MrSoribus 7 років тому

    Thank you for the great video

  • @neonewman8054
    @neonewman8054 4 роки тому

    I have a question I am sure it is simple but I cant seem to find the problem. When my player collides with the npc to create the text box it creates it then instantly destroys it: Here is my step event code for the NPC that creates the textbox:
    if (place_meeting(x,y,oJoshua))
    {
    if (myTextBox == noone)
    {
    myTextBox = instance_create_layer(x,y,"Text",oTextbox);
    myTextBox.text = dialog;
    myTextBox.creator = self;
    }
    }
    else
    {
    if (myTextBox != noone)
    {
    instance_destroy(myTextBox);
    myTextBox = noone;
    }
    }

  • @rlfraguas8541
    @rlfraguas8541 5 років тому

    Thank you really good video

  • @NutritionFacts1989
    @NutritionFacts1989 7 років тому

    Good video ,very helful, thanks !

  • @feelinglucky8534
    @feelinglucky8534 3 роки тому

    ive followed the tutorial correctly but the text box is appearing but not the text?

  • @joyfulfishman5445
    @joyfulfishman5445 Рік тому

    I love this video

  • @davidlecompte9467
    @davidlecompte9467 5 років тому

    Damn i love your video ! thanks a lot

  • @Join-vader-gamer1234
    @Join-vader-gamer1234 2 роки тому

    hello im having a error at the place meeting

  • @fatbeardie5353
    @fatbeardie5353 3 роки тому

    I'm having trouble with "susan's" code.
    it keeps creating and destroying the textbox while the player obj collides with her.

    • @K4A-KnowledgeForAll
      @K4A-KnowledgeForAll 3 роки тому

      That's why you have condition test in if(myTextbox == noone).
      Have you created it first in Create Event
      myTextbox = noone;
      And then typed the if and else condition tests in Step Event ?

  • @marcosmena3060
    @marcosmena3060 7 років тому

    pretty good, and simple ++

  • @noba4160
    @noba4160 7 років тому

    Great tutorial. Just wondering, how would I set it so that when the player collides with an object the text will appear? I know about using the collision event and all that, but what else would I do to control where it appears?

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 років тому +1

      I'm a tad confused -- this is exactly what should be happening with our code (the player collides, text appears). As for "where" it appears, at the moment, the thing controlling that is just where we are creating it using the instance_create_layer function. We supply it with an (x,y) co-ordinate to create the box. We set it to create it where the NPC is located (the NPC's x,y), so if you want it elsewhere then you would alter these inputs.

  • @gimligimlass5509
    @gimligimlass5509 6 років тому

    Wait, why does myTextbox.text change the text the NPC speaks? I see that it works both in the video and in my project, but I don't understand how.

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  6 років тому

      Whenever we use the dot operator, ie: player.x, NPC.x, it means that whatever variable that follows the dot belongs to the object on the left of it. So when I say "myTextbox.text" it's referring to the text variable that belongs to the myTextbox object. I hope that makes sense - I know it's a bit tricky to wrap your head around!

  • @kostys9880
    @kostys9880 6 років тому

    Maybe it's too late to ask but can you explain how can I remove control of player so he cannot just run away while in dialogue with someone?

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  6 років тому

      You could add a boolean variable in the player's create event (like canMove = true;) and then toggle this when a dialogue gets created (so you could put: "with(obj_player) canMove = false;" in the create event of the dialogue). Then, wrap all the movement code in an if check, like "if(canMove){ }"

  • @jbtop1778
    @jbtop1778 2 роки тому

    saved my life

  • @feelinglucky8534
    @feelinglucky8534 3 роки тому

    Okay, so the text isn't appearing in the text box but ive followed the tutorial correctly, any advice ? :D

    • @K4A-KnowledgeForAll
      @K4A-KnowledgeForAll 3 роки тому

      Check your obj_textbox object.
      Have you put your draw text code in Draw Event of it ?
      Did you define "text" variable in Create Event ?
      But bug is probably somewhere in Draw Event if it isn't rendering correctly.
      cheers

  • @uproaring1569
    @uproaring1569 7 років тому

    Helpful video! How do you bring up the box at 1:38? When I do Add Event > Draw it opens up a box for drag-and-drop codes.

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 років тому

      Ahh -- it sounds like you're in drag and drop mode. When you start a new project, you have an option to make a "drag and drop" or "game maker code". I'm using the "game maker code" one.

  • @medievalogic
    @medievalogic 6 років тому

    GameMaker lacks a constructor for creating instances right? In that case the susan instance is first creating a default textbox & later changing it's text to "hello i'm susan" ?

  • @zeroDev726
    @zeroDev726 4 роки тому

    what should i do if i want to add character portraits

  • @SuperSonicAdvance07
    @SuperSonicAdvance07 3 роки тому

    Thank you IT helped me

  • @fullym5484
    @fullym5484 Рік тому

    This helped to much

  • @90000DavidSite
    @90000DavidSite 3 роки тому

    Thanks for this is really nice! When i change the font i can see spaces between some letters. Is there a way to fix this?

    • @90000DavidSite
      @90000DavidSite 3 роки тому

      I found the solution, this stuff is only compatible with "monospaced fonts".

  • @1lipefellipe266
    @1lipefellipe266 4 роки тому

    thank you

  • @mint5904
    @mint5904 6 років тому

    Hey, The text moves up whenever I Press space to make it keep going is there anyway to fix this

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  6 років тому

      Sorry, do you mean the entire textbox moves up in its y position? Could you perhaps send a screenshot or gif of what's happening?

  • @0001-exe
    @0001-exe 7 років тому

    Hello, how can i make a text box where the main character(the one we're controlling) can answer back??? Please helpp

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 років тому

      Ah yes! I'll be doing a tutorial on this in the future in my Farming RPG series. It's a pretty big topic so unfortunately I can't really do a write-up here as it would take a long time. I can tell you that it will involve a more complicated system where we'll want different "states" for the textbox: one for when an NPC talks, one for when we want player input. In the "player input" state, you'll want something recording the "choice" of the player, to determine what happens next.

  • @ephinaeus6140
    @ephinaeus6140 5 років тому

    This video was so useful!! Just one problem: my textboxes only work in the first room? I don't know if I did something wrong, and I just can't quite figure it out... (edit) whoops nevermind I had messed up a piece of code XD

  • @frickthisisdead2134
    @frickthisisdead2134 5 років тому

    I doubt my comment will be seen but im having trouble with wrapped text. My text box appears at x 0 y 0 and my text appears x 4 and y 28 so that it fits in my box well and when the text gets wrapped it sadly goes out of the box through the top of the box, hopefully i will be able to fix on my own but if not i hope someone will help me

  • @emiliovera5582
    @emiliovera5582 7 років тому

    I have a problem with instance_destroy(mytextbox), any idea how to fix it? (i use GMS1)

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 років тому

      What's the problem exactly? Do you get an error message?

    • @emiliovera5582
      @emiliovera5582 7 років тому

      Yes. Is like the variable mytextbox doesnt work or is just no exist. The error message say that. I think is because the program i use(GMS1), or i don´t understand english so well in your video

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 років тому

      No worries! Language can make things tricky. It might be better if we switch to e-mails. Could you please send me a screenshot of the error message. My email is friendlycosmonaut@gmail.com

  • @ralaperher3650
    @ralaperher3650 7 років тому +1

    How would you make the text not just appear, but slowly be written, like most RPGs have? Thanks :P.

    • @ralaperher3650
      @ralaperher3650 7 років тому

      Oh wait its explained in the next one doesn't matter. Thanks for this great tutorial though!

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 років тому +2

      Haha yes. No worries, thank you :)

  • @kadecheewah8349
    @kadecheewah8349 2 роки тому

    It only worked for me up until a point. I don't know if it's just the version I'm using

  • @nagabonar2445
    @nagabonar2445 5 років тому

    hi, my text get out of the box every time I run the game, I have already set the draw text coordinates to x and y but I still get the same problem , can you help me?

    • @vikingmapping44
      @vikingmapping44 4 роки тому

      You probably forgot to change the origin of the sprite to top left

    • @polaritybear3569
      @polaritybear3569 4 роки тому

      Try adding draw_set_valign(fa_top) at the start of your Draw Event