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
Player Collides With Area Help?
FurtherGames Offline
Member

Posts: 72
Threads: 23
Joined: Apr 2013
Reputation: 1
#1
Exclamation  Player Collides With Area Help?

Hey guys, I'm trying to do when a player collides with an area, he is forced to look at another script area, a timer begins, once the timer stops it calls on a function, that function activates an entity.

I've done this:

PHP Code: (Select All)
void OnStart()

AddEntityCollideCallback("Player""ScriptArea_9""Func6"true0);    
}

void OnEnter()
{

}

void OnLeave()


}
void Func6(string &in asParentstring &in asChildint alState)

{
    
SetPlayerActive(false);
    
StartPlayerLookAt("ScriptArea_10"1.0f1.0f"");
    
SetMessage("Messages""LookAtBlood"2);
    
AddTimer(""3"SetEntityActive");
    
}

void SetEntityActive(stringasNamebool abActive)
{
    
SetEntityActive("corpsepile"true);


But when I go to the area, the entity/corpsepile is already active, before I collide with the area and it's set inactive in the editor.
(This post was last modified: 05-04-2013, 08:52 PM by FurtherGames.)
05-04-2013, 08:50 PM
Find
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#2
RE: Player Collides With Area Help?

Your problem lies here:

PHP Code: (Select All)
//Callback syntax for a timer
void SetEntityActive(string &in asTimer)
{
    
SetEntityActive("corpsepile"true);


In the future, I highly recommend you consult the functions list at the wiki.
(This post was last modified: 05-04-2013, 08:57 PM by Tomato Cat.)
05-04-2013, 08:56 PM
Find
FurtherGames Offline
Member

Posts: 72
Threads: 23
Joined: Apr 2013
Reputation: 1
#3
RE: Player Collides With Area Help?

(05-04-2013, 08:56 PM)Mr Credits Wrote: Your problem lies here:

PHP Code: (Select All)
//Callback syntax for a timer
void SetEntityActive(string &in asTimer)
{
    
SetEntityActive("corpsepile"true);


In the future, I highly recommend you consult the functions list at the wiki.

I always search the wiki first, but I never find it.
05-04-2013, 08:57 PM
Find
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#4
RE: Player Collides With Area Help?

It has a table of contents and you can also use your browser's page search tool.
05-04-2013, 09:00 PM
Find
FurtherGames Offline
Member

Posts: 72
Threads: 23
Joined: Apr 2013
Reputation: 1
#5
RE: Player Collides With Area Help?

(05-04-2013, 08:56 PM)Mr Credits Wrote: Your problem lies here:

PHP Code: (Select All)
//Callback syntax for a timer
void SetEntityActive(string &in asTimer)
{
    
SetEntityActive("corpsepile"true);


In the future, I highly recommend you consult the functions list at the wiki.


It's still not working...
05-04-2013, 09:02 PM
Find
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#6
RE: Player Collides With Area Help?

Exactly *what* is not working? Are you receiving an error, or does the script improperly/not execute?

Did you check your script area names in the level editor etc etc? Perhaps you should change the name of your timer callback to "ActivateCorpsepile" or something?
(This post was last modified: 05-04-2013, 09:09 PM by Tomato Cat.)
05-04-2013, 09:06 PM
Find
FurtherGames Offline
Member

Posts: 72
Threads: 23
Joined: Apr 2013
Reputation: 1
#7
RE: Player Collides With Area Help?

(05-04-2013, 09:06 PM)Mr Credits Wrote: Exactly *what* is not working? Are you receiving an error, or does the script improperly/not execute?

Did you check your script area names in the level editor etc etc?

The problem is is that the entity is active even before I collide with the area script. It is supposed to be a tiny bit of a jump scare.
05-04-2013, 09:09 PM
Find
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#8
RE: Player Collides With Area Help?

Did you uncheck the active box in the level editor?
05-04-2013, 09:10 PM
Find
FurtherGames Offline
Member

Posts: 72
Threads: 23
Joined: Apr 2013
Reputation: 1
#9
RE: Player Collides With Area Help?

(05-04-2013, 09:10 PM)Mr Credits Wrote: Did you uncheck the active box in the level editor?

Yes, I said that and I saved the map.
05-04-2013, 09:12 PM
Find
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#10
RE: Player Collides With Area Help?

Try setting it inactive in OnStart?
05-04-2013, 09:16 PM
Find




Users browsing this thread: 1 Guest(s)