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
Problem with enemy not disappearing
JoeBradleyUK Offline
Member

Posts: 115
Threads: 20
Joined: Jul 2011
Reputation: 0
#1
Problem with enemy not disappearing

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()
{
}

:Work In Progress:
Insanity
(This post was last modified: 10-18-2011, 03:13 PM by JoeBradleyUK.)
10-16-2011, 10:59 AM
Find
Unearthlybrutal Offline
Posting Freak

Posts: 775
Threads: 12
Joined: May 2011
Reputation: 26
#2
RE: Problem with patrol nodes

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()
{
}



When Life No Longer Exists
Full-conversion mod
10-16-2011, 11:21 AM
Website Find
JoeBradleyUK Offline
Member

Posts: 115
Threads: 20
Joined: Jul 2011
Reputation: 0
#3
RE: Problem with patrol nodes

(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?

:Work In Progress:
Insanity
10-16-2011, 11:25 AM
Find
Unearthlybrutal Offline
Posting Freak

Posts: 775
Threads: 12
Joined: May 2011
Reputation: 26
#4
RE: Problem with patrol nodes

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

--->

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

When Life No Longer Exists
Full-conversion mod
(This post was last modified: 10-16-2011, 01:33 PM by Unearthlybrutal.)
10-16-2011, 01:33 PM
Website Find
JoeBradleyUK Offline
Member

Posts: 115
Threads: 20
Joined: Jul 2011
Reputation: 0
#5
RE: Problem with patrol nodes

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);
}

:Work In Progress:
Insanity
(This post was last modified: 10-16-2011, 04:42 PM by JoeBradleyUK.)
10-16-2011, 04:41 PM
Find
Unearthlybrutal Offline
Posting Freak

Posts: 775
Threads: 12
Joined: May 2011
Reputation: 26
#6
RE: Problem with patrol nodes

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

When Life No Longer Exists
Full-conversion mod
10-16-2011, 04:50 PM
Website Find
JoeBradleyUK Offline
Member

Posts: 115
Threads: 20
Joined: Jul 2011
Reputation: 0
#7
RE: Problem with patrol nodes

(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.

:Work In Progress:
Insanity
10-16-2011, 05:15 PM
Find
Unearthlybrutal Offline
Posting Freak

Posts: 775
Threads: 12
Joined: May 2011
Reputation: 26
#8
RE: Problem with enemy not disappearing

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);

When Life No Longer Exists
Full-conversion mod
(This post was last modified: 10-16-2011, 07:18 PM by Unearthlybrutal.)
10-16-2011, 07:17 PM
Website Find
JoeBradleyUK Offline
Member

Posts: 115
Threads: 20
Joined: Jul 2011
Reputation: 0
#9
RE: Problem with enemy not disappearing

(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.

:Work In Progress:
Insanity
(This post was last modified: 10-18-2011, 03:13 PM by JoeBradleyUK.)
10-18-2011, 03:06 PM
Find




Users browsing this thread: 1 Guest(s)