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
request help! autosave system
Re: request help! autosave system
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.
stuffcmd(other, "save autoSave");
someone feel free to correct me if im wrong. but im pretty sure that covers it.
-
- InsideQC Staff
- Posts: 1120
- Joined: Sat Oct 16, 2004 3:34 pm
Re: request help! autosave system
You need to add some QuakeC code such as a trigger_autosave with a stuffcmd / localcmd.
i.e. something like this:
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.
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;
};
EDIT: Oh darn. Ninja'd.