Frictional Games Forum (read-only)

Full Version: Problem with enemy not disappearing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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()
{
}
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()
{
}


(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?
AddEnemyPatrolNode("ScareTwoMonster", "ScareTwoNodeOne", 0.0f, "");
AddEnemyPatrolNode("ScareTwoMonster", "ScareTwoNodeTwo", 30.0f, "");

--->

AddEnemyPatrolNode("ScareTwoMonster", "ScareTwoNodeOne", 0, "");
AddEnemyPatrolNode("ScareTwoMonster", "ScareTwoNodeTwo", 30, "");
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);
}
You need to ensure that the enemy touches the area,
but i would use that myself : " SetEntityActive("ScareTwoMonster", false); "
(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.
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);
(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.