[SCRIPT] Checkpoint help - 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 - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html) +---- Thread: [SCRIPT] Checkpoint help (/thread-21273.html) Pages:
1
2
|
Checkpoint help - Dominic0904 - 04-24-2013 Hey there, Basically I was wondering how do you get a checkpoint to reload your progress back to what it was when you actually triggered the checkpoint? An example; I enter the maze, the door locks and it spawns the Brute, I walk forward, trigger the checkpoint and afterwards I open a lot of doors in the maze, collect a key and then get killed by the Brute. When the checkpoint loads, all the doors are still open, the brute is gone and I still possess the key. Here is the relevant script for that area: Quote://When CellarChase is called, it created a timer called "PreLookTimer" that lasts .4 seconds, it also So how would I go about it so that when the checkpoint reloads, it would reload the map and the player's progress in the state that it was meant to, such as the doors being closed, the Brute still roaming the area and the player not having the key any more. I've searched around on the forums and I can't seem to find anything related to my problem. If you want me to post other parts of my script, just ask. Thanks. RE: Checkpoint help - Tomato Cat - 04-24-2013 Try this: PHP Code: //Create a checkpoint, as you have already, and set the callback function //Function(string &in asName, int alCount) Hopefully this gives you a general idea. It's pretty rough, but play around with it. Also, I'm sorry if this fails to answer the problem you were having. My head hurts pretty bad today. *edit* why is the page stretching? -.- RE: Checkpoint help - Dominic0904 - 04-24-2013 I managed remove the key and respawn it. But I got a few problems. I have tried adding the callback which was only this; PHP Code: AddEntityCollideCallback("Player", "LockCellarDoor_01", "CellarChase", true, 1); That's the callback that triggers the door to lock and makes the Brute active (check the script in my first post under "CellarCase") And also, I can't get the doors to close again, this is what I put for the doors PHP Code: SetSwingDoorClosed("prison_*", true, false); (the asterisk is so that it closes all the doors with the name "prison_" and whatever number is at the end of them. But I also tried with just "prison_1" and it didn't work at all. I don't need to lock the initial door because that already reloads as being locked for some reason. RE: Checkpoint help - Tomato Cat - 04-24-2013 Are you saying that you can't re-add the CellarChase callback? If so, I would check that everything is spelled the same, and make sure all your parameters/arguments match. As for SetSwingDoorClosed, I would, again, make sure that the names of your doors are in fact named "prison_#" in the editor. (I make this mistake all the time!) Do you mean that the door stays locked after the checkpoint function is called? In your CellarChase function, you're locking it with SetSwingDoorLocked. Perhaps you aren't unlocking it when the checkpoint function is called? If you wish, you can send me the hps and map file so I could take a better look. RE: Checkpoint help - Dominic0904 - 04-25-2013 Yeah, I add it back and then does nothing, it doesn't reset the "Lock door, spawn brute and enable checkpoint" scene. I bolded the callback, is it because I set it to be destroyed after being triggered once? I don't think that would be the case because I changed it to false and it didn't do anything. It still does not trigger when I walk through it the second time round (when the checkpoint loads after dying) Quote:void ReloadCheckpoint2(string &in asName, int alCount) As for the doors, all my doors are named the exact same name. But it still doesn't work And the door at the beginning I was talking about. How the scene plays out is like this; Player opens door to Maze Steps into a trigger area which forces the player to look at the entrance door, locks that door, then after a timer has triggered it spawns a brute to patrol the area. The player can walk a few steps forward to then trigger the checkpoint to save. I included my .hps if what I am saying is too confusing haha. All the comments are for my Markers as this is my university project. There is a large comment that says "ALL THE SCRIPT FOR THE MAZE", that is the section which I am talking about. https://dl.dropboxusercontent.com/u/22826820/01_EntranceHall.hps Thanks RE: Checkpoint help - PutraenusAlivius - 04-25-2013 Is your script area's name called "LockCellarDoor_1"? EDIT: I also noticed that some of the check point is wrong. Make sure you follow this. PHP Code: CheckPoint (string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry); asStartPos - the PlayerStartArea of your position. asCallback - The callback called. asDeathHintCat - The category of the death message. asDeathHintEntry - The entry of the death message. The entry must be in the same category as the death hint category. RE: Checkpoint help - Tomato Cat - 04-25-2013 Could you perhaps post a download link for your .map file? It would help if I also had the map file. If not, then one thing you could try is changing this: PHP Code: CheckPoint ("", "CheckpointSpawn_2", "ReloadCheckpoint2", "Checkpoint_2_Death_Message", "MazeRoomDeath"); To something like this: PHP Code: CheckPoint("Checkpoint2", "CheckpointSpawn_2", "ReloadCheckpoint2", "Checkpoint_2_Death_Message", "MazeRoomDeath"); I'm not so sure adding a name will matter..But hey, troubleshooting. =p RE: Checkpoint help - Dominic0904 - 04-25-2013 (04-25-2013, 02:33 PM)JustAnotherPlayer Wrote: Is your script area's name called "LockCellarDoor_1"? The Script area is called LockCellarDoor_01, not LockCellarDoor_1. (04-25-2013, 02:33 PM)Mr Credits Wrote: Could you perhaps post a download link for your .map file? It would help if I also had the map file. Yeah sure, bit of derp of my part haha https://dl.dropboxusercontent.com/u/22826820/01_EntranceHall.map Tried adding Checkpoint2 into the first string but it didn't change anything. Doors still open, callback does happen when you walk through the trigger area. RE: Checkpoint help - Tomato Cat - 04-25-2013 Post the actual .map file, not the text one. =p RE: Checkpoint help - Dominic0904 - 04-25-2013 Sorry! Should of tested it first haha, this one should work. https://dl.dropboxusercontent.com/u/22826820/01_EntranceHall.zip |