• 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!

Legacy GM Importing user-created sprites problem

W

WolfCorp

Guest
Hello everyone.
I would like to use user-created images as sprites, following this simple pattern:
-Once the .png file is created, it can be in any directory, so I use get_open_filename() to ask
the user to find the file that was created.
-I put get_open_filename() as the first sprite_add() argument, so selecting the image will add it to
the game as a sprite;
-So, in-game, It opens up the dialogue box and I choose the image (.png) that I want to add as a sprite.

Now it comes the problem.
Game Maker just doesn't let me load the file, I think because of GM:S sandboxing. It keeps saying:
Error! not allowing save with filename 'C:\Users\wolfcorp\Downloads\spritefile'
Then, I don't know what to do now, because I would really like to have this feature in my game,
so I'm asking to you now if you know or may suggest a solution to my trouble.

Here's the code I'm using; I put it in the mouse_left_pressed event of an object (a button):
Code:
 sprite_add(get_open_filename("image file|*.png",""),1,true,false,16,24)
Thanks in advance to everyone helping me!
 
Last edited by a moderator:
Please post the exact code you are using.

What you are describing *should* work, I do that in my projects.

So post all the relevant code. Put the code inside [ c o d e ] ...your code... [ / c o d e ] tags (minus the spaces)
 
Top