request help! autosave system

Discuss programming in the QuakeC language.
Post Reply
thorn3001
Posts: 29
Joined: Tue Jun 28, 2011 6:09 am
Location: Bogotá, Col

request help! autosave system

Post by thorn3001 »

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
gnounc
Posts: 428
Joined: Mon Apr 06, 2009 6:26 am

Re: request help! autosave system

Post by gnounc »

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.
Dr. Shadowborg
InsideQC Staff
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Re: request help! autosave system

Post by Dr. Shadowborg »

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.
thorn3001
Posts: 29
Joined: Tue Jun 28, 2011 6:09 am
Location: Bogotá, Col

Re: request help! autosave system

Post by thorn3001 »

ok thank you Dr. Shadowborg working......
Thorn
Post Reply