Connecting Rooms Through Doors (Tutorial for GameMaker Studio 2)

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

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

  • @pedroantonio743
    @pedroantonio743 4 года назад +10

    it would not be more useful use global variables to transfer data?

    • @GameMakerStation
      @GameMakerStation  4 года назад +12

      It's easier to keep track of instance variables. You create an instance, put variables inside it, go to the other room, get the values back, and delete that instance. At that point you know that the variables are gone from memory. But if you create global variables, they stay in memory for as long as the game is running. It's also about encapsulating data in a proper container (here, the data carrier instance) so that it's easier to manage the transferred data when you have a lot of variables (like, in the tut we only have 2 variables, but what's to say you won't have 100 at some point, and even data structures?).

  • @ma_astro
    @ma_astro 9 месяцев назад +1

    severely underrated video. I had trouble finding a tutorial that worked much less one that provided a data carrier along with it. Give this dude a like!

  • @charKT-7461
    @charKT-7461 4 года назад +2

    8:43 you're the kind of person you wouldn't expect to make jokes like these and it's awesome when you do it

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

    Some of my doors work, but not others. When I touch the door, it just bounces me back to the same entrance of that door.

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

    targetEnter showing "unset" and "undefined" with players " START event" crashing game.
    any help would be appreciated.

  • @antonim8714
    @antonim8714 4 года назад +9

    Like for "More Doors": D

  • @-Russian_Knight
    @-Russian_Knight Год назад +1

    Братан, ты спас меня этим уроком! Я очень долго не мог решить эту проблему, пока не нашел твое видео! Ты лучший!

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

    Is there something bad about not using odata carrier to carry variables and just making the player persistent?

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

    It won’t let me change the type to resource

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

    GameMaker keeps telling me that obj_player.targetenter isn’t set before reading it. What’s the deal?

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

      I had the same problem and it was cus I misspelled something, if your still care try to fix any spelling issues

  • @wojak-sensei6424
    @wojak-sensei6424 8 месяцев назад

    Can you make a door that needs a key press to enter? Like "Press E to Enter Room" type of code?

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

    Hello, when i go to the second room and then i come back to the first one : "Layer system integrity compromised, instance 100011 not on layer 38" there's no more depth ordering, it's like cancelled, do you know what the problem is?

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

    I got an issue, when trying to move to a room with multiple doors, it always goes to the first door placed in that room instead of the original door, how can I fix?

  • @CalvinLol777
    @CalvinLol777 10 месяцев назад

    For some reason, when I go to add a variable to the door, the "add" button isn't popping up. Any idea to why this is happening???

  • @pfergusovegas
    @pfergusovegas 4 года назад +5

    And the winner of the best voice in a tutorial goes to... YOU! 😃👍

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

    Does the door/enter instance need to be assigned a sprite to work properly?

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

    the target enter stuff just doesn't work for me, says it's not set befor reading

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

    great video, but how can i change the room transition by pressing a button rather than just touching the doors

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

      its been a year so ig youve figured it out but for other people seeing this, simply put the following in the collsision event
      if keyboard_check_pressed(vk_space)
      {
      other.target_enter = target_enter;
      room_goto(target_room)
      }

  • @michaelox-long3268
    @michaelox-long3268 2 года назад

    Great video, had no idea what I was doing, this helped alot!

  • @OctoLink-qs3kg
    @OctoLink-qs3kg 2 года назад

    I have a question. So i used this tutorial in a project i am making with some friends that i plan to publish online and potentially make money off of. So considering how i used the tutorial, i am now curious if i even can do that. Obviously if needed i will give credit.

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

    When i close the game before enter in one of the doors, the game just crash, how i solve this?

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

    is it possible to make the door only bring you to other room when the player interact with it?

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

    PLS Help me !!!!!!
    I had a little house icon near my main room when I try to exit the room the scene stops and I am still seeing my main room.HOW I CAN GET RİD OF THIS LİTTLE HOUSE ICON NEAR MY ROOM!!!!

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

    When im going through my door it take me to the next room but my character is unseen.Can somebody help pls?

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

    Great tutorial! I had everything working with the rooms and doors but the moment I tried to carry the data over everything went broken on me and crashes every startup. I'm trying everything I can to fix this but I'm only on day two of doing this kind of stuff.

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

    Super nice and easy way of solving this problem👍🏻

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

    I tried to mix up your camera tutorial with this, and I have a strange problem - when player enters a new room, the view from the camera seems to narrow down about twice from the original size and stops following the player. What the problem could be?

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

      I had a similar problem, on the room start event try checking if the view is enabled or not, and if not, enable it:
      if !view_enabled
      {
      view_visible[0] = true;
      view_enabled = true;
      }

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

    i have an object in my room. if i take it and go to the next room, and back, my object will come back, and i don't want that. can you help me please?

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

      You can use this same method that is used for transferring score, and transfer a list of collectibles that exist within a room. Then when you re-enter a room, delete the existing collectibles and recreate those from the list that are registered as existing. Make sure to delete the list when it's no longer needed or you'll get memory leaks.

  • @76avram
    @76avram 3 года назад

    There is a weird issue with the collision event around 4:31 of this video. I modified the code for my own project so that instead of having a collide event checking for the player, I put an instance_place check into a step event, which kept giving me errors. Anyone have any idea why this might have happened?

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

      heres a uneducated guess: targetEnter on either the player or DataCarrier just doesnt work if its not set by the collide with player event (probably being set various times because its a step event and for some reason it goes back into not being set)
      addition: i think making so the player checks for the colision rather than the door might do something

    • @anonymone453
      @anonymone453 10 месяцев назад

      I'm a bit late to the party, but instance_place returns an instance ID, rather than place_meeting which returns true or false. If you're checking for a collision, you need to use place_meeting OR something like
      var getTarget = instance_place(x, y, oDoor); //store instance of oDoor at our coordinates in a variable
      if getTarget != noone //check to make sure that variable actually has an instance stored
      {
      //do code here
      targetEnter = getTarget.targetEnter; //set player's targetEnter to the instance's targetEnter
      }

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

      @@anonymone453 Speaking of late to the party, it only took me five months to respond to you! Anyway, your code worked beautifully. Thank you for saving me hours of frustration!

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

    when i enter the door, the next room loads but the player doesn't spawn.

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

      okay i figured it out but when i close the game without entering any door it crashes saying "variable .targetEnter was not set before reading it"

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

      k i cant have more than 1 door in each place with this system

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

    hi great tutorial. When i want to select a ressource for a variable i have "none" (but of course i do have some it just don't show up). Hoy could i fix that ?

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

      What do you mean? You should be able to select Asset/Resource as a type for your variable and then select an asset in the value column.

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

      This is late, so don't know if you still have this issue, but after you make the variable, and change the type to Asset, click on the little gear icon next to it, and select Rooms from the list that pops up. Hope this is helpful to someone.

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

    2:47 I dont have resourses

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

    how would you do it without the IDE? creating and accessing other rooms via code? if you were randomly generating terrain in each room and then created a 'door' to another room and back again.

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

      You can always create instances and set their variables through code. When you create an Enter instance in a room, you can store its ID which you can then assign to a door in some other room. But, since you are creating rooms at runtime I suggest you figure out some other way to connect your rooms that works perfectly as per your needs. You can discuss this in our Discord server: discord.gg/TykHyqK

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

      @@GameMakerStation Thanks fam

  • @me-me_IT
    @me-me_IT 11 месяцев назад

    thanks!!!!! It worked for me

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

    Thank you for saving my a lot of time !

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

    You deserved to be subscribed my Hindi friend

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

    Great video!!

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

    thanks a lot!

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

    Thank you very much for this

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

    now there are just unlimited amount of coins. i don't want that to happen. what can i do now, to make them dissapear after i take them once? pls help, it's for school. nvm i made it work

  • @cjtodd6244
    @cjtodd6244 4 года назад +3

    Creating an oDoor object? Sounds smelly

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

    it doesnt work

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

    THE VOICE

  • @loquendero-vi5sp
    @loquendero-vi5sp Год назад

    -hello, when my character goes trough the first door, the game changes to the next room (until this point everything is fine) but my character don't show up anywhere :(

    • @peterd677
      @peterd677 11 месяцев назад

      make sure you check mark "Persistent" in your player object