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
I want the player to react to a door that closes.
KHShox Offline
Junior Member

Posts: 28
Threads: 11
Joined: Apr 2011
Reputation: 0
#1
I want the player to react to a door that closes.

I have been trying to get my player to react when a door closes. The door closes perfectly, and I have tried looking at many forums, videos, and the wiki. None of which really helped me. Here is the current code that I have.
Yes, I also added a scream to the script.
Quote:////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "DoorClose", "CollideScript", true, 1);
}

void CollideScript(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("castle_2", true, true);



AddEntityCollideCallback("Player", "DoorClose", "ScriptArea_2", true, 1);
}
void DoorClose(string &in asParent, string &in asChild, int alStates)
{
AddTimer("Timer", 6.0f, "ScriptArea_2_Trigger");
}

void Scream_Trigger(string &in asTimer)
{
PlaySoundAtEntity("ScriptArea_2", "12_girl_scream.snt", "ScriptArea_2", 0, false);
PlaySoundAtEntity("ScriptArea_2", "react_scare.snt", "ScriptArea_2", 0, false);
StartPlayerLookAt("ScriptArea_2", 2, 2, "");
AddTimer("Timer", 6.0f, "ScriptArea_2_Trigger");
}
void ScriptArea_2_Trigger(string &in asParent, string &in asChild, int alStates)
{
StopPlayerLookAt();
}

[Image: bf3_sig-1298673357.jpg]
04-03-2011, 09:01 PM
Find


Messages In This Thread
I want the player to react to a door that closes. - by KHShox - 04-03-2011, 09:01 PM



Users browsing this thread: 1 Guest(s)