Frictional Games Forum (read-only)
Problem with enemy not disappearing - 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: Problem with enemy not disappearing (/thread-10792.html)



Problem with enemy not disappearing - JoeBradleyUK - 10-16-2011

Sorry for all the questions recently, I bought a new laptop and I lost all the files from my old one, so I forgot how to do most things, anyway the problem is when I walk into the specified area, the character looks at the monster as stated, but the monster doesn't move whatsoever as it is told to.


void OnStart()
{
AddEntityCollideCallback("Player", "ScareOne", "ScareOneCallback", true, 1);
AddEntityCollideCallback("Player", "ScareTwoArea", "ScareTwoCallback", true, 1);
}

void ScareOneCallback(string &in asParent, string &in asChild, int alState)
{
SetLampLit("ScareOneLight", true, true);
SetLampLit("ScareOneLightTwo", true, true);
SetEntityActive("ScareOneMonster", true);
ShowEnemyPlayerPosition("ScareOneMonster");
PlaySoundAtEntity("", "react_scare3.snt", "Player", 20.0f, true);
PlayMusic("LevelOneMusic.ogg", true, 10.0f, 2.0f, 2.0f, true);
SetSwingDoorLocked("ScareOneDoor", true, true);
}

void ScareTwoCallback(string &in asParent, string &in asChild, int alState)
{
AddEnemyPatrolNode("ScareTwoMonster", "ScareTwoNodeOne", 0.0f, "");
AddEnemyPatrolNode("ScareTwoMonster", "ScareTwoNodeTwo", 30.0f, "");
StartPlayerLookAt("ScareTwoMonster", 5.0f, 6.0f, "");
AddTimer("ScareTwo", 8.0f, "ScareTimerTwo");
}

void ScareTimerTwo(string &in asTimer)
{
StopPlayerLookAt();
}

void OnEnter()
{
}
void OnLeave()
{
}


RE: Problem with patrol nodes - Unearthlybrutal - 10-16-2011

Maybe this helpsSmile
Spoiler below!

void OnStart()
{
AddEntityCollideCallback("Player", "ScareOne", "ScareOneCallback", true, 1);
AddEntityCollideCallback("Player", "ScareTwoArea", "ScareTwoCallback", true, 1);
}

void ScareOneCallback(string &in asParent, string &in asChild, int alState)
{
SetLampLit("ScareOneLight", true, true);
SetLampLit("ScareOneLightTwo", true, true);
SetEntityActive("ScareOneMonster", true);
ShowEnemyPlayerPosition("ScareOneMonster");
PlaySoundAtEntity("", "react_scare3.snt", "Player", 20.0f, true);
PlayMusic("LevelOneMusic.ogg", true, 10.0f, 2.0f, 2.0f, true);
SetSwingDoorLocked("ScareOneDoor", true, true);
}

void ScareTwoCallback(string &in asParent, string &in asChild, int alState)
{
AddEnemyPatrolNode("ScareTwoMonster", "ScareTwoNodeOne", 0, "");
AddEnemyPatrolNode("ScareTwoMonster", "ScareTwoNodeTwo", 30, ""); StartPlayerLookAt("ScareTwoMonster", 5.0f, 6.0f, "");
AddTimer("ScareTwo", 8.0f, "ScareTimerTwo");
}

void ScareTimerTwo(string &in asTimer)
{
StopPlayerLookAt();
}

void OnEnter()
{
}
void OnLeave()
{
}





RE: Problem with patrol nodes - JoeBradleyUK - 10-16-2011

(10-16-2011, 11:21 AM)Unearthlybrutal Wrote: Maybe this helpsSmile
Spoiler below!

void OnStart()
{
AddEntityCollideCallback("Player", "ScareOne", "ScareOneCallback", true, 1);
AddEntityCollideCallback("Player", "ScareTwoArea", "ScareTwoCallback", true, 1);
}

void ScareOneCallback(string &in asParent, string &in asChild, int alState)
{
SetLampLit("ScareOneLight", true, true);
SetLampLit("ScareOneLightTwo", true, true);
SetEntityActive("ScareOneMonster", true);
ShowEnemyPlayerPosition("ScareOneMonster");
PlaySoundAtEntity("", "react_scare3.snt", "Player", 20.0f, true);
PlayMusic("LevelOneMusic.ogg", true, 10.0f, 2.0f, 2.0f, true);
SetSwingDoorLocked("ScareOneDoor", true, true);
}

void ScareTwoCallback(string &in asParent, string &in asChild, int alState)
{
AddEnemyPatrolNode("ScareTwoMonster", "ScareTwoNodeOne", 0, "");
AddEnemyPatrolNode("ScareTwoMonster", "ScareTwoNodeTwo", 30, ""); StartPlayerLookAt("ScareTwoMonster", 5.0f, 6.0f, "");
AddTimer("ScareTwo", 8.0f, "ScareTimerTwo");
}

void ScareTimerTwo(string &in asTimer)
{
StopPlayerLookAt();
}

void OnEnter()
{
}
void OnLeave()
{
}


What exactly did you change?


RE: Problem with patrol nodes - Unearthlybrutal - 10-16-2011

AddEnemyPatrolNode("ScareTwoMonster", "ScareTwoNodeOne", 0.0f, "");
AddEnemyPatrolNode("ScareTwoMonster", "ScareTwoNodeTwo", 30.0f, "");

--->

AddEnemyPatrolNode("ScareTwoMonster", "ScareTwoNodeOne", 0, "");
AddEnemyPatrolNode("ScareTwoMonster", "ScareTwoNodeTwo", 30, "");


RE: Problem with patrol nodes - JoeBradleyUK - 10-16-2011

I found the problem, it was the fact that I didn't make the entity active to start with ^^

I have another though now, it's that when the monster walks into an area, it fades to smoke, and it doesn't seem to want to. -.-

Here's the script for that particular bit:

void OnStart()
{
AddEntityCollideCallback("ScareMonsterTwo", "ScareTwoMonsterDisappear", "ScareTwoMonsterVanish", true, 1);
}

void ScareTwoMonsterVanish(string &in asParent, string &in asChild, int alState)
{
FadeEnemyToSmoke("ScareMonsterTwo", true);
}



RE: Problem with patrol nodes - Unearthlybrutal - 10-16-2011

You need to ensure that the enemy touches the area,
but i would use that myself : " SetEntityActive("ScareTwoMonster", false); "


RE: Problem with patrol nodes - JoeBradleyUK - 10-16-2011

(10-16-2011, 04:50 PM)Unearthlybrutal Wrote: You need to ensure that the enemy touches the area,
but i would use that myself : " SetEntityActive("ScareTwoMonster", false); "
I did the changes and made sure that the monster touches the area but it still does nothing.


RE: Problem with enemy not disappearing - Unearthlybrutal - 10-16-2011

How about this? Does anything?

Spoiler below!

void OnStart()
{
AddEntityCollideCallback("ScareMonsterTwo", "ScareTwoMonsterDisappear", "ScareTwoMonsterVanish", false, 1);
}

void ScareTwoMonsterVanish(string &in asParent, string &in asChild, int alState)
{
FadeEnemyToSmoke("ScareMonsterTwo", true);
}




AddEntityCollideCallback("ScareMonsterTwo", "ScareTwoMonsterDisappear", "ScareTwoMonsterVanish", true, 1);
--->
AddEntityCollideCallback("ScareMonsterTwo", "ScareTwoMonsterDisappear", "ScareTwoMonsterVanish", false, 1);



RE: Problem with enemy not disappearing - JoeBradleyUK - 10-18-2011

(10-16-2011, 07:17 PM)Unearthlybrutal Wrote: How about this? Does anything?

Spoiler below!

void OnStart()
{
AddEntityCollideCallback("ScareMonsterTwo", "ScareTwoMonsterDisappear", "ScareTwoMonsterVanish", false, 1);
}

void ScareTwoMonsterVanish(string &in asParent, string &in asChild, int alState)
{
FadeEnemyToSmoke("ScareMonsterTwo", true);
}






AddEntityCollideCallback("ScareMonsterTwo", "ScareTwoMonsterDisappear", "ScareTwoMonsterVanish", true, 1);
--->
AddEntityCollideCallback("ScareMonsterTwo", "ScareTwoMonsterDisappear", "ScareTwoMonsterVanish", false, 1);

I found the problem, it wasn't what you said, it was just a silly mistake by me....again....I really need a proof reader >.< I changed The "ScareMonsterTwo" to "ScareTwoMonster" as it should be.