Rollback - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods (https://www.frictionalgames.com/forum/forum-35.html) +--- Thread: Rollback (/thread-8302.html) |
Rollback - Synopsis - 05-28-2011 Hi everyone. First of all I'd like to apologise if this problem had already been solved before. I found multiple checkpoint-related threads but I didn't find solution to my problem. Problem: Let's say I have a straight hall running from west to east. In the eastern side of the hall is a spawn point. Somewhere in the middle of the hall is an area that triggers a cave-in in the western side of the hall (preventing player from escaping to previous room) and it also triggers a grunt in the eastern side that automatically goes after the player. If the player died, I want him to spawn at the very beginning of the room, before the cave-in area. Problem is I want all events that happened after the player entered the room till he died to be resetted. (Therefore all flashbacks, locked doors, lit lamps, used tinderboxes, cave-ins are returned back to their initiate state. I sincerely hope it's possible. Thanks in advance. -Synopsis RE: Rollback - Khyrpa - 05-28-2011 I guess u can do that by setting for example the cave in to unactive and reactivating the callbacks that triggers all the stuff in the checkpoints Callback syntax RE: Rollback - Synopsis - 05-28-2011 Oh, I really hoped there would be an easier way to achieve this. Is there a specific function to restore destroyed entities or Callbacks that were meant to be disabled after they were once triggered? RE: Rollback - Rownbear - 05-28-2011 If you just want to stop the player from getting back past the rocks you can put out a playerblock there and have the script activate it so it's impossible to walk back again. Atleast what I got out of that to be the problem EDIT: Oh you mean like if the player dies the whole map reloads? I tried looking into like "if player health" stuff but I couldnt find a solution to that either. if anyone more experienced know this I'd be glad to hear it aswell. RE: Rollback - Synopsis - 05-28-2011 Yes, the problems is how to reload the entire map. Everytime the player dies he appeares behind the cave-in, unable to move further. This can, however, be easily solved by setting new spawn-point. But in this case, the grunt that killed the player magically disappears. (I need the grunt, because he drops story related item). RE: Rollback - Khyrpa - 05-28-2011 (05-28-2011, 02:21 PM)Synopsis Wrote: Yes, the problems is how to reload the entire map. CheckPoint ("yourmap", "the spawn you wanted", "RedoScripts", "", ""); void RedoScripts(string &in asName, int alCount) { SetEntityActive("thecaveinthing", false); put here the callbacks and things you want to happen again. I'm not sure if callbacks stack btw } nor do I know if the grunt can be activated again.. hmm RE: Rollback - Synopsis - 05-28-2011 Umm, just one more question. Since all callbacks and states of all objects are specified in the OnStart() function, can't I just call it? void RedoScripts(string &in asName, int alCount) { OnStart(); } Or does it have any drawbacks? RE: Rollback - Khyrpa - 05-28-2011 wut the hell I wouldn't do that, just copy the callbacks and stuff from OnStart into that |