Frictional Games Forum (read-only)
Brute won't stop attacking door - 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: Brute won't stop attacking door (/thread-16128.html)



Brute won't stop attacking door - Damascus - 06-14-2012

I'm trying to make a script where a brute is approaching the player, and if the player chooses to close an unbreakable door on it, it will pound on the door for about ten seconds, and then give up and walk away. However, even though I've tried to disable all its triggers and clear its patrol route, it will never stop attacking the door. Here's the script:

PHP Code:
void CheckDoor(string &in asParentstring &in asChildint alState)  //called by an area around the door
{
    if(
GetLocalVarInt("InTerror")==&& GetSwingDoorClosed("prison_2"))  //makes sure the player is inside the room with the door closed
    
{
        
SetEnemyDisableTriggers("servant_brute_1"true);
        
SetSwingDoorLocked("prison_2"truetrue);
        
SetEntityPlayerInteractCallback("prison_2""DoorJam"true);
        
AddTimer(""10"RerouteMongrel");
    }
}

void RerouteMongrel(string &in asTimer)
{
    
ClearEnemyPatrolNodes("servant_brute_1"); //clears the node inside the room
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_2"0.001f"");  //adds the nodes leading down an adjacent hallway
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_3"0.001f"");


The door locks and adds the callback so I know the function itself is working, but the brute still refuses to leave the door alone.


RE: Brute won't stop attacking door - Adny - 06-14-2012

Depending on the type of door you're using, you could try to work around it; if its a prison door* and not the prison section*, you can set the brute inactive, add timers for effects (such as the brute making a swinging sound, the wood door impact sound, and adding a particle system+prop force on the door). It will look pretty convincing if done properly, and the player will be none the wiser.

(*The prison is the full wooden door with a little window at the top, and the prison section is the metal bar door. You'd want the prison for my idea.)


To directly address your issue though, I think the enemies are forced to attack doors until they break; so making it unbreakable = no bueno.


RE: Brute won't stop attacking door - Damascus - 06-14-2012

Yeah it's the prison door, not the prison section. I could try your suggestion but if the player looks through the little window the jig would be up. Perhaps instead I can just run out the timer and then replace him entirely with a new grunt that will follow the new path.


RE: Brute won't stop attacking door - Adny - 06-14-2012

(06-14-2012, 08:54 AM)Damascus Wrote: Yeah it's the prison door, not the prison section. I could try your suggestion but if the player looks through the little window the jig would be up. Perhaps instead I can just run out the timer and then replace him entirely with a new grunt that will follow the new path.
You'd have to modify it so the monster won't play its enabled sound when it re-actives, for the full effect; sadly I have no clue how to do that.

Alternatively, if there is a collide area that triggers the event, you could just set the player's run speed to 0.0f (which allows them to look freely around but gives the same effect as "SetPlayerActive"), disable jumping, then have the player look at the door whilest sheet is going down.

Idk, just feeling creative at the moment.


RE: Brute won't stop attacking door - Dutton - 06-14-2012

(06-14-2012, 09:06 AM)andyrockin123 Wrote: just feeling creative at the moment.
infinite possibilities are opening up opon this though Smile!


RE: Brute won't stop attacking door - Damascus - 06-14-2012

(06-14-2012, 09:06 AM)andyrockin123 Wrote:
(06-14-2012, 08:54 AM)Damascus Wrote: Yeah it's the prison door, not the prison section. I could try your suggestion but if the player looks through the little window the jig would be up. Perhaps instead I can just run out the timer and then replace him entirely with a new grunt that will follow the new path.
You'd have to modify it so the monster won't play its enabled sound when it re-actives, for the full effect; sadly I have no clue how to do that.
Oh that's easy. Just create a new entity for it, go into it's setting and remove "enabled.snt." I did the same thing for springing grunts on the player in other parts of the story. Imagine walking through these dark tunnels and opening a door to find a grunt with it's back to you, and you never heard it become enabled. >:]

Anyway, I tried it out by switching brutes and disabling it's activation sound and it's working great so I'm going to mark this as solved!


RE: Brute won't stop attacking door - Adny - 06-14-2012

(06-14-2012, 09:54 AM)Damascus Wrote:
(06-14-2012, 09:06 AM)andyrockin123 Wrote:
(06-14-2012, 08:54 AM)Damascus Wrote: Yeah it's the prison door, not the prison section. I could try your suggestion but if the player looks through the little window the jig would be up. Perhaps instead I can just run out the timer and then replace him entirely with a new grunt that will follow the new path.
You'd have to modify it so the monster won't play its enabled sound when it re-actives, for the full effect; sadly I have no clue how to do that.
Oh that's easy. Just create a new entity for it, go into it's setting and remove "enabled.snt." I did the same thing for springing grunts on the player in other parts of the story. Imagine walking through these dark tunnels and opening a door to find a grunt with it's back to you, and you never heard it become enabled. >:]

Anyway, I tried it out by switching brutes and disabling it's activation sound and it's working great so I'm going to mark this as solved!



I know you solved your issue, but would you mind enlighten me as to how to remove the sounds/music from enemies such as the grunt? More specifically, where are the files I can mess around with to do so?


RE: Brute won't stop attacking door - Datguy5 - 06-14-2012

(06-14-2012, 10:14 AM)andyrockin123 Wrote:
(06-14-2012, 09:54 AM)Damascus Wrote:
(06-14-2012, 09:06 AM)andyrockin123 Wrote:
(06-14-2012, 08:54 AM)Damascus Wrote: Yeah it's the prison door, not the prison section. I could try your suggestion but if the player looks through the little window the jig would be up. Perhaps instead I can just run out the timer and then replace him entirely with a new grunt that will follow the new path.
You'd have to modify it so the monster won't play its enabled sound when it re-actives, for the full effect; sadly I have no clue how to do that.
Oh that's easy. Just create a new entity for it, go into it's setting and remove "enabled.snt." I did the same thing for springing grunts on the player in other parts of the story. Imagine walking through these dark tunnels and opening a door to find a grunt with it's back to you, and you never heard it become enabled. >:]

Anyway, I tried it out by switching brutes and disabling it's activation sound and it's working great so I'm going to mark this as solved!



I know you solved your issue, but would you mind enlighten me as to how to remove the sounds/music from enemies such as the grunt? More specifically, where are the files I can mess around with to do so?
I think you need to go to the model editor,then open the enemy and go to user defined variables.There are many choices there.


RE: Brute won't stop attacking door - Damascus - 06-14-2012

Yep, just save a new entity of the enemy in your custom story folder, then go into User Defined Variables and delete this line:

[Image: 1W9Zo.png]

To silence the music that plays while it's idling/searching, delete the lines further up that are called "att_brute.ogg" "dan_brute.ogg" "search_brute.ogg."