Frictional Games Forum (read-only)

Full Version: SetPlayerActive(false/true) Problems.& Grunt Question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
void OnStart()
{
AddEntityCollideCallback("Player","lookatmonster","lookat", true, 1);
}


void lookat(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("look1", 1.0f, 1.0f, "");
SetPlayerActive(false);
AddTimer("", 5, "");
SetPlayerActive(true);

}

When i remove the "SetPlayerActive(true); It works perfectly, but then i can't control the player, But if i add it as shown above, it doesnt become unactive, why is this?


2.

Grunts, Is there a way to turn there vision down/off? So they're blind and only go after sound?
What you have done is sort of correct.

The way in which a timer works is that when it is activated, it counts upward in seconds, and when it reaches the appropriate time (which you have declared as 5 seconds), it runs a function which is declared from the third set of quotation marks.

This should work correctly.

PHP Code:
void lookat(string &in asParentstring &in asChildint alState){
StartPlayerLookAt("look1"1.0f1.0f"");
SetPlayerActive(false);
AddTimer("Timer_1"5.0f"MakePlayerActive");
}

void MakePlayerActive(string &in asTimer)
{
SetPlayerActive(true);