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
Script Help SetPlayerActive(false/true) Problems.& Grunt Question
Rob21894 Offline
Junior Member

Posts: 4
Threads: 3
Joined: Nov 2013
Reputation: 0
#1
SetPlayerActive(false/true) Problems.& Grunt Question

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?
(This post was last modified: 11-18-2013, 01:48 PM by Rob21894.)
11-18-2013, 01:40 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#2
RE: SetPlayerActive(false/true) Problems.

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: (Select All)
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);


Discord: Romulator#0001
[Image: 3f6f01a904.png]
11-18-2013, 01:52 PM
Find




Users browsing this thread: 1 Guest(s)