Page 1 of 1
saving and loading variables to a text file i/o
Posted: Mon Jun 08, 2009 5:54 am
by metalmodman
I'm working on a project for quake3 and I'm stuck I have no idea how to save/load variables to txt. can any one point me to a tutorial that might help me out? thanks
Posted: Mon Jun 08, 2009 6:35 am
by metlslime
There is already code in the engine to read and write config.cfg; that might be suitable to what you're doing.
Posted: Tue Jun 09, 2009 3:27 am
by metalmodman
im tryng to make every player log in with a name and password so they can load their custom class. Think this would be alright with server cvars?
Posted: Tue Jun 09, 2009 6:10 am
by Spike
There's an fopen, a read, a write, and a close builtin/traps.
Ideally you'd have the config saved on the client, and have that transfered to their server of choice, assuming its a CuTF sort of mod. But if its a long-term rpg sort of mod then yeah, needs to be serverside.
just look in cg_syscalls.c or whatever its called for the server. It might give you some ideas.
Or yeah, just use the client's userinfo by setting the cvars to archived.
Posted: Tue Jun 09, 2009 7:06 am
by metalmodman
ah perfect thanks yeah its a rpg mod.