Frictional Games Forum (read-only)
Script with doors - 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: Script with doors (/thread-8720.html)



Script with doors - SLAMnesia - 06-20-2011

Hey guys!

I have a door that I want to fall off its hinges when you try to open it. (you click and drag to open it but it just collapses and becomes uninteractable)

I think I'll need a new door entity file or something maybe script idk but is there a way to do so?



RE: Script with doors - Nye - 06-21-2011

There is currently no door entity that you can pull around off hinges, so you will need to create a custom entity, and when the player interacts with the door (interact callback), run a function that will setentityactive("original_door", false); and setentityactive("new_entity_broken_door", true);

I hope this helped.



RE: Script with doors - Kurton - 06-21-2011

For that extra pop, maybe have some areas at the hinges that will spawn dust/dirt particles (CreateParticleSystemAtEntity), and play a wood/metal break sound (PlaySoundAtEntity).


RE: Script with doors - SLAMnesia - 06-21-2011

yeah thats what I thought I'd have to do, but idk how to do that Sad Im just givin up on that idea it isnt crucial to the story. thanks anyways


RE: Script with doors - rojkish - 06-21-2011

You can always do a lookawaycallback, so when the player looks away you set the first entity inactive and then the second entity active with some sounds and ps_break_wood particle system


RE: Script with doors - palistov - 06-21-2011

It would be better to mimic the secret painting entities. That painting has two attach points which "click" off, so to speak. Give it a shot, see how it feels. You can move it a certain amount before the attachment point breaks.

That would give you a kind of break-door-hinges feel if you tweak it properly, and would avoid setting an entity active/inactive. That would just feel strange because it would break the player's interaction with the 'working' door and then there would just be a broken door. It would feel more "real" to have a door they can simply pull off the hinges Big Grin


RE: Script with doors - Rownbear - 06-23-2011

I think theres a door entity which is broken in level editor, just make it so, playerinteract -> createparticle and sounds -> swap the door with the broken door. that way it would seem like the door destroyed when you touched it, and should give alittle jump scare.


RE: Script with doors - Roenlond - 06-23-2011

(06-23-2011, 03:00 AM)Rownbear Wrote: I think theres a door entity which is broken in level editor, just make it so, playerinteract -> createparticle and sounds -> swap the door with the broken door. that way it would seem like the door destroyed when you touched it, and should give alittle jump scare.

Though it'd be EXTREMELY unrealistic if you are able to look at the door. "Ooh a door, let's open it. Oh wow, it disappeared and popped up on the floor in an instant! :o"


RE: Script with doors - Rownbear - 06-23-2011

(06-23-2011, 02:36 PM)Roenlond Wrote:
(06-23-2011, 03:00 AM)Rownbear Wrote: I think theres a door entity which is broken in level editor, just make it so, playerinteract -> createparticle and sounds -> swap the door with the broken door. that way it would seem like the door destroyed when you touched it, and should give alittle jump scare.

Though it'd be EXTREMELY unrealistic if you are able to look at the door. "Ooh a door, let's open it. Oh wow, it disappeared and popped up on the floor in an instant! :o"

well the possesed monsters with claws walking around are very realistic aswell. Though ofcourse you'd have to make it fit in the story but that's one suggestion to it. Now he just have to play around with it and make it the way he want.



RE: Script with doors - Apjjm - 06-23-2011

Just make a non-static non-zero mass door entity with no hinge joint, set it's type as moveable object and you're done - the player will pull/push it and it will fall. If you only want this to occur when the door is in a specific state you are going to need to swap out a normal door with the entity described upon the correct state change.