Jump to content

Home

File loading.


GangsterAngel

Recommended Posts

Posted

is there no way to load a file thats not in a PK3 ?

because ive just gone through quite abit of code, and coded a saving feature and then realsied it dosent load the files its saved unless they are PK3d

Posted

its possible to load txt-files. some mods already do that.

also you could integrate SQL-database to your mod if you meant that saving thingie to accounts :p

Posted

i couldent intergrate SQL cuz i dont know how , and i dont REALY want someone to tell me its 'posible' i want them to tell me how lol. i know how to save the files , and how to load files that are in PK3s . but i dont know how to load a file thats not in a PK3.

  • 1 month later...
Posted

Isn't there a way to read a non-pk3'd file on a non-pure server? I mean it reads config files so why can't it read another?

 

...uh, or are you talking about reading files from the client machine, or something else?

Posted

you can either

 

a) look through the released quake 3 renderer source and find the function prototype that you need and hope you can call it in raven's jka'd version

 

b) call /reconnect and it will re-read all the pk3s and add new ones

Posted

or use one of the following file extensions:

 

  • .game
  • .dat
  • .cfg
  • .menu

 

i think thats all thats available for reading on pure servers meaning .txt is not afaik it doesnt, so if ur gonna use a txt file just name it dat or smth.

Posted

Here is the code Im using in my mod to save the player data files (slightly modified so it is a stand alone function, real one relies on some global vars)

 

qboolean SaveFile(char FileName[MAX_STRING_CHARS], char FileSaveData[MAX_STRING_CHARS]){
            FILE *TheFile;
if(strlen(FileSaveData) <= 0) return qfalse;
if(!FileName || !FileName[0]) return qfalse;
TheFile = fopen(FileName, "w");
if(!TheFile) return qfalse;
fwrite(FileSaveData, sizeof( char ), strlen(FileSaveData) , TheFile);
fclose( TheFile );
return qtrue;
}

 

Im not shure if it will work with any platform besides windows though...

 

try taking a look at the trap_FS stuff.

 

and im fairly shure the game can read any file, regardless of its extention

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...