Frictional Games Forum (read-only)
Create/Activate an area when interacts with entity - 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: Create/Activate an area when interacts with entity (/thread-10972.html)



Create/Activate an area when interacts with entity - cheztheguy - 10-25-2011

Hi guys;
So I have these two rooms. One room is where you start out with (it's a bedroom). And the other is a dining/living-room type. So, You start off in the bedroom, and you go into the dining room. You find a lantern, and when you pick it up, I want to make an area activate in the bedroom so that when you go back, the area will do everything that the EntityCollideCallback's were listed.
Is there anyway to "spawn" or set active a script area?

EDIT: I found an "Active" checkbox when you select the script area. In the script (.hps) file, how do you activate/deactivate the script? What is the script function?
The script area is called "Realize_1" (no quotes)
and the PlayerInteractCallback function is "PickedUpLantern"
After "PickedUpLantern" is called, I want "Realize_1" to activate (or appear) and I want several things to happen, like lower sanity, and make the player look at the entity, but I have the AddEntityCollideCallback things set up.

Thanks for your help!


RE: Create/Activate an area when interacts with entity - jens - 10-25-2011

SetEntityActive("Realize_1", true);



RE: Create/Activate an area when interacts with entity - Patacorow - 10-26-2011

Areas can be treated like entities, including when activating and deactivating them. c: