Frictional Games Forum (read-only)
Question About Activating a monster when you walk in a 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: Question About Activating a monster when you walk in a Area (/thread-14904.html)



Question About Activating a monster when you walk in a Area - meneadeszz - 04-18-2012

Ok hellow .

Im trying to make a monster activate when you walk in area..
I got a brute setup in a cabinet.
this is the little scipt it made

void OnStart()
{

SetEnemyDisabled("brute1", true);

//when the player enters the area the brute gets activated
AddEntityCollideCallback("Player", "brute1activate", "brute1activate", true, 1);
}


void brute1activate(string &in asParent, string &in asChild, int alState)
{ i dont know what the false and true mean the wiki doesnt explain
SetNPCAwake("brute1", false, true);
}


what im a missing.?
i would alos want to add a timer so when you enter the area 1 second later the brute activates




RE: Question About Activating a monster when you walk in a Area - Rapture - 04-18-2012

Just replace your SetNPCAwake with SetEnemyDisabled("brute1", false);

I would change your 3rd parameter, I don't think its a good idea to have the same names floating around. Even though one is a Area and one is the Script function to call.



RE: Question About Activating a monster when you walk in a Area - Damascus - 04-19-2012

Most common way is to set the enemy in the Level Editor and set it to inactive. Then activate it with the following script:

PHP Code:
void OnStart()
{
AddEntityCollideCallback("Player""brute1activate""brute1activate"true1);
}

void brute1activate(string &in asParentstring &in asChildint alState
{
SetEntityActive("brute1"true); //true means active, false means inactive


SetNPCAwake is used for characters like Agrippa and Alexander.



RE: Question About Activating a monster when you walk in a Area - meneadeszz - 04-19-2012

(04-19-2012, 12:30 AM)Damascus Wrote: Most common way is to set the enemy in the Level Editor and set it to inactive. Then activate it with the following script:

PHP Code:
void OnStart()
{
AddEntityCollideCallback("Player""brute1activate""brute1activate"true1);
}

void brute1activate(string &in asParentstring &in asChildint alState
{
SetEntityActive("brute1"true); //true means active, false means inactive


SetNPCAwake is used for characters like Agrippa and Alexander.
Thanks for your helping it worked