Antikore
Member
I'm actually making a game. When you play it, at the start, a starting code runs for creating base files and stuff that will be needed when you're in the game.
While all things work properly I think, the part that I save a few sprites to one of the folders isn't working.
These files are saved on a previously empty folder, then they will be loaded by a list, and the game runs.
All except the first thing works. I've tried to search on the forums and I haven't found anything, the game still runs, and the menu takes some of those images, but as these images aren't saved, all shows up a black sprite.
Code:
obj_startup_controller - create event - executed in the first room of all the game run.
What I've tried:
While all things work properly I think, the part that I save a few sprites to one of the folders isn't working.
These files are saved on a previously empty folder, then they will be loaded by a list, and the game runs.
All except the first thing works. I've tried to search on the forums and I haven't found anything, the game still runs, and the menu takes some of those images, but as these images aren't saved, all shows up a black sprite.
Code:
Code:
if (!directory_exists(working_directory+"saves\characters"))
{
directory_create(working_directory+"saves\characters");
if (!file_exists(working_directory+"saves\characters\blue_block.png"))
{
sprite_save(spr_blue_block,0,working_directory+"saves\characters\blue_block.png");
}
if (!file_exists(working_directory+"saves\characters\red_block.png"))
{
sprite_save(spr_red_block,0,working_directory+"saves\characters\red_block.png");
}
}
What I've tried:
- I found some lexical issues on the directory, I corrected them, they don't fixed the problem.
- I read the docs, sprite_save() and should work like this (I think).
- I've tried to remove the .png part from the file name, as the sprite_save only saves png, I thought might work, but it doesn't work.
- I removed the folders, obviously, multiple times, as this is only executed if the folder wasn't created yet.
- I searched on the directory, and yes, no files were in the folder.
- Windows 10
- GM: Studio v1.4.1804 Standard Edition