Item Descriptions | Farming RPG Tutorial: GMS2 [P17]

Поделиться
HTML-код
  • Опубликовано: 21 дек 2024

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

  • @securityranger773
    @securityranger773 7 лет назад +20

    Seriously ... some of the best tuts with GMS2 on YT.

  • @fabiancretu9141
    @fabiancretu9141 6 лет назад +2

    Your tutorials are very useful! Thank You for your help!

  • @cchhiipp
    @cchhiipp 6 лет назад +4

    Perhaps I missed it, but I don't think I saw you set up a ds_grid_destroy() line in the Clean Up event for the new ds_items_info data structure.

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  6 лет назад +5

      Oh no, you're right! Unfortunately I've already finished uploading/editing the next episode, but I'll put this in the one after that. Thank you for letting me know!

  • @TheBroGuy
    @TheBroGuy 7 лет назад +1

    Done! Caught up with the series in under 3 days :P
    A few little bugs I can't quite seem to fix yet. But I have to time to take care of that between now and next episode :D

  • @joostkivits
    @joostkivits 7 лет назад +3

    Nice tutorial! I usually use Json to store item descriptions and other things :)

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 лет назад +4

      Cheers! This is actually what I'm planning to end up doing! :)

  • @johndurish4092
    @johndurish4092 4 года назад

    Excellent stuff, but I think you may have missed something; for the "draw_text_ext_color" for the item name and description, the UI width needs to be '(inv_UI_width*scale) - (x_buffer*2*scale)' (at around the 11 minute mark).
    You annotated the *scale for the 'inv_UI_width' but not for the 'x_buffer*2.' Or rather, if you did, the video pans too quickly to spot it.
    Again, amazing video, and I feel like I'm learning enough to troubleshoot an issue like this! That's proof of good instruction!

  • @BenjaminKildegaard
    @BenjaminKildegaard 4 года назад +1

    I don't know if it is only in my game. But when I held over an empty inventory slot my time cycle text's font changed to a bigger one. I fixed that mistake by changing the used font in the daycycle draw gui event :)

  • @Mystical-TEDDY_
    @Mystical-TEDDY_ 3 года назад +1

    is anyone else having a problem where when there text is supposed to go to the next line in the item info, it goes up instead of down

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

    The code used to 'drop' an item seems like the kind of thing that would be put into a function in coding language like C# since there is so much reused code, is that something that would be viable in Game Maker? Can "scripts" be used as void-returning functions? I'm not sure if maybe that would be a bigger drag on performance than just retyping the code like in this tutorial?

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

      Curious about this too - Were you able to find out?

  • @spiderdlh9905
    @spiderdlh9905 4 года назад

    help needed this code here only referenced once. do i need this yet ? also no mouse button is working now not sure where i went wrong not sure if one } is in wrong place in step event as i needed to put one so i put it at bottom. any idea where i might of gone wrong ?

  • @MossySparks
    @MossySparks 6 лет назад

    One question... How do we reset a slot in the grid to it's starting point? Like it doesn't contain a crop. Right now I destroy the crop when it collides with my players attack damage object. It disappears but when I try to plant something else in that space it still thinks the previous crop is there.

    • @MossySparks
      @MossySparks 6 лет назад

      Figured it out! Just waiting on saving the crop data to a save file! Been trying to figure it out but haven't gotten it yet...

    • @MossySparks
      @MossySparks 6 лет назад

      Okay crap I was just clearing all the crop instances data... It worked, I could plant where the previous plant was, but can also plant over top of existing plants lol I guess I need to set the specific cell that the plant was in back to -1? Can't quite get it... YET lol

  • @robinsommer
    @robinsommer 7 лет назад +1

    Good to be back on it :D I did notice something. When I drop many items from the inventory in the game world (either via the previous way or the way I learned in this video) while not moving. I saw that it all worked fine, but the lerp radius only goes three quarters of a circle. I'm talking about the random direction each item moves away from the player on the game world ground. I tried to make a dense circle around my player by dropping a bunch of items, but I could not "fill" the complete circle, so to say. I fixed it because it's an easy fix (in the obj_item Create event, changed var itemdir = irandom_range(0, 259); into var itemdir = irandom(360);) I am totally unsure if this is only on my end, or if others have noticed. Maybe I'm missing something and this was intended for some reason. Either way, I am wondering why the seemingly perfect irandom_range did not work as well. It should? Probably a weird angle coordinate glitch I guess :)

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 лет назад

      Oh I keep forgetting to revisit this - no this was a complete slip on my part! In one of the previous videos where we first code this, I was pointing out that the angle 360 is the same as 0, since it's the same as coming through circle. So then I proceeded to say, "so we only need to go to 259" instead of "359". My apologies - and thank you for pointing this out Robin!!

    • @robinsommer
      @robinsommer 7 лет назад

      Oh right! It's 359 haha. I am NOT good with numbers... That makes sense. No problem :)

    • @danbee6407
      @danbee6407 6 лет назад

      Also, change the 'r = 2' for item collection radius to something like 8. I could run from items going certain directions, even if I stopped, they wouldn't be 'close enough' to be picked up.

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

    Does someone know how to make so when the mouse is outside the inventory it does not select a slot?

    • @Mystical-TEDDY_
      @Mystical-TEDDY_ 3 года назад

      no

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

      I know this is late, but hopefully it will help someone else!
      The else { mouse_in_inventory = false; } section detects when the mouse is outside of the inventory, so you can add code there.
      Basically what's happening is the m_slotx and the m_sloty variables aren't updated when you're outside of the inventory, so it keeps displaying whatever was last selected. You can fix that easy by setting them to something like -1. I put in the following line of code inside the else statement:
      m_slotx = -1; m_sloty = -1;

  • @burteetee5063
    @burteetee5063 6 лет назад +1

    Thanks for the awesome videos. You're the best! This is a fun series to follow. I had one issue where the mouse directly over the first row of items in the inventory was still selected as indicated by being highlighted and I could also click to pick up the item even though I wasn't on it. It only happens on the top first row and only when above it. I was able to figure out a solution but since I didn't see any comments or hear you comment about it I just wanted to know if you can reproduce the same thing in your game or if it's just me.

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  6 лет назад +1

      As I was building the system I remember encountering a few errors like that. It was usually because of something in the logic of getting the mouse's position and translating it to the grid co-ordinates. It could even be as small as leaving off a "-1" or having ">" instead of ">=". I'd suggest just carefully combing through that section!

  • @magnomaol
    @magnomaol 5 лет назад +2

    Great vid!
    Those items descriptions XD
    And I think the player didn't digest the artichoke =x 15:28

  • @danielfoutz
    @danielfoutz 6 лет назад +1

    Great stuff! Thanks!

  • @Neoangelhelm
    @Neoangelhelm 5 лет назад

    I am running into an issue where the numbers can go into the negative when I drop them outside of the inventory. Any idea's where I might have gone wrong?

    • @MrDiggidydave
      @MrDiggidydave 4 года назад

      I did too, but tinkered and i think this is the piece of code that it was.
      else if(ss_item != item.none) {
      //drop the item into the game world
      if(mouse_check_button_pressed(mb_middle)){
      inv_grid[# 1, selected_slot] -= 1;
      //destroy the inventory item if it was the last one
      if(inv_grid[# 1, selected_slot] == 0){
      inv_grid[# 0, selected_slot] = item.none;
      }

  • @deadpixstudios
    @deadpixstudios 7 лет назад +1

    Another amazing tutorial. Are you going to cover save and load the entire game and items you have? It would be awesome. Thank you!

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 лет назад +3

      Yes! At the moment I'm planning to do saving after we've implemented a couple more systems, so we have more complicated information to save (player stats, quest stages, etc).

    • @deadpixstudios
      @deadpixstudios 7 лет назад +1

      You are the best!

  • @Mystical-TEDDY_
    @Mystical-TEDDY_ 3 года назад

    Someone please help, I keep having this problem where my text goes up and I can't find a single piece of information out there telling me how to fix it

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

      You need to use draw_set_valign(fa_top) before you draw the text, this way the vertical alignment of the text will be fixed at the top anchor instead of the middle anchor

  • @lakesideview2203
    @lakesideview2203 7 лет назад +1

    Woo! This is so cool!

  • @impossibleexperiments
    @impossibleexperiments 5 лет назад +1

    Great stuff!

  • @Gassysamsquanch
    @Gassysamsquanch 5 лет назад

    when i run the game and open my inventory i get a error and it says this: unable to convert string ". " to float, any help?

    • @KamaruAshamae
      @KamaruAshamae 5 лет назад

      I just had this same issue. Check your Z and i numbers under item names and item descriptions so they match. var z = 0; i = 0; for the names, and var z = 1; i = 0; for the descriptions

    • @Gassysamsquanch
      @Gassysamsquanch 5 лет назад

      KamaruAshamae thank you, that seemed to work, I had the description z = 0;

    • @spiderdlh9905
      @spiderdlh9905 4 года назад

      copy and past this it shout fix it description = iinfo_grid[# 0, iitem] +": "+ iinfo_grid[# 1, iitem]; i also have a problem if you could help just find my comment if thats ok .

  • @spoke-te9oc
    @spoke-te9oc 7 лет назад

    Always very good !!

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

    as of this video we still havent used spr_inv_items_rows = sprite_get_height(spr_inv_items)/cell_size;

  • @YourBuddyDinec
    @YourBuddyDinec 7 лет назад +1

    Another amazing tutorial. I look forward to each. Have you ever considered becoming a coding teacher?
    I do have two questions though and that is how you can make it drop the whole stack at a time. I see how to pickup_slot = 0 but then how to you change the dropped item number into anything higher than 1? Also is it normal for the moue to have to be a good deal outside of the inventory to drop the item (though only on the left side)? It seems to need to be a slot outside the inventory to be considered not in invnetory.

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 лет назад +1

      Thanks so much :). I've always enjoyed teaching/tutoring, and I suppose this is my outlet!
      Q1) In the item dropping code, instead of just doing "-1", you would want to take away whatever the number of items that is currently stored in that slot. So you would access inv_grid[# 1, selected_slot] to get that number. It may be useful to store that number in a temporary variable so that you can use it later when you need to spawn the items, probably as a repeat loop, where the number of times you repeat is equal to that same number.
      Q2) Hmm, no! That sounds like there's a problem with the code that detects where the inventory is (near the top of the Step event), or with dropping the item.
      Hope that helps!

  • @ImKyleConway
    @ImKyleConway 6 лет назад +1

    Love the tutorials, any plans to make a tutorial on a quest system?

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  6 лет назад +2

      Yes! As we move on to NPCs, I'll be introducing a quest system.

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

    TOP VIDEO!!!

  • @larryteslaspacexboringlawr739
    @larryteslaspacexboringlawr739 7 лет назад

    thank you for gamemaker video

  • @Vazerr
    @Vazerr 6 лет назад

    If only it was for Game Maker Studio 1.4 :(