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
Another Problem Again...
JoeBradleyUK Offline
Member

Posts: 115
Threads: 20
Joined: Jul 2011
Reputation: 0
#3
RE: Another Problem Again...

(10-14-2011, 11:04 PM)Statyk Wrote:
(10-14-2011, 10:15 PM)JoeBradleyUK Wrote: I want to make it so when i walk into an area, you look at the monster (which walks to a patrol node) for a period of time then it stops, when it reaches the path rode is disappears.

It won't work here is my script:
void OnStart(){AddEntityCollideCallback("Player", "ScareOne", "ScareOne", true, 1);}
{AddEntityCollideCallback("Player", "ScareTwoArea", "ScareTwo", true, 1);}
void ScareOne(string &in asParent, string &in asChild, int alState){SetLampLit("ScareOneLight", true, true);SetLampLit("ScareOneLightTwo", true, true);SetEntityActive("ScareOneMonster", true);ShowEnemyPlayerPosition("ScareOneMonster");PlaySoundAtEntity("", "react_scare3.ogg", "Player", 10.0f, true);PlayMusic("LevelOneMusic", true, 10.0f, 2.0f, 2.0f, true);SetSwingDoorLocked("ScareOneDoor", true, true);}
void ScareTwo(string &in asParent, string &in asChild, int alState){AddEnemyPatrolNode("ScareTwoMonster", "ScareTwo", 10.0f, "");StartPlayerLookAt("ScareTwoMonster", 5.0f, 6.0f, "");AddTimer("ScareTwo", 3.0f, "ScareTimerTwo");}
void ScareTimerTwo(string &in asTimer){StopPlayerLookAt();}
void OnEnter(){}void OnLeave(){}

Not exactly sure if this is exactly how you typed this script, but you have so much wrong here...
+ Firstly, You can't just TYPE. You have to organize by "Entering" and hitting "Tab".
+ NOTHING can be put in front of a squiggly-bracket ("{ / }") - These guys).
+ You have to put .snt after SOUND files and .ogg after MUSIC files.
+ An area and a callback can't be the same name. It could possibly confuse the script.

I went ahead and revised everything for you. Delete everything in your .hps and copy this whole thing into there:

//________________________

////////////////
//I'm not sure, but Making the AREA the same name as the CallbackFunc could also screw things up. I changed things for you so you don't have to worry...
////////////////
void OnStart()
{
AddEntityCollideCallback("Player", "ScareOne", "ScareCallback", true, 1);
AddEntityCollideCallback("Player", "ScareTwoArea", "ScareTwo", true, 1);
}

////////////////
//Make sure to put .snt and .ogg in the correct places!
////////////////

void ScareCallback(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", 10.0f, true);
PlayMusic("LevelOneMusic.ogg", true, 10.0f, 2.0f, 2.0f, true);
SetSwingDoorLocked("ScareOneDoor", true, true);
}
void ScareTwo(string &in asParent, string &in asChild, int alState)
{
AddEnemyPatrolNode("ScareTwoMonster", "ScareTwo", 10.0f, "");
StartPlayerLookAt("ScareTwoMonster", 5.0f, 6.0f, "");
AddTimer("ScareTwo", 3.0f, "ScareTimerTwo");
}
void ScareTimerTwo(string &in asTimer)
{
StopPlayerLookAt();
}

void OnEnter()
{

}

void OnLeave()
{

}

//_____________________
I haven't tested it out yet, as I can't, but I do have my hps file entered!! It's just when I put it in the forums it doesn't include the enters, no idea why.

:Work In Progress:
Insanity
10-15-2011, 12:28 AM
Find


Messages In This Thread
Another Problem Again... - by JoeBradleyUK - 10-14-2011, 10:15 PM
RE: Another Problem Again... - by Statyk - 10-14-2011, 11:04 PM
RE: Another Problem Again... - by JoeBradleyUK - 10-15-2011, 12:28 AM
RE: Another Problem Again... - by Juby - 10-15-2011, 01:30 AM
RE: Another Problem Again... - by Statyk - 10-15-2011, 12:54 PM
RE: Another Problem Again... - by Gamemakingdude - 10-16-2011, 12:22 AM
RE: Another Problem Again... - by JoeBradleyUK - 10-16-2011, 10:13 AM



Users browsing this thread: 1 Guest(s)