JoeBradleyUK
Member
Posts: 115
Threads: 20
Joined: Jul 2011
Reputation:
0
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
Unearthlybrutal
Posting Freak
Posts: 775
Threads: 12
Joined: May 2011
Reputation:
26
RE: Problem with patrol nodes
Maybe this helps
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
JoeBradleyUK
Member
Posts: 115
Threads: 20
Joined: Jul 2011
Reputation:
0
RE: Problem with patrol nodes
(10-16-2011, 11:21 AM) Unearthlybrutal Wrote: Maybe this helps
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
Unearthlybrutal
Posting Freak
Posts: 775
Threads: 12
Joined: May 2011
Reputation:
26
RE: Problem with patrol nodes
AddEnemyPatrolNode("ScareTwoMonster", "ScareTwoNodeOne", 0.0f, "");
AddEnemyPatrolNode("ScareTwoMonster", "ScareTwoNodeTwo", 30.0f, "");
--->
AddEnemyPatrolNode("ScareTwoMonster", "ScareTwoNodeOne", 0, "");
AddEnemyPatrolNode("ScareTwoMonster", "ScareTwoNodeTwo", 30, "");
10-16-2011, 01:33 PM
JoeBradleyUK
Member
Posts: 115
Threads: 20
Joined: Jul 2011
Reputation:
0
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
Unearthlybrutal
Posting Freak
Posts: 775
Threads: 12
Joined: May 2011
Reputation:
26
RE: Problem with patrol nodes
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
JoeBradleyUK
Member
Posts: 115
Threads: 20
Joined: Jul 2011
Reputation:
0
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
Unearthlybrutal
Posting Freak
Posts: 775
Threads: 12
Joined: May 2011
Reputation:
26
RE: Problem with enemy not disappearing
How about this? Does anything?
AddEntityCollideCallback("ScareMonsterTwo", "ScareTwoMonsterDisappear", "ScareTwoMonsterVanish", true, 1);
--->
AddEntityCollideCallback("ScareMonsterTwo", "ScareTwoMonsterDisappear", "ScareTwoMonsterVanish", false, 1);
10-16-2011, 07:17 PM
JoeBradleyUK
Member
Posts: 115
Threads: 20
Joined: Jul 2011
Reputation:
0
RE: Problem with enemy not disappearing
(10-16-2011, 07:17 PM) Unearthlybrutal Wrote: How about this? Does anything?
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