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

Adding sprites using .ini

S

Sidney_Smi

Guest
The title is pretty self explanatory. I'm designing a game that is fully "moddable", as in every variable is saved inside a .ini file. This is nice but to be fully moddable, I need to be able to select a sprite from a path set in the .ini file. Now, I've seen the code to add in the new sprite, but I'm not very familiar with it. Also, I am needing it to set a default path to where the normal sprite is, or at least set it to the default sprite, I can do that with an if statement though. So my first question, how do you use the sprite_add function, and my second question, is there a path where all the sprites are saved when you install the game through an installer?
 
R

rui.rosario

Guest
is there a path where all the sprites are saved when you install the game through an installer
If I'm not mistaken Sprites are always included in the executable itself, regardless of installation method. So you would get the default Sprites inside the executable, always available, and the "modded" sprites would need to be loaded from disk.

On a side note, please be aware that dynamic Sprites created with sprite_add will have an individual texture page for themselves. So while you could have for example 30 Sprites defined in GM:S on a single texture page, if you load all 30 dynamically you will end up with 30 texture pages. This will affect the performance a lot, if you're not careful. So you might want to use alternatives to a single image loading scheme.
 
S

Sidney_Smi

Guest
I'm seeming to have trouble setting a global.variable string set as the location, can someone else try?
 
A

Aura

Guest
Please post the complete code, or we won't know what you are doing wrong. ^^'
 
Top