Frictional Games Forum (read-only)

Full Version: What's wrong with my script?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hello. I asked about this before but I didn't get any answers. I Kinda wanted to make a grunt break the door and come out after me. but he doesn't come out. can anyone look at my script? Smile

void OnStart()
{
AddEntityCollideCallback("Player", "ActiveScareGruntArea" , "ScareGrunt", true , 1);
AddEntityCollideCallback("ScareGrunt", "BreakMonsterDoor", "ScareGrunt", true, 1);
}
void ScareGrunt(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("ScareGrunt", true);
AddEnemyPatrolNode("ScareGrunt", "PathNodeArea_1", 1, "");
AddEnemyPatrolNode("ScareGrunt", "PathNodeArea_2", 1, "");
AddEnemyPatrolNode("ScareGrunt", "PathNodeArea_3", 1, "");
}
void BreakMonsterDoorTimer(string &in asEntity)
{
AddTimer("BreakDoor", 2.0f, "BreakMonsterDoor");
SetEntityActive("ScareGrunt", true);
AddQuest("PortalFormula1", "PortalFormula1");
}

void BreakMonsterDoor(string &in asTimer)
{
SetEntityActive("MonsterDoor", true);
SetEntityActive("MonsterDoor2", true);
PlaySoundAtEntity("WoodScare", "lurker_hit_wood.snt", "Player", 0.0f, false);
PlaySoundAtEntity("GruntScare", "grunt_notice_long.snt", "Player", 0.0f, false);
}

void DespawnScareGrunt(string &in asParent, string &in asChild, int alState)
{
FadeEnemyToSmoke("ScareGrunt", false);
}
void OnLeave
{

}
If the monster's path nodes pass through the door, then he'll try to break it and then continue on, so if the door is open when that happens, the monster just walks through.

The manual way you do this would already be flawed for what you are trying to achieve.
(07-10-2011, 01:30 PM)Kyle Wrote: [ -> ]If the monster's path nodes pass through the door, then he'll try to break it and then continue on, so if the door is open when that happens, the monster just walks through.

The manual way you do this would already be flawed for what you are trying to achieve.
Hah, it works now Smile but I need help to one more thing. How can I get mementos or quests when I pick up a note/key? What are the scripts? I have tried to search on it but I didn't find anything. :/

http://wiki.frictionalgames.com/hpl2/amn..._functions

Use the table of contents to find what you need.
(07-10-2011, 02:41 PM)palistov Wrote: [ -> ]http://wiki.frictionalgames.com/hpl2/amn..._functions

Use the table of contents to find what you need.

I'm using it Smile