Frictional Games Forum (read-only)
Prison Section 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: Prison Section Door (/thread-9313.html)

Pages: 1 2 3


RE: Prison Section Door - AlexxShadenk777 - 07-26-2011

I opened up both enemies in the model editor, and looked into their stats in the user defined variables. Scrolled down to their respective BreakDoorAttackDamage spaces but it occurred to me that it can't be the damage, otherwise a Grunt would eventually destroy that door, just take twice as long as a Brute (damage is 26 for a Grunt, 50 for a Brute). However, if you look further down there's the stat BreakDoorAttackStrength, and it's 6 for a Grunt, but 3 for the Brute.

Just a thought, maybe that 3 is relevant. Or it's just something else entirely. It's something.


RE: Prison Section Door - MrCookieh - 07-26-2011

Okay, that would be awesome if it works, because my 'Hide door1, unhide destroyed door2' thing
doesn't work really well, because the grunt keeps hitting in the air.
I'm trying it out now Smile

/After Testing: Nope, doesn't work :/
anyways, thanks for help, I might search in the model editor any options, which might help!


RE: Prison Section Door - Grimstoll - 07-27-2011

If you're willing to use the model editor i suppose you could open the prison section door, (save as a new entity called prison_section_YOURNAMEHERE.ent) click on the hinges, check 'Disable Visible Mesh' (or something similar) and delete the hinge body. then delete the hinge_constraint. You can then test the entity by pressing the cogwheels at the bottom. The door should move freely, as if not on hinges.

Then you can use palistov's suggestion, but instead of using setprophealth(0); you use SetEntityActive("prison_section_mycustomentity" , true);

Edit: There is already a prison_section_broken.ent, just use SetEntityActive("prison_section_broken" , true); after three or four hits.
Also it seems there is no 'Disable Visible Mesh' checkbox, even though i'm positive i saw one earlier...
Nevermind, you've already tried that, maybe try going into model editor>settings>uservariables and make sure that the entity which spawns on break is prison_section_broken.ent


RE: Prison Section Door - MrCookieh - 07-27-2011

I already tried it with setting the prison door active = false, but then the grunt doesn't stop attacking
the air, although I removed his current pathnodes, and gave him new ones.

And how can I get how many times the grunt hit the door?


RE: Prison Section Door - Grimstoll - 07-27-2011

AddEntityCollideCallback("grunt_1" , "door_1" , "hitdoor" , false , 1);

hitdoor(asParent , asChild , alState);
{
AddLocalVarInt("HitNumber" , 1);
if(GetLocalVarInt("HitNumber")>=3){
// Grunt has hit the door 3 times
}
}


RE: Prison Section Door - MrCookieh - 07-28-2011

Okay I've set the grunt inactive instantly after bashing the door, and turning him active again, and now
he stops bashing the door.

Ahhh, I've never thought that this would work! Thank you very much!


RE: Prison Section Door - MrCookieh - 07-31-2011

(07-27-2011, 03:54 PM)Grimstoll Wrote: AddEntityCollideCallback("grunt_1" , "door_1" , "hitdoor" , false , 1);

hitdoor(asParent , asChild , alState);
{
AddLocalVarInt("HitNumber" , 1);
if(GetLocalVarInt("HitNumber")>=3){
// Grunt has hit the door 3 times
}
}

Hmm, this doesn't work, it seems that the grunt doesn't 'touch' the door...


RE: Prison Section Door - DRedshot - 07-31-2011

try:

AddEntityCollideCallback("grunt_1" , "doorArea" , "hitdoor" , false , 1);

hitdoor(asParent , asChild , alState);
{
AddLocalVarInt("HitNumber" , 1);
if(GetLocalVarInt("HitNumber")>=3){
// Grunt has hit the door 3 times
}
}

just make an area in front of the door



RE: Prison Section Door - Kyle - 07-31-2011

Code:
hitdoor(asParent , asChild , alState);
{
AddLocalVarInt("HitNumber" , 1);
if(GetLocalVarInt("HitNumber")>=3){
// Grunt has hit the door 3 times
}
}

This is wrong...

Try this:

Code:
void hitdoor(string &in asParent, string &in asChild, int alState)
{
     AddLocalVarInt("HitNumber", 1);
     if (GetLocalVarInt("HitNumber") == 3)
     {
          SetPropHealth("DoorName", 0);
     }
}

By the way, what if the door is already open? What are you going to do then? Add it to the script? You can simply have the monster stand there as the game simulates the monster hitting it each time with the monster just standing right outside of the door until the door is broken down, then the monster continues on his path.


RE: Prison Section Door - MrCookieh - 07-31-2011

Well, we are talking about a prisoner door, that can't be destroyed by grunts.
(Also I somehow think, that in the main story, a grunt can destroy the last door in the prison, although
it's a prison door...)
We already tried the SetPropHealth(...); But it somehow can't be destroyed, that's why I want to simulate
him breaking the door via trigger.
And the door is locked, it can't be opened.