GMS 2 Resource file is malformed. Item with the same key exists?

Discussion in 'Programming' started by SupernaturalCow, Jan 11, 2019.

  1. SupernaturalCow

    SupernaturalCow Member

    Joined:
    Sep 11, 2016
    Posts:
    28
    The full error message is: 'Resource file is malformed 'scripts\init_sys_tray\init_sys_tray.yy' An item with the same key has already been added.' It pops up everytime I load the project file. I've tried running the Clean command, and I've tried removing 'init_sys_tray.yy' from Scripts, reloading, then putting it back, but it still comes up the same. Is there any way to flush duplicates from GM's file loading data structure?
     
  2. The Video Gamester

    The Video Gamester Member

    Joined:
    Dec 2, 2016
    Posts:
    40
    I had this happen a few weeks ago. I ended up resetting to an early version. I'm interested to see if there is a solution to this.
     
  3. SupernaturalCow

    SupernaturalCow Member

    Joined:
    Sep 11, 2016
    Posts:
    28
    No one knows? :confused:
     
  4. rIKmAN

    rIKmAN Member

    Joined:
    Sep 6, 2016
    Posts:
    3,527
    Sounds like there is a reference to the old .yy file somewhere causing issues or corruption.

    You could try importing your existing assets into a new project using a tool like GMS2 Resource Importer and seeing if that fixes it.
    Remember to make back ups before you start doing anything!
     
  5. SupernaturalCow

    SupernaturalCow Member

    Joined:
    Sep 11, 2016
    Posts:
    28
    We use a git repo so backups aren't the issue - the issue is that the duplicate key appeared a long time ago, and we've just been clicking past it. It's not a fatal error so I've never been too bothered by it, but I just wanted to know if it was possible to fix. Surely GM would have a fix for something like this? I'll look into the importer, but I was hoping to find a bug fix from YoYo, or something along those lines.
     
  6. rIKmAN

    rIKmAN Member

    Joined:
    Sep 6, 2016
    Posts:
    3,527
    You'd have to send your project in to YYG attached to a ticket for them to take a look at it I think, there is no fix all solution for project specific errors.
    Not sure how big your project is but searching through all the project files for any references to the problematic .yy file might be quicker.

    If your project is too big then maybe write a little tool to read the files and report back where the reference was found, although it would probably be quicker to just try importing everything to a new project and see if the error actually disappears first before trying anything like that.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice