Frictional Games Forum (read-only)
Path node issue... - 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: Path node issue... (/thread-9070.html)

Pages: 1 2


Path node issue... - AlexRobillard - 07-10-2011

I get an issue on the Monster2 path nodes something about no matching signatures, here is my script for the level.
Code:
void OnStart()
{
AddEntityCollideCallback("Player" , "Monster_Walk_Trigger" , "MonsterWalk1" , true , 1);
AddEntityCollideCallback("Player" , "Monster_Walk_Trigger2" , "MonsterWalk2" , true , 1);
AddEntityCollideCallback("Player" , "Monster_Walk_Trigger" , "AddEnemyPatrolNode" , true , 1);
AddEntityCollideCallback("Player" , "Monster_Walk_Trigger2" , "AddEnemyPatrolNode2" , true , 1);
AddEntityCollideCallback("Player" , "Door_Scare_Trigger" , "DoorScare" , true , 1);
}

void MonsterWalk1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("Monster1" , true);
AddEnemyPatrolNode("Monster1", "PathNodeArea_35", 3, "");
}

void MonsterWalk2(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("Monster2" , true);
AddEnemyPatrolNode2("Monster2", "PathNodeArea_20", 3.0f, "");
AddEnemyPatrolNode2("Monster2", "PathNodeArea_4", 10.0f, "");
AddEnemyPatrolNode2("Monster2", "PathNodeArea_58", 1.0f, "");
AddEnemyPatrolNode2("Monster2", "PathNodeArea_59", 2.0f, "");
}

void DoorScare(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("Door_Scare_Sound" , true);
SetEntityActive("Door_Scare_Effect" , true);
}

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

}

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

}

Thanks for your time. Smile


RE: Path node issue... - Khyrpa - 07-10-2011

erm why do you have 2 collide collbacks for each area?
you can just drop these:
AddEntityCollideCallback("Player" , "Monster_Walk_Trigger" , "AddEnemyPatrolNode" , true , 1);
AddEntityCollideCallback("Player" , "Monster_Walk_Trigger2" , "AddEnemyPatrolNode2" , true , 1);


RE: Path node issue... - AlexRobillard - 07-10-2011

He re-appears later in the level at a different area.


RE: Path node issue... - Khyrpa - 07-10-2011

but their names are the same... so how is that possible?

And also when you trigger this:
AddEntityCollideCallback("Player" , "Monster_Walk_Trigger" , "MonsterWalk1" , true , 1);

it makes so that everything inside this happens
void MonsterWalk1(string &in asParent , string &in asChild , int alState)
{
}
in your case its these:
SetEntityActive("Monster1" , true);
AddEnemyPatrolNode("Monster1", "PathNodeArea_35", 3, "");

so the bolded one here:
AddEntityCollideCallback("Player" , "Monster_Walk_Trigger" , "AddEnemyPatrolNode" , true , 1);

would need
void AddEnemyPatrolNode(string &in asParent , string &in asChild , int alState)

this is kind of confusing... I don't know what youre trying to do


RE: Path node issue... - AlexRobillard - 07-10-2011

I don't understand what you mean, the player walks to the trigger area of Monser_Walk_Trigger and one monster spawns, then later in that same map/level the player walks to the trigger area of Monster_Walk_Trigger2 and a monster spawns.


RE: Path node issue... - Khyrpa - 07-10-2011

No monster spawns because the first time you enter the area those both callbacks are called

I mean you have 2 collide callbacks that happen at the same time and another one of them (the one with AddEnemyPatrolNode) just does nothing (or is the cause for your error)


RE: Path node issue... - AlexRobillard - 07-10-2011

I don't understand, the first monster worked perfectly when I got to the first spawn area. Do you understand what I am trying to do, and if so can you put down the proper script because this is just getting confusing.


RE: Path node issue... - Khyrpa - 07-10-2011

Ops you have quite more errors in there than I first noticed, give me a sec and I give you a full edit


RE: Path node issue... - AlexRobillard - 07-10-2011

Okay, thank you.


RE: Path node issue... - Khyrpa - 07-10-2011

Code:
void OnStart()
{
AddEntityCollideCallback("Player" , "Monster_Walk_Trigger" , "MonsterWalk1" , true , 1);
AddEntityCollideCallback("Player" , "Monster_Walk_Trigger2" , "MonsterWalk2" , true , 1);
AddEntityCollideCallback("Player" , "Door_Scare_Trigger" , "DoorScare" , true , 1);
}

void MonsterWalk1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("Monster1" , true);
AddEnemyPatrolNode("Monster1", "PathNodeArea_35", 3, "");
}

void MonsterWalk2(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("Monster2" , true);
AddEnemyPatrolNode("Monster2", "PathNodeArea_20", 3.0f, "");
AddEnemyPatrolNode("Monster2", "PathNodeArea_4", 10.0f, "");
AddEnemyPatrolNode("Monster2", "PathNodeArea_58", 1.0f, "");
AddEnemyPatrolNode("Monster2", "PathNodeArea_59", 2.0f, "");
}

void DoorScare(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("Door_Scare_Sound" , true);
SetEntityActive("Door_Scare_Effect" , true);
}

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

}

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

}

That should do it
amnesia dsnt recognize AddEnemyPatrolNode2 cos thats not an function

and sorry for the hazzle