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
Rollback
Synopsis Offline
Junior Member

Posts: 4
Threads: 1
Joined: May 2011
Reputation: 0
#1
Rollback

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
05-28-2011, 01:04 PM
Find
Khyrpa Offline
Senior Member

Posts: 638
Threads: 10
Joined: Apr 2011
Reputation: 24
#2
RE: Rollback

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
(This post was last modified: 05-28-2011, 01:19 PM by Khyrpa.)
05-28-2011, 01:18 PM
Find
Synopsis Offline
Junior Member

Posts: 4
Threads: 1
Joined: May 2011
Reputation: 0
#3
RE: Rollback

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?

05-28-2011, 01:43 PM
Find
Rownbear Offline
Member

Posts: 157
Threads: 13
Joined: Apr 2011
Reputation: 2
#4
RE: Rollback

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 Smile

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.

(This post was last modified: 05-28-2011, 01:58 PM by Rownbear.)
05-28-2011, 01:56 PM
Find
Synopsis Offline
Junior Member

Posts: 4
Threads: 1
Joined: May 2011
Reputation: 0
#5
RE: Rollback

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).
05-28-2011, 02:21 PM
Find
Khyrpa Offline
Senior Member

Posts: 638
Threads: 10
Joined: Apr 2011
Reputation: 24
#6
RE: Rollback

(05-28-2011, 02:21 PM)Synopsis Wrote: 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).

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
(This post was last modified: 05-28-2011, 02:30 PM by Khyrpa.)
05-28-2011, 02:30 PM
Find
Synopsis Offline
Junior Member

Posts: 4
Threads: 1
Joined: May 2011
Reputation: 0
#7
RE: Rollback

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?
05-28-2011, 02:42 PM
Find
Khyrpa Offline
Senior Member

Posts: 638
Threads: 10
Joined: Apr 2011
Reputation: 24
#8
RE: Rollback

wut the hell Big Grin I wouldn't do that, just copy the callbacks and stuff from OnStart into that
05-28-2011, 02:44 PM
Find




Users browsing this thread: 2 Guest(s)