VSCode quicktest crashing because image supposedly doesn't exist

I’m using the CS extension in VSCode and recently added chapter headers to my game. It runs fine in a playtest, so I definitely have the right path and name and everything, but as soon as I do a quicktest I get this error and it crashes.

I tried putting the images in an images folder and changed the code accordingly

*image images/TitlePage.png center

But then it doesn’t show up at all in a playtest. I’m also not sure how that works uploading to COGDemos because I don’t see a folder option there.

Right now I just have the images commented out for debugging but that’s kind of annoying.

I am newbie please help!

I believe quicktest uses relative path to the script, so it’s better to use an absolute path to the file (C:\Users\your-user-name\etc). For Cogdemos, you cannot have it on subfolders.

2 Likes

Thanks for the response! I toyed around with that but was still getting some errors, so I tried changing the names of the pictures so there’s no lower case and now it works. I don’t really get why but I’m happy :slight_smile:

Good to know about Cogdemos too, I’ve been thinking of organizing better but I guess I just won’t lol

2 Likes

You can create a variable to have dynamic routing.

*create assets "C:\Users\etc\my-game\assets\" 

Then use it in game:

*image {assets}title-page.png

When uploading to cogdemos, just replace the path in the variable to an empty string.

Fair warning, I’m writing it from the top of my head from my phone, so there may be something wrong.

1 Like

With the file name in lower case, it’s actually working pretty well with just the regular code:

*image title_page.png center

That’s a good thing to keep in mind though, thanks. Always more to learn about coding

This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the moderators.