Frictional Games Forum (read-only)
[SCRIPT] activating monster on script area - 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] activating monster on script area (/thread-14406.html)



activating monster on script area - zombiehacker595 - 04-01-2012

so how do i activate a monster when i step on the script area i can do it when i pick up key but i tested the script area and it didnt work this is my script.
void OnStart()
{
SetEntityPlayerInteractCallback("ScriptArea_1", "ActivateMonster", true);
}
void ActivateMonster(string &in item)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "Idle");
}
void OnEnter()
{
{
void OnLeave()
}
so what do i have to change to get him to activate i also changed it to a hullicination so would i have to change parts of the script for that aswell? thanks Smile



RE: activating monster on script area - flamez3 - 04-01-2012

Change
SetEntityPlayerInteractCallback("ScriptArea_1", "ActivateMonster", true);


To AddEntityCollideCallback("Player", "ScriptArea_1", "ActivateMonster", true, 1);


and void ActivateMonster(string &in item)


to


void ActivateMonster(string &in asParent, string &in asChild, int alState)



RE: activating monster on script area - zombiehacker595 - 04-01-2012

works great thanks Smile