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 Hi, its me again ;d
NotASkrub Offline
Junior Member

Posts: 19
Threads: 2
Joined: Jun 2015
Reputation: 0
#17
RE: Hi, its me again ;d

(06-21-2015, 01:28 AM)FlawlessHappiness Wrote: Show how you've set up the script right now.
Spoiler below!
PHP Code: (Select All)
//Everything with "//" at the start of the text and at the end is just a comment.//
//Everything starting with "//" only, may not be needed in the script.//

//When game starts for first time (e.g. mostly used in full conversion modes)//
//void OnGameStart()
//{
//    
//;}

//On start of a map for first time.//
void OnStart()
{
    
TeleportPlayer("PlayerStartArea_1");
    
AddEntityCollideCallback("Player", "Quest1", "Tired", true, 1);
    
AddEntityCollideCallback("Player", "Scare", "PlayerScare", true, 1);
    
AddEntityCollideCallback("Player", "StartLookAt", "StartLookAt", true, 1);
    
AddEntityCollideCallback("Player", "ForcedLookAt", "ForcedLookAtStop", true, 1);
    
AddEntityCollideCallback("Player", "Quest1Done", "TiredDone", true, 1);
    
SetEntityPlayerLookAtCallback("Tim", "Tim", bool (false));
    
AddUseItemCallback("", "MysteriousKey", "AwaysLockedDoor", "AwaysLockedUnlock", true);
;}

//ExtraScripts for OnStart//

//AddEntityCollideCallback Scripts//
void PlayerScare(string &in asParent, string &in asChild, string &in alState)
{
    if (
GetSwingDoorClosed("AwaysLockedDoor") == false)
        {
            
SetSwingDoorClosed("AwaysLockedDoor", true, true);
            
AddTimer("Lock", float (2.0), "LockDoor");
        }
    if (
GetSwingDoorClosed("AwaysLockedDoor") == true)
        {
            
AddTimer("Lock", float (2.0), "LockDoor");
        }
;}

void LockDoor(string &in asTimer)
{
    
SetSwingDoorLocked("AwaysLockedDoor", true, true);
    
PlaySoundAtEntity("", "lock_door.snt", "Player", float (0.0), false);
    
SetEntityActive("JumpScare", true);
    
ShowEnemyPlayerPosition("JumpScare");
;}

void Tired(string &in asParent, string &in asChild, int alState)
{
    
AddQuest("Tired", "Tired");
;}

void StartLookAt(string &in asParent, string &in asChild, int alState)
{
    
StartPlayerLookAt("ForcedLookAt", float (2.0), float (4.0), "");
;}

void ForcedLookAtStop(string &in asParent, string &in asChild, int alState)
{
    
StopPlayerLookAt();
;}

void TiredDone(string &in asParent, string &in asChild, int alState)
{
    
StopPlayerLookAt();
    
CompleteQuest("Tired", "Tired");
    
AddTimer("FadeOutTimer", float (0.5), "FadeOutFunc");
    
;}

void FadeOutFunc(string &in asTimer)
{
    
FadeOut(float (2.0));
    
AddTimer("FadeInTimer", float (2.5), "FadeInFunc");
;}

void FadeInFunc(string &in asTimer)
{
    
PlaySoundAtEntity("PlayerScare", "BruteEnabled.snt", "Player", float (5.0), bool (false));
    
FadeIn(float (4.0));
    
SetEntityActive("MysteriousKey", bool (true));
    
AddTimer("SoundQuest", float(5.0), "SoundQuest");
;}

void SoundQuest(string &in asTimer)
{
    
AddQuest("SoundQuest", "SoundQuest");
;}
//AddUseItemCallback Scripts//
void AwaysLockedUnlock(string &in asItem, string &in asEntity)
{
    
SetSwingDoorLocked("AwaysLockedDoor", bool (false), bool (true));
    
PlaySoundAtEntity("", "unlock_door", "Player", 0, false);
    
RemoveItem("MysteriousKey");
;}

void AwaysLockedMessage(string &in asEntity, string &in type)
{
    
SetMessage("Messages", "MysteriousKey", float (0.0));
;}

//SetEntityPlayerLookAtCallback Scripts//
void Tim(string &in asEntity, int alState)
{
    
SetMessage("Messages", "Tim", float (0.6));
;}

//On enter of the map (e.g using a map multiple times).//
void OnEnter()
{
    
;}

//On leaving the map.//
void OnLeave()
{
    
;}

//EXTRA SCRIPTS (Functions, codes and etc.)// 

there ya go, what I want is, when the player enters a certain area in a room, the door to be closed, and the scare part to be run..
06-21-2015, 11:16 AM
Find


Messages In This Thread
Hi, its me again ;d - by NotASkrub - 06-19-2015, 01:52 AM
RE: Hi, its me again ;d - by FlawlessHappiness - 06-19-2015, 02:12 AM
RE: Hi, its me again ;d - by NotASkrub - 06-19-2015, 02:24 AM
RE: Hi, its me again ;d - by Romulator - 06-19-2015, 02:46 AM
RE: Hi, its me again ;d - by FlawlessHappiness - 06-19-2015, 02:52 AM
RE: Hi, its me again ;d - by NotASkrub - 06-19-2015, 02:58 AM
RE: Hi, its me again ;d - by Mudbill - 06-19-2015, 08:03 AM
RE: Hi, its me again ;d - by NotASkrub - 06-19-2015, 09:45 AM
RE: Hi, its me again ;d - by NotASkrub - 06-20-2015, 01:00 PM
RE: Hi, its me again ;d - by DnALANGE - 06-20-2015, 02:02 PM
RE: Hi, its me again ;d - by NotASkrub - 06-20-2015, 02:56 PM
RE: Hi, its me again ;d - by Mudbill - 06-20-2015, 02:10 PM
RE: Hi, its me again ;d - by FlawlessHappiness - 06-20-2015, 05:01 PM
RE: Hi, its me again ;d - by NotASkrub - 06-20-2015, 06:08 PM
RE: Hi, its me again ;d - by NotASkrub - 06-20-2015, 10:11 PM
RE: Hi, its me again ;d - by FlawlessHappiness - 06-21-2015, 01:28 AM
RE: Hi, its me again ;d - by NotASkrub - 06-21-2015, 11:16 AM
RE: Hi, its me again ;d - by Romulator - 06-21-2015, 12:16 PM
RE: Hi, its me again ;d - by NotASkrub - 06-21-2015, 01:28 PM
RE: Hi, its me again ;d - by FlawlessHappiness - 06-21-2015, 01:30 PM
RE: Hi, its me again ;d - by NotASkrub - 06-21-2015, 02:14 PM
RE: Hi, its me again ;d - by DnALANGE - 06-21-2015, 05:14 PM
RE: Hi, its me again ;d - by Mudbill - 06-21-2015, 05:22 PM
RE: Hi, its me again ;d - by NotASkrub - 06-21-2015, 06:55 PM
RE: Hi, its me again ;d - by FlawlessHappiness - 06-21-2015, 07:21 PM
RE: Hi, its me again ;d - by NotASkrub - 06-21-2015, 08:35 PM
RE: Hi, its me again ;d - by Catalyst - 06-21-2015, 08:53 PM
RE: Hi, its me again ;d - by NotASkrub - 06-21-2015, 10:59 PM



Users browsing this thread: 1 Guest(s)