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
Brute won't stop attacking door
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#1
Brute won't stop attacking door

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: (Select All)
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.

(This post was last modified: 06-14-2012, 09:54 AM by Damascus.)
06-14-2012, 08:37 AM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: Brute won't stop attacking door

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.

I rate it 3 memes.
06-14-2012, 08:49 AM
Find
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#3
RE: Brute won't stop attacking door

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.

06-14-2012, 08:54 AM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#4
RE: Brute won't stop attacking door

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

I rate it 3 memes.
06-14-2012, 09:06 AM
Find
Dutton Offline
Member

Posts: 121
Threads: 3
Joined: Apr 2012
Reputation: 2
#5
RE: Brute won't stop attacking door

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

[Image: 15isy6C]
06-14-2012, 09:32 AM
Find
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#6
RE: Brute won't stop attacking door

(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!

06-14-2012, 09:54 AM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#7
RE: Brute won't stop attacking door

(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 rate it 3 memes.
06-14-2012, 10:14 AM
Find
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#8
RE: Brute won't stop attacking door

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

06-14-2012, 02:53 PM
Find
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#9
RE: Brute won't stop attacking door

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."

06-14-2012, 07:24 PM
Find




Users browsing this thread: 1 Guest(s)