Frictional Games Forum (read-only)
Player Collides With Area Help? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Player Collides With Area Help? (/thread-21402.html)

Pages: 1 2


Player Collides With Area Help? - FurtherGames - 05-04-2013

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:
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.


RE: Player Collides With Area Help? - Tomato Cat - 05-04-2013

Your problem lies here:

PHP Code:
//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.


RE: Player Collides With Area Help? - FurtherGames - 05-04-2013

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

PHP Code:
//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.


RE: Player Collides With Area Help? - Tomato Cat - 05-04-2013

It has a table of contents and you can also use your browser's page search tool.


RE: Player Collides With Area Help? - FurtherGames - 05-04-2013

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

PHP Code:
//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...


RE: Player Collides With Area Help? - Tomato Cat - 05-04-2013

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?


RE: Player Collides With Area Help? - FurtherGames - 05-04-2013

(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.


RE: Player Collides With Area Help? - Tomato Cat - 05-04-2013

Did you uncheck the active box in the level editor?


RE: Player Collides With Area Help? - FurtherGames - 05-04-2013

(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.


RE: Player Collides With Area Help? - Tomato Cat - 05-04-2013

Try setting it inactive in OnStart?