Frictional Games Forum (read-only)

Full Version: Question About Activating a monster when you walk in a Area
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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

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