• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Windows Project Load Failed (GMS2)

U

Ukaygee

Guest
Hey, so I tried loading my project, and this is the error I was thrown...

Anyone have any ideas?
(Forgot to backup my project, definitely will be doing from now on)
 

Mick

Member
Open the project.yyp file in a text editor, the select and copy all text. Paste it into the json validator and click validate json.
 

Mick

Member
Ok, well there's your problem. The project file has been erased for some reason. Not very nice...
 

Mick

Member
You could create an empty project and manually add the objects etc. into it. This needs manual editing of the project.yyp file.
 
U

Ukaygee

Guest
Could you show me how to do this? I tried just moving the objects folder from that project to another put that didn't work xD
I really appreciate this, thank you so much
 

Mick

Member
Are the other files intact, I mean all the .yy files for objects etc. or are those also empty?
 
U

Ukaygee

Guest
The .yy files for the objects are not empty, and the folders for each object also have files of all their events too.
Inside the .yy files looks like this:
upload_2018-4-17_18-53-2.png
 

Mick

Member
Ok, that's good. Save a backup of your project now before you continue (to a zip file or something). I can explain what you need to do to get your objects etc. to a new project.

EDIT: For some reason I didn't think about the add existing sprite, sound etc. yesterday evening, probably since the project file was erased, but it should work instead of this more complicated method I'm describing below.
 
Last edited:

Mick

Member
Create a new project and copy all the resources into the folder structure (like you already did).

Then you need to manually add references for the resources to the project.yyp file: https://forum.yoyogames.com/index.php?threads/rooms-dissapearing.45938/#post-283041 for all objects and other resources, are they many? You obviously don't need to do the first step of searching for the resource. The resource types are:

Code:
GMSprite
GMTileSet
GMSound
GMPath
GMScript
GMShader
GMFont
GMTimeline
GMObject
GMRoom
GMIncludedFile
GMExtension
First try adding one object so you understand the process, then do the rest.

By the way, I have made a tool that can import resources from another project, but it needs the project file. I will probably make it possible to import from file structure directly but this will take time though.
 
Last edited:
U

Ukaygee

Guest
There are quite a few, all I have to do is add another one of these for each resource?:
Code:
"resources": [
        {
            "Key": "01795780-afca-4371-975b-f77362883af9",
            "Value": {
                "id": "70eb6db1-d9ee-4c26-9cb3-a9ec9a42693f",
                "resourcePath": "views\\01795780-afca-4371-975b-f77362883af9.yy",
                "resourceType": "GMFolder"
            }
        },
But change the values?
 

Mick

Member
There are quite a few, all I have to do is add another one of these for each resource?:
Code:
"resources": [
        {
            "Key": "01795780-afca-4371-975b-f77362883af9",
            "Value": {
                "id": "70eb6db1-d9ee-4c26-9cb3-a9ec9a42693f",
                "resourcePath": "views\\01795780-afca-4371-975b-f77362883af9.yy",
                "resourceType": "GMFolder"
            }
        },
But change the values?
Yep, basically. The "Key" GUID should be copied from the topmost "ID" GUID in the resource.yy file, the "Value"/"id" GUID should be generated (with the online generator), the resourcePath needs to be set and resourceType needs to be edited to match the resource type.

This does all seem rather tedious, could I use that tool? :c
Yes it probably is. Maybe there is a better way that I don't know of. About my tool: You could of course use it later, but the problem is I don't know when that needed functionality will be ready.
 
U

Ukaygee

Guest
Hey, I'm struggling to understand what to change the "resource-path" to
 

Mick

Member
Hey, I'm struggling to understand what to change the "resource-path" to
Taking objects as an example it should be "objects\\objectname\\objectname.yy", two backslashes (the first one is the escape character), it is the relative path to the resource.yy file, so instead of objectname, use the name of the object.
 
U

Ukaygee

Guest
Ok, I understand, thank you so much! I really appreciate it!!

*** NEVERMIND ***

Actually, I have an issue. I added this:
Code:
{
            "Key": "c396067b-2ea2-41f8-b7fa-86d148287082",
            "Value": {
                "id": "a30303fe-e102-42e7-bd2d-abd75040b83f",
                "resourcePath": "objects\\oBalloon,oBalloon.yyp",
                "resourceType": "GMObject"
            }
        }
To the .yyp file, and open the project, yet the object isn't there
 
Last edited by a moderator:
U

Ukaygee

Guest
Yes, that was a mistake, now the project is just closing as soon as I try to open it
 

Mick

Member
Did you add commas between the resource "blocks"? Between every:
Code:
{
            "Key": "c396067b-2ea2-41f8-b7fa-86d148287082",
            "Value": {
                "id": "a30303fe-e102-42e7-bd2d-abd75040b83f",
                "resourcePath": "objects\\oBalloon,oBalloon.yyp",
                "resourceType": "GMObject"
            }
        }
 

Mick

Member
AH! Of course, thank you! I'll let you know if I have any more issues xD
Did it work out for you? I think I got my tool to import these rogue resources now already, I need to test it a little more and upload it tomorrow though.

EDIT: Doh! I had totally forgot about the add existing sprite, sound etc. in GMS. You can, one by one, add existing resources from another project. Because your project file was erased I somehow didn't think about this possibility. Anyway you got an insight into the project files by doing it this way. My resource importer tool will soon allow to import multiple rogue resources at once.
 
Last edited:
U

Ukaygee

Guest
Did it work out for you? I think I got my tool to import these rogue resources now already, I need to test it a little more and upload it tomorrow though.

EDIT: Doh! I had totally forgot about the add existing sprite, sound etc. in GMS. You can, one by one, add existing resources from another project. Because your project file was erased I somehow didn't think about this possibility. Anyway you got an insight into the project files by doing it this way. My resource importer tool will soon allow to import multiple rogue resources at once.
I've imported all of the resources i need, but when i try to run the project, i get an error saying Root element is missnig...
 

Mick

Member
You need to use the import "rogue" resources (down left). Browse to for example the objects folder of your broken project and select all object folders there. The source project which you tried, requires a working project.
 
C

Creeper Bones

Guest
I have the same problem but im not as advanced, could you help me?
 

chamaeleon

Member
I have the same problem but im not as advanced, could you help me?
While you're waiting for assistance what are you doing right now to protect yourself from future mishaps?

Edit: Also it is preferable to start your own thread instead of digging up something that is a year old.
 
C

Creeper Bones

Guest
i'm going to make backups for sure, i already made a copy of my current not working project.
im kinda new to this stuff, usually i can fix my problem easy but this seems harder and i can't lose to mess this up.
 

Mick

Member
i'm going to make backups for sure, i already made a copy of my current not working project.
im kinda new to this stuff, usually i can fix my problem easy but this seems harder and i can't lose to mess this up.
Give my GMS2 Resource Importer tool a try, it's relatively easy to use. Create a new project, save it and open it as destination in the tool. Then you use the import "rogue" resources button to import the resources from the broken project. You can import all sprites in one go, then sounds etc.
 
C

Creeper Bones

Guest
It worked, thank you so much, you are a real life saver. This is my first game and I've spent hours learning and building this game by myself, I was really worried I'd lost everything. You're the best!
 
Top