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
Scripting a LookAt?
Seragath Offline
Junior Member

Posts: 34
Threads: 1
Joined: Jan 2011
Reputation: 0
#5
RE: Scripting a LookAt?

void CollideAreaMonster(string &in asParent, string &in asChild, int alState)
{
  StartPlayerLookAt("corpses", 6.0f, 5.0f, "");
  PlaySoundAtEntity("ScareSound2", "react_pant.snt", "Player", 0, true);
  GiveSanityDamage(6.0f, true);
  AddTimer("look_at_corpses", 0.5f, "corpses_scare"); // Change the timer to 6.0f not 0.5f
}

void corpses_scare(string &in asTimer)
{
  StopPlayerLookAt();
}

void ClosetMonster(string &in asParent , string &in asChild , int alState)
{
  SetEntityActive("grunt_1", true);
  ShowEnemyPlayerPosition("grunt_1");
}


////////////////////////////
// Run first time starting map
void OnStart()
{
  AddEntityCollideCallback("Player", "closetScare" , "ClosetMonster" , true , 1);
  AddEntityCollideCallback("Player", "corpseScare" , "corpses_scare" , true , 1);
}

The mistake is that the timer will trigger in 0.5 seconds. change it to the same as the amount the StartLookingAt is.
01-21-2011, 03:56 PM
Find


Messages In This Thread
Scripting a LookAt? - by Linus Ågren - 01-20-2011, 07:48 PM
RE: Scripting a LookAt? - by jens - 01-20-2011, 08:41 PM
RE: Scripting a LookAt? - by Linus Ågren - 01-20-2011, 10:04 PM
RE: Scripting a LookAt? - by Vradcly - 01-20-2011, 10:20 PM
RE: Scripting a LookAt? - by Seragath - 01-21-2011, 03:56 PM



Users browsing this thread: 1 Guest(s)