i would like to store some external graphics in folders and create dynamic sprites from them at runtime, eg:
Game.SetSaveGameDirectory("Graphics");
String Filename="Bla.bmp";
String Path=String.Format("$SAVEGAMEDIR$/%s", Filename);
DynamicSprite *sprite=DynamicSprite.CreateFromFile(Path);
in this case sprite gives me a null pointer error but File.Exists(Path); tells me that the file is there. do only the "FILE" commands know "$SAVEGAMEDIR$"? or is there some kind of trick i am missing?
thanks for your help!
Yes, according to engine code, in AGS 3.2.1 $SAVEGAMEDIR$ and $APPDATADIR$ are supported only by 1) File object 2) ListBox (to fill in directory contents).
Do this instead:
String dir = "Graphics";
String filename = "Bla.bmp";
String path = String.Format("%s/%s", dir, filename);
DynamicSprite* sprite = DynamicSprite.CreateFromFile(path);
as i am reading this i am asking myself why i haven't thought of that myself? :P sorry for bothering you and thanks for your help!