Frictional Games Forum (read-only)
[SCRIPT] Colliding an area to set another area active? - 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: [SCRIPT] Colliding an area to set another area active? (/thread-17325.html)



Colliding an area to set another area active? - KingCrimson - 07-29-2012

So, i'm making my custom story and i need to set an area inactive until the player collides with another area. ¿Is that possible?¿How?

Thanks in advance


RE: Colliding an area to set another area active? - Mackiiboy - 07-29-2012

(07-29-2012, 02:34 AM)ExenderVes Wrote: So, i'm making my custom story and i need to set an area inactive until the player collides with another area. ¿Is that possible?¿How?

Thanks in advance
.
Yea, it's possible!
The area you want inactive should be inactive in the Level Editor. Lets call the active area "Area_1" and the inactive area "Area_2"

Code:
void OnStart()
{
    AddEntityCollideCallback("Player", "Area_1", "SetAreaActiveFunc", true, 1);
}

void SetAreaActiveFunc(string &in asParent, string &in asChild, int alState)
{
    SetEntityActive("Area_2", true);
}



RE: Colliding an area to set another area active? - KingCrimson - 07-29-2012

It worked!

Thanks ;D