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
Making a scream play when player enters a room?
Austums Offline
Member

Posts: 60
Threads: 11
Joined: Mar 2011
Reputation: 0
#6
RE: Making a scream play when player enters a room?

Update:

I have my code set up to look like this:

void OnStart()
{
AddEntityCollideCallback("Player", "Scream", "Scream_1", true, 1);  \\Put this in OnStart, Player is who is going to collide with area to make it start (could be a grunt), Scream is script area name, Scream_1 is function name (below), true means the collide will disappear when you contact it, if it was false it would mean it would stay and would run the function everytime you colide into the area, 1 means...I'm not sure, something about states
}
void Scream_1(string &in asParent, string &in asChild, int alStates)  \\You need to put those 3 parameters to link to the collide
{
   AddTimer("Somenamedoesntreallymatter", 2.0f, "Scream_Trigger")   \\So, first is some name, then the time to wait, then the function to call after you wait
}

void Scream_Trigger(string &in asTimer)  \\need that parameter to link to timer
{
   PlaySoundAtEntity("Scream_1", "04_scream.snt", "Scream_1", 0, false);
   PlayerStartLookAt("LookArea_1", 1, 1, "") //First the script area name, then a speed multiplier, then max look speed, and then a target callback which is blank in this case
}


but when I try to run my map, it gives me an error saying that the script unexpectedly ends at 14,2

Did I even set the script up correctly?
03-23-2011, 03:06 AM
Find


Messages In This Thread
RE: Making a scream play when player enters a room? - by Austums - 03-23-2011, 03:06 AM



Users browsing this thread: 1 Guest(s)