Frictional Games Forum (read-only)
What's wrong with my script? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: What's wrong with my script? (/thread-9060.html)



What's wrong with my script? - Tirilno - 07-10-2011

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
{

}


RE: What's wrong with my script? - Kyle - 07-10-2011

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.


RE: What's wrong with my script? - Tirilno - 07-10-2011

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




RE: What's wrong with my script? - palistov - 07-10-2011

http://wiki.frictionalgames.com/hpl2/amnesia/script_functions

Use the table of contents to find what you need.


RE: What's wrong with my script? - Tirilno - 07-10-2011

(07-10-2011, 02:41 PM)palistov Wrote: http://wiki.frictionalgames.com/hpl2/amnesia/script_functions

Use the table of contents to find what you need.

I'm using it Smile