Frictional Games Forum (read-only)

Full Version: Bleurgh! Brute isn't activating!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
{
AddEntityCollideCallback("Player", "brutespawn_1", "func_brutespawn_1", true, 1);

}

void func_brutespawn_1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_1", true);
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_37", 0.5, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_38", 0.5, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_39", 0.5, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_40", 0.5, "");
}


http://24.media.tumblr.com/tumblr_m52k8k...1_1280.jpg


the brute is named as servant_brute_1 and the pathnodes are correctly numbered, but when i step through the door in game into the area box nothing happens :c

It's supposed to be a quick, hard scare, but if it won't activate it's not very scary at all! :'c
I'd say set up a debug message to ensure that the collision actually happens. As far as I can tell, that's the only issue that's present. There may be a naming issue.
Is the area called "brutespawn_1"?

Is that collide callback under the void OnStart() function? (can't really tell because you didn't include that in your snippet)

Did you delete a map_cache is any exists?
Delete map_cache and make sure that
Code:
AddEntityCollideCallback("Player", "brutespawn_1", "func_brutespawn_1", true, 1);
is on OnStart() {
If that doesn't work, try to use a debug message.
If you want the monster to immedatly run at the player, put in this code in the function:
Code:
ShowEnemyPlayerPosition('servant_brute_1"); (don't know if it's the actual code, search Engine Functions or Script Functions or whatever.
This makes him charge and run at the player the second this script is activated. Also, the pathnodes are not needed if its that close to the player. He will find his way charging directly at him Smile.
(06-04-2012, 08:54 AM)Stepper321 Wrote: [ -> ]Delete map_cache and make sure that
Code:
AddEntityCollideCallback("Player", "brutespawn_1", "func_brutespawn_1", true, 1);
is on OnStart() {
If that doesn't work, try to use a debug message.
If you want the monster to immedatly run at the player, put in this code in the function:
Code:
ShowEnemyPlayerPosition('servant_brute_1"); (don't know if it's the actual code, search Engine Functions or Script Functions or whatever.
This makes him charge and run at the player the second this script is activated. Also, the pathnodes are not needed if its that close to the player. He will find his way charging directly at him Smile.
But it's always good with them since "skilled" players can survive it.
No, it isn't. The monster dissapears after completing the trail.
Ok thanks for all the replies, here is the entire of the script so far (I haven't been working on it very long XD) There is no map cache and I must admit i don't know how to setup debug (I'm fairly new to scripting)


////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "gruntspawn_1", "func_gruntspawn_1", true, 1);

AddEntityCollideCallback("Player", "script_grunt1_gone", "func_grunt1_gone", true, 1);
}

void func_gruntspawn_1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0.5, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0.5, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0.5, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0.5, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0.5, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0.5, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0.5, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0.5, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0.5, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 0.5, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 0.5, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 0.5, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0.5, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_14", 0.5, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_15", 0.5, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_16", 0.5, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_17", 0.5, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_18", 0.5, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_19", 0.5, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_20", 0.5, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_21", 0.5, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_22", 0.5, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_23", 0.5, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_24", 0.5, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_25", 0.5, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_26", 0.5, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_27", 0.5, "");
}

void script_grunt1_gone(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", false);
}

{
AddEntityCollideCallback("Player", "kaernkspawn_1", "func_kaernkspawn_1", true, 1);


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

{
SetEntityActive("waterlurker_1", true);
AddEnemyPatrolNode("waterlurker_1", "PathNodeArea_28", 0.5, "");
AddEnemyPatrolNode("waterlurker_1", "PathNodeArea_29", 0.5, "");
AddEnemyPatrolNode("waterlurker_1", "PathNodeArea_30", 0.5, "");
AddEnemyPatrolNode("waterlurker_1", "PathNodeArea_31", 0.5, "");
AddEnemyPatrolNode("waterlurker_1", "PathNodeArea_32", 0.5, "");
AddEnemyPatrolNode("waterlurker_1", "PathNodeArea_33", 0.5, "");
AddEnemyPatrolNode("waterlurker_1", "PathNodeArea_34", 0.5, "");
AddEnemyPatrolNode("waterlurker_1", "PathNodeArea_35", 0.5, "");
AddEnemyPatrolNode("waterlurker_1", "PathNodeArea_36", 0.5, "");
}
{
AddEntityCollideCallback("Player", "brutespawn_1", "func_brutespawn_1", true, 1);

}

void func_brutespawn_1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_1", true);
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_37", 0.5, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_38", 0.5, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_39", 0.5, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_40", 0.5, "");
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}