#define PRAGMA_PATH for published game

Posted By: Toon

#define PRAGMA_PATH for published game - 02/08/12 12:14

Hey,

I defined a path for my image-files and it all works fine, but how can I also make it work with the published game, because if I create a map 'images' in the .cd directory and put the images in there, the .exe can't find them.

This is my definition:
Code:
#define PRAGMA_PATH "images";



laugh Thanks for reading!
Posted By: Rei_Ayanami

Re: #define PRAGMA_PATH for published game - 02/08/12 12:19

You could create a wdl with the same name as your c that contains a PATH statement.
Posted By: Uhrwerk

Re: #define PRAGMA_PATH for published game - 02/08/12 15:41

You can use add_folder instead.
Posted By: sivan

Re: #define PRAGMA_PATH for published game - 02/08/12 20:36

or add to file names always absolute paths containing the subfolder name like "images\\yourpicture.jpg". can be simple to use this approach if you store in strings your subfolders, and use:
str_cpy( actualfilename , foldername );
str_cat( actualfilename , filename );

this way the compilation will result also in a cd folder without subfolders, but if you copy/move the exe and the dlls to your script folder it will work fine (normally the exe is also placed to script folder).
Posted By: Toon

Re: #define PRAGMA_PATH for published game - 02/09/12 15:39

Thanks for all the replies! laugh

How exactly do I use this function? I tried this but it does not work:

After the default.c include:
Code:
#define PRAGMA_PATH "images\\gui";



In top of the void main():
Code:
add_folder("images\\gui");



It does work when I run main.c but when I run the published version (.exe), the console reports the files not found...what am I missing here?
Posted By: Uhrwerk

Re: #define PRAGMA_PATH for published game - 02/10/12 01:13

Did you remember to copy those files over to the publishing directory?
Posted By: Toon

Re: #define PRAGMA_PATH for published game - 02/10/12 11:59

yep! smile
Posted By: Uhrwerk

Re: #define PRAGMA_PATH for published game - 02/10/12 13:09

Ok, then my only idea left is, that you could have called add_new() somewhere in your code.
© 2024 lite-C Forums