GameMaker Studio 2 (GMS2): How to painfully fix inheritance if you try to create a Parent Room AFTER you created a To-Be-Child Room

What You SHOULD Do

  • When creating PARENT-CHILD relationships, ALWAYS make the PARENT first and use the right-click context menu to create a CHILD from that PARENT in the Asset Browser.

What Happens If You DON’T Do That

  • Otherwise, if you set an object to be a PARENT or CHILD after the fact, GM will FORCE you to have to MANUALLY set EVERY PARAMETER to inherit by yourself. In other words, nothing will automatically be inherited. This is probably because GM doesn’t want your game to become completely broken by automated inheritance and wants you to knowingly set what should be inherited or not. However, this means PARENT-CHILD relationships essentially become USELESS and do not save any time since you have to set everything yourself. If the inherited property doesn’t match the original, it might not even allow you to select the INHERIT button at all.
  • If you ACCIDENTALLY change an inherited property, it will change the property WITHOUT a warning, FORCE UNINHERITENCE, and DISABLE the INHERIT button. Changing the parameter back to the original will NOT re-enable the INHERIT button, EVEN if you completely restart GM.

Painful Solutions

If the INHERIT button does get disabled, here’s how to fix it.

  1. Manually look for the .yy file in the rooms directory of your project.
  2. Open this in a text/code editor and look for the parameter you want inherit.
  3. Manually set "inherit": to true.
    • You don’t need to set anything else specifically; just set the inherit property and the others will be fixed after restart.
  4. Restart GM.
    • Actually, you don’t have to restart GM fully. You just have to restart the Room Editor, by selecting a different room and then returning to the one you edited. It is still probably a good idea to restart anyway though, in case there are some other things that need to get reset.
    • CAUTION: There is a possibility GM will stupidly break all your instance links. The instance will be listed in the IDE, but the objected will not actually be scheduled to be created. * Look in the same .yy file, for the following code and make sure your instance is there. If it isn’t, you might have to manually add it to the room again, so it will be HUGE PAIN.
      "instanceCreationOrder": [
          {"name":"inst_7DF93CD8","path":"rooms/rm_game_start/rm_game_start.yy",},
      ],
      

GameMaker Studio 2 (GMS2): How to Create Nicer Mobile Icons on Windows 10

  1. Download Android Studio.
  2. Create a trash empty Android project and note where it is stored on your computer.
    1. You NEED to do this or else the option for Image Asset Studio will not show up.
  3. Create your icon using Image Asset Studio and save.
    1. https://developer.android.com/studio/write/image-asset-studio
    2. Unfortunately, it doesn’t look like GMS2 supports the background color option nor the round icon options. There doesn’t seem to be a good plug for the generated xml file in GMS2’s .yy file for the Android options. Eventually, I will get to how to get around the background color problem in this post; however, unfortunately, I don’t know if there’s a workaround to the round icons.
  4. Close Android Studio and navigate to your Android project folder and look for that res folder with all your .png files.
    1. Right now, the path is \app\src\main\res.
    2. You could just search .png.
  5. Open GMS2 and go to your Android Game Options.
    1. Right now, I find it in the Quick Access Panel in the Asset Browser.
      1. STRANGELY, this is different than the “Game Options” available from the three bars in the top right of the Asset Browser, so be sure to use the correct one.
  1. In the Adaptive Icons’ section, generate some “trash” icons.
    1. If you would like a background color, this is where you can generate it.
      1. Open up Paint (or whatever image creation program you have that makes a .png) and create a image of the background color you want.
        1. The size of this color “swatch” doesn’t matter, as long as it fills the whole image (i.e. use the bucket tool).
      2. Use this swatch as your background source image when generating your “trash” adaptive icons.
    2. https://docs2.yoyogames.com/source/_build/2_interface/3_settings/game_options/options_android.html.
  2. Open your GMS2 project folder and navigate to the Android options.
    1. Right now, they are at \options\android.
  3. In GMS2, there are three folders for your Android icons:
    1. icons
      1. Non-adaptive icons required for devices that don’t support Adaptive Icons (i.e. older than Android Oreo = 8.0 = API level 26).
    2. icons_adaptive
      1. FOREGROUND images for adaptive icons.
    3. icons_adaptivebg
      1. BACKGROUND images for adaptive icons.
      2. If you generated from a color swatch, you can see the result here.
  4. Now, you need to go around REPLACING all the images in GMS2 with all the respective images in the trash Android project.
    1. Images can be matched by hovering over the image and checking the image’s pixel-by-pixel size.
    2. Make sure you keep the naming scheme of GMS2.
    3. Right now,  here are some example mappings from Android to GMS2.
      1. mipmap-hdpi\ic_launcher.png ==> icons\hdpi.png
      2. mipmap-hdpi\ic_launcher_foreground.png ==> icons_adaptive\hdpi.png
    4. You will notice that the Android Studio Image Asset Studio does NOT produce the ldpi size.
      1. To generate an ldpi size, make a copy of your xxxhdpi image and resize it in Photos (or your image editing program) to the ldpi size.
        1. https://www.groovypost.com/howto/use-windows-10-photos-app-to-resize-images/
      2. To determine the ldpi size, just look at the size of the GMS2 generated file.
      3.  Now for EACH of the THREE GMS2 icons folders, you can xxxhdpi-copy, resize, replace the GMS2-generated ldpi.
    5. You MAY not want to use the Android Image Asset Studio generated images for the lower resolution non-adaptive icons, because your final centered image might be too small.
      1. In this case, just choose whatever image you would have used as the adaptive foreground or whatever new image you want and resize it appropriately.
      2. If you don’t want a flat square icon, make sure you use transparency for the unused part of your icon canvas.
  5. RELOAD GMS2 and you can preview the new icons in the Android Game Options Adaptive Icons section.
    1. Do NOT click “Generate”. Otherwise, all your hard work in replacing all your images will be overwritten.
  6. Compile and test!
    1. Close your Image editor, Android project folder, and GMS2 project folders so you don’t run into file-access conflicts (i.e. errors) during compilation.
    2. Test in emulator before Android Oreo for testing non-adaptive icons.
    3. Test in emulator at or after Android Oreo for testing adaptive icons.
    4. Test on a REAL DEVICE if you have the chance!