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
Help with scripting and notes.
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#2
RE: Help with scripting and notes.

AddEntityCollideCallback("Player", "ScriptArea_2", "Func01", true, 1);

This should be in the braces of OnStart, not a standalone {}.

Keep in mind that { is used to open a function block, and } is used to close it. Every function block should have a name or an indicator. So it would be like this:

////////////////////////////
// Run when entering map
void OnEnter()
{

}

void OnStart()
{
AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "Func01", true, 1);
}

void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_grunt_1" , true);
}

void Func01(string &in asParent, string &in asChild, int alState)
{
AddPropImpulse("ScaryDoor", 0, 0, 5, "World");
PlaySoundAtEntity("", "21_bang_door.snt", "ScaryDoor", 0, false);
StartPlayerLookAt("ScaryDoor", 2, 2, "");
AddTimer("", 2, "TimerFunc");
}

void TimerFunc(string &in asTimer)
{
StopPlayerLookAt();
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
}

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

}


If you don't have the sound files notes will skip instantly.

08-12-2011, 10:31 AM
Website Find


Messages In This Thread
Help with scripting and notes. - by NadTheBat - 08-12-2011, 10:22 AM
RE: Help with scripting and notes. - by Tanshaydar - 08-12-2011, 10:31 AM
RE: Help with scripting and notes. - by NadTheBat - 08-12-2011, 10:43 AM



Users browsing this thread: 1 Guest(s)