Frictional Games Forum (read-only)

Full Version: Enemy Trigger problems
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So what I'm trying to do is to make an enemy active and patrolling when I pick up a key, pretty standard stuff. I can't get it to work though, so if any of you could tell me what I'm doing you'll have my eternal gratitude.
void OnStart( )
{
//Item & Interaction Callbacks
SetEntityCallbackFunc("key_tomb_1", "StartGrunt_1");

void StartGrunt_1(string &in asEntity)
{
SetEntityActive("servant_grunt_1", true);
SetSwingDoorLocked("mansion_2", true, false);
SetEntityActive("BoxLight_2", false);
SetMessage("Message", "RunMonster", 6);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, "");
Then some path nodes, etc...
You're not closing the parameters of your functions. You need BOTH "{" and "}" this at the end of the function.

for example:

void OnStart( )
{
//Item & Interaction Callbacks
SetEntityCallbackFunc("key_tomb_1", "StartGrunt_1");
}
Oh haha, I have those, just forgot to copy them.
It actually looks like this:
void OnStart( )
{
//Item & Interaction Callbacks
AddUseItemCallback(" ", "key_tower_1", "child_door","UsedKeyOnDoor1", true);
SetEntityCallbackFunc("key_tomb_1", "StartGrunt_1");
SetEntityPlayerInteractCallback("LockedDoor1", "DoorLocked1", true);
SetEntityPlayerInteractCallback("child_door", "DoorLocked3", true);
SetEntityPlayerInteractCallback("hell_door", "DoorLocked2", true);

//CollideCallbacks
AddEntityCollideCallback("Player", "SeeBlood_1", "DiscoverBlood", true, 1);
}
void StartGrunt_1(string &in asEntity)
{
SetEntityActive("servant_grunt_1", true);
SetSwingDoorLocked("mansion_2", true, false);
SetEntityActive("BoxLight_2", false);
SetMessage("Message", "RunMonster", 6);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_14", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_15", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_16", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_17", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_18", 4, "");
}

I just thought I'd copy the important parts.
You've got the syntax for the callback wrong. You're missing the second parameter.
Sorry, I'm a noob. Simplify?
You have
PHP Code:
void StartGrunt_1(string &in asEntity

You need
PHP Code:
void StartGrunt_1(string &in asEntitystring &in asType
Thanks! That did it!