Posted By: CocaCola
save you.x in *.txt with ent_next doesen't work :( - 03/15/18 15:59
hi,
I m working on my 3dgs games an building a level editor.
Ich have try to save all parameter of my entitys in a txt file.
it doesent work after i start the "for" command with ent_next, i cant write in file X(
I m working on my 3dgs games an building a level editor.
Ich have try to save all parameter of my entitys in a txt file.
it doesent work after i start the "for" command with ent_next, i cant write in file X(
Code:
/////////////////////////////// #include <acknex.h> #include <default.c> #include <strio.c>; /////////////////////////////// function open_model() { wait(1); ENTITY* TestEnt; char* filename = file_dialog("Replace model","*.mdl;*.hmp;*.wmb"); if (filename) { TestEnt = ent_create (filename,camera.x,NULL); } } function main() { STRING* s = " "; VECTOR temp; while(1){ //load a mdl if(key_o){ open_model(); while(key_o)wait(1); } // save you,x in mydile.txt if(key_s){ STRING* s = " "; for(you = ent_next(NULL); you!=NULL; you = ent_next(you)){ str_for_num(s,you.x); } var filehandle = file_open_write ("myfile.txt"); file_str_write(filehandle,s); file_close (filehandle); while(key_s)wait(1); } wait(1); } }