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
Scripting a LookAt?
Linus Ågren Offline
Senior Member

Posts: 309
Threads: 58
Joined: Jan 2011
Reputation: 5
#1
Scripting a LookAt?

Well, I have tried scripting a LookAt event, but it doesn't work. What's wrong with this script? The Monster Spawn is working perfectly btw.

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");
}

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);
}

Creator of The Dark Treasure.
01-20-2011, 07:48 PM
Website 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: 2 Guest(s)