The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Script Help Checkpoint help
Dominic0904 Offline
Member

Posts: 63
Threads: 14
Joined: Apr 2011
Reputation: 0
#1
Checkpoint help

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
//locks "CellarDoor_01" and plays a door slam sound
//NOTE: ADD IN VOICE OVER AND ADJUST THE TIMERS TO MATCH THE VOICE OVERS
void CellarChase(string &in asParent, string &in asChild, int alState)
{

AddTimer("PreLookTimer", 0.4f, "PreLookTimer");
SetSwingDoorLocked("CellarDoor_01", true, false);
PlaySoundAtEntity("", "scare_slam_door", "CellarDoor_01", 0, false);

}

//Once PreLookTimer is finished, it forces the player to look at "CellarDoor_01", disables player movement
//and creates another timer called "LookAtDoorTimer" that lasts for 2 seconds
void PreLookTimer(string &in asTimer)
{
StartPlayerLookAt("CellarDoor_01", 5, 5, "");
SetPlayerActive(false);
AddTimer("LookAtDoorTimer", 2, "LookAtDoorTimer");


}

//Once LookAtDoorTimer has finished, it allows the player to move again and stops the player from being
//forced to look at "CellarDoor_01". It then sets "CellarBrute_01" to active and shows the brute the
//player's position. Lastly, the trigger area "BruteDisappear_01" is set to active so that the player
//can collide with it.
void LookAtDoorTimer(string &in asTimer)
{
StopPlayerLookAt();
SetPlayerActive(true);
SetEntityActive("CellarBrute_01", true);
SetEntityActive("BruteDisappear_01", true);
SetEntityActive("Checkpoint_2", true); //< SETS THE TRIGGER AREA TO ACTIVE
/////////////////THESE SCREEN EFFECTS STOP IF THE PLAYER LOOKS AT THE BRUTE////////////////
FadeRadialBlurTo(0.03f, 1);
FadeSepiaColorTo(0, 4);
FadeImageTrailTo(0.02f, 1);
///////////////////////////////////////////////////////////////////////////////////////////

AddEnemyPatrolNode("CellarBrute_01", "BrutePatrolNode_1", 0, "");
AddEnemyPatrolNode("CellarBrute_01", "BrutePatrolNode_2", 0, "");
AddEnemyPatrolNode("CellarBrute_01", "BrutePatrolNode_3", 0, "");
AddEnemyPatrolNode("CellarBrute_01", "BrutePatrolNode_4", 0, "");
AddEnemyPatrolNode("CellarBrute_01", "BrutePatrolNode_5", 0, "");
AddEnemyPatrolNode("CellarBrute_01", "BrutePatrolNode_6", 0, "");
AddEnemyPatrolNode("CellarBrute_01", "BrutePatrolNode_7", 0, "");
AddEnemyPatrolNode("CellarBrute_01", "BrutePatrolNode_8", 0, "");
AddEnemyPatrolNode("CellarBrute_01", "BrutePatrolNode_9", 0, "");
AddEnemyPatrolNode("CellarBrute_01", "BrutePatrolNode_10", 0, "");
AddEnemyPatrolNode("CellarBrute_01", "BrutePatrolNode_11", 0, "");
AddEnemyPatrolNode("CellarBrute_01", "BrutePatrolNode_12", 0, "");
AddEnemyPatrolNode("CellarBrute_01", "BrutePatrolNode_13", 0, "");
AddEnemyPatrolNode("CellarBrute_01", "BrutePatrolNode_14", 0, "");
AddEnemyPatrolNode("CellarBrute_01", "BrutePatrolNode_15", 0, "");
AddEnemyPatrolNode("CellarBrute_01", "BrutePatrolNode_16", 0, "");
AddEnemyPatrolNode("CellarBrute_01", "BrutePatrolNode_17", 0, "");
AddEnemyPatrolNode("CellarBrute_01", "BrutePatrolNode_18", 0, "");
AddEnemyPatrolNode("CellarBrute_01", "BrutePatrolNode_19", 0, "");
AddEnemyPatrolNode("CellarBrute_01", "BrutePatrolNode_20", 0, "");
AddEnemyPatrolNode("CellarBrute_01", "BrutePatrolNode_21", 0, "");
AddEnemyPatrolNode("CellarBrute_01", "BrutePatrolNode_22", 0, "");
AddEnemyPatrolNode("CellarBrute_01", "BrutePatrolNode_23", 0, "");
}

void SecondCheckpoint(string &in asParent, string &in asChild, int alState)
{
/////PLAYS A SOUND WHEN THE PLAYER WALKS INTO THE TRIGGER AREA, TO TEST IF IT WORKS////
PlaySoundAtEntity("", "unlock_door", "Player", 0, false);
/////CHECKPOINT 1, IF THE PLAYER DIES THEY ARE RESPAWNED AT PLAYER START POSITION "CHECKPOINTSPAWN_1"/
CheckPoint ("", "CheckpointSpawn_2", "", "Checkpoint_2_Death_Message", "MazeRoomDeath");


}



void LevelEndKey_1(string &in EntityName, string &in Type)
{
if(Type == "OnPickup")
{

SetSwingDoorLocked("CellarDoor_01", false, false);
}
}


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.
04-24-2013, 06:01 PM
Find


Messages In This Thread
Checkpoint help - by Dominic0904 - 04-24-2013, 06:01 PM
RE: Checkpoint help - by Tomato Cat - 04-24-2013, 07:16 PM
RE: Checkpoint help - by Dominic0904 - 04-24-2013, 09:01 PM
RE: Checkpoint help - by Tomato Cat - 04-24-2013, 11:08 PM
RE: Checkpoint help - by Dominic0904 - 04-25-2013, 02:13 PM
RE: Checkpoint help - by PutraenusAlivius - 04-25-2013, 02:33 PM
RE: Checkpoint help - by Dominic0904 - 04-25-2013, 03:58 PM
RE: Checkpoint help - by Tomato Cat - 04-25-2013, 02:51 PM
RE: Checkpoint help - by Tomato Cat - 04-25-2013, 04:14 PM
RE: Checkpoint help - by Dominic0904 - 04-25-2013, 04:32 PM
RE: Checkpoint help - by Tomato Cat - 04-25-2013, 05:07 PM
RE: Checkpoint help - by Dominic0904 - 04-25-2013, 06:47 PM
RE: Checkpoint help - by Tomato Cat - 04-25-2013, 08:08 PM
RE: Checkpoint help - by Dominic0904 - 04-25-2013, 09:21 PM
RE: Checkpoint help - by Dominic0904 - 04-27-2013, 06:36 PM
RE: Checkpoint help - by Tomato Cat - 04-27-2013, 07:07 PM



Users browsing this thread: 1 Guest(s)