Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
To have all saves canceled if you die..?
Hardarm Offline
Posting Freak

Posts: 891
Threads: 39
Joined: Apr 2011
Reputation: 43
#1
To have all saves canceled if you die..?

Is it possible to save, use save zones etc, but if you die, saves are canceled?
--

If not, how can I flow a story where you could possibly die? I think the respawn it's gonna be really immersion breaking but still I'm trying to make a medium long story and I don't want to ask players a lot of their time in a row for a story.

Yes, i'm making a Full Conversion.

Notes: I want NO "Save and exit" to be used, instead the player will use AutoSaves, and these saves are deleted/not accessible once the player dies.

listen to boards of canada
(This post was last modified: 11-14-2012, 11:41 PM by Hardarm.)
11-14-2012, 11:30 PM
Website Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#2
RE: To have all saves canceled if you die..?

Firstly, this is only possible in a full conversion. It is also probably only possible because of the constraint of "disabling save and exit".

"Deleting" saves:
This can be done with some hackery as outlined in the following steps:
  1. Detect if the player has died
  2. Set a global variable called "player dead". If the player loads a save and this variable is set, jump to step 3.
  3. Make N auto-saves in rapid succession (this may have to be on a timer). N is "max number of save files" as defined by "MaxAutoSaves" in "game.cfg", section "saving". You will probably want to reduce N to be about 5 or so (from 20!) to speed up save deletion and not spam file writes too much.
  4. Transition to a game-over map with the map text "Game over"
  5. Save N times again (So the player sees "Game over" when they look at the loading screen).
  6. Do what you want (e.g. ClearSavedMaps() & reset at map 1, using the global variable as a marker to display some "you died the game has restarted" events).
Note: we do N auto-saves before the map transition to prevent the player alt+f4ing the game during the loading screen. The N saves in step 5 are cosmetic (and prevent N saves occuring each time the player loads a dead save).

Stopping "Save and Exit":
This is fairly simple but requires a custom base_english (or whatever language you are using) file:
  1. Create a copy of base_english.lang file, and point to it using your main_init config file
  2. Change the "ExitAndSave" entry ("Main Menu" Category) to empty.
Detecting saves:
The following code will detect if a save has been loaded, this is useful in step 1 incase the player quits before the saves had time to be cleared:
bool loaded=true;
void loadTester(string &in asTimer)
{
  if(loaded)
    {
      loaded=false;
      /* load has happened */
    }
  AddTimer(asTimer,0.1f,"loadTester);
}
void OnEnter()
{
   loaded=false;
   loadTester("loadTimer");
}


Both of these ideas are completely untested - so good luck.
(This post was last modified: 11-15-2012, 12:03 AM by Apjjm.)
11-14-2012, 11:56 PM
Find
Hardarm Offline
Posting Freak

Posts: 891
Threads: 39
Joined: Apr 2011
Reputation: 43
#3
RE: To have all saves canceled if you die..?

Thanks! will try tomorrow Wink

listen to boards of canada
11-15-2012, 12:11 AM
Website Find
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#4
RE: To have all saves canceled if you die..?

Keep in mind that chasers in Amnesia can move unfairly fast - faster than the player if they are allowed to pick up speed. Escaping them is sometimes just a matter of luck. Consider lowering their top speed somewhat if you want to make things fair.

Noob scripting tutorial: From Noob to Pro

11-15-2012, 08:20 AM
Find




Users browsing this thread: 2 Guest(s)