Forum

request help! autosave system

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

request help! autosave system

Postby thorn3001 » Mon Aug 06, 2012 4:52 pm

hello everyone,
I just have a question, anyone know how to add an autosave system?
Actually I am working in a single player campaign project with Darkplaces engine.

thanks for your helping.

thorn3001
Thorn
User avatar
thorn3001
 
Posts: 29
Joined: Tue Jun 28, 2011 6:09 am
Location: Bogotá, Col

Re: request help! autosave system

Postby gnounc » Mon Aug 06, 2012 8:35 pm

add a trigger brush and have its touch function be

stuffcmd(other, "save autoSave");

someone feel free to correct me if im wrong. but im pretty sure that covers it.
User avatar
gnounc
 
Posts: 424
Joined: Mon Apr 06, 2009 6:26 am

Re: request help! autosave system

Postby Dr. Shadowborg » Mon Aug 06, 2012 8:45 pm

You need to add some QuakeC code such as a trigger_autosave with a stuffcmd / localcmd.

i.e. something like this:

Code: Select all
void() trigger_autosave_touch =
{
 if(other != player) // non-player entites can't trigger
 return;
if(self.cnt == TRUE) // trigger only once
 return;

self.cnt = TRUE;
localcmd("save autosave.sav\n");
};

void() trigger_autosave =
{
 if(deathmatch || coop) // saving in multiplay and coop = bad.
  {
   remove(self);
   return;
  }

 InitTrigger();
 self.touch = trigger_autosave_touch;
};


Add the trigger_autosave brush to your maps where you want your autosaves, then add some code to the stuff relating to dead players to autoload the autosave. (I'll let you figure out how to do the autoloading of your autosave)

EDIT: Oh darn. Ninja'd.
User avatar
Dr. Shadowborg
InsideQC Staff
 
Posts: 1110
Joined: Sat Oct 16, 2004 3:34 pm

Re: request help! autosave system

Postby thorn3001 » Mon Aug 06, 2012 9:25 pm

ok thank you Dr. Shadowborg working......
Thorn
User avatar
thorn3001
 
Posts: 29
Joined: Tue Jun 28, 2011 6:09 am
Location: Bogotá, Col


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest