Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Enemy Trigger problems
omiwrench8k Offline
Junior Member

Posts: 6
Threads: 2
Joined: Nov 2011
Reputation: 0
#1
Enemy Trigger problems

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...
(This post was last modified: 01-01-2012, 10:04 PM by omiwrench8k.)
01-01-2012, 07:20 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: Enemy Trigger problems

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");
}
01-01-2012, 07:46 PM
Find
omiwrench8k Offline
Junior Member

Posts: 6
Threads: 2
Joined: Nov 2011
Reputation: 0
#3
RE: Enemy Trigger problems

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.
(This post was last modified: 01-01-2012, 08:16 PM by omiwrench8k.)
01-01-2012, 08:12 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#4
RE: Enemy Trigger problems

You've got the syntax for the callback wrong. You're missing the second parameter.

Tutorials: From Noob to Pro
01-01-2012, 08:23 PM
Website Find
omiwrench8k Offline
Junior Member

Posts: 6
Threads: 2
Joined: Nov 2011
Reputation: 0
#5
RE: Enemy Trigger problems

Sorry, I'm a noob. Simplify?
01-01-2012, 09:16 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#6
RE: Enemy Trigger problems

You have
PHP Code: (Select All)
void StartGrunt_1(string &in asEntity

You need
PHP Code: (Select All)
void StartGrunt_1(string &in asEntitystring &in asType

Tutorials: From Noob to Pro
01-01-2012, 09:34 PM
Website Find
omiwrench8k Offline
Junior Member

Posts: 6
Threads: 2
Joined: Nov 2011
Reputation: 0
#7
RE: Enemy Trigger problems

Thanks! That did it!
01-01-2012, 10:03 PM
Find




Users browsing this thread: 1 Guest(s)