Frictional Games Forum (read-only)
[SCRIPT] Custom hatch falls through the floor - 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] Custom hatch falls through the floor (/thread-25319.html)



Custom hatch falls through the floor - Neelke - 05-18-2014

So, the hatch I've made falls through the floor and I have no idea what's causing it. Was making a video of it before but it doesnt seem to work anymore. So I do it with images instead.

When hatch is static:
Spoiler below!
[Image: FKlcBjX.jpg?1]

When hatch is not static:
Spoiler below!
[Image: g7idizp.jpg?1]



RE: Custom hatch falls through the floor - Mudbill - 05-18-2014

How did you make it? Don't you have a static part that it's attached to? What's the entity type? You can always try to look at the original hatches and see how they are made. Try to replicate them if you want them to act similarly.


RE: Custom hatch falls through the floor - Neelke - 05-18-2014

It's a SwingDoor. I did the same variables as the hatch_ceiling. Here is the picture of the model itself (nothing special looking really, but it works).

Spoiler below!
[Image: 9N5ySUm.jpg?2]

And this below is how all the bodies and hinges are currently behaving.

Frame:

Code:
Body Material = Rock
Mass = 0
Angular Damping = 0
Linear Damping = 0
Max Angular Speed = 0
Max Linear Speed = 0
Buoyancy density mul = 1

Blocks sound = true
Continuous collision = true
Can attach character = true
Pushed by character gravity = true
Collide character = true
Collide non character = true
Volatile = false
Use surface effects = true
Has gravity = true

Door:

Code:
Body Material = Rock
Mass = 10
Angular Damping = 0
Linear Damping = 0
Max Angular Speed = 0
Max Linear Speed = 0
Buoyancy density mul = 1

Blocks sound = true
Continuous collision = true
Can attach character = true
Pushed by character gravity = true
Collide character = true
Collide non character = true
Volatile = false
Use surface effects = true
Has gravity = true

Joint:

Code:
Sticky Min Limit = true
Sticky Max Limit = true
Limit Step Count = 0
Collide Bodies = true
Breakable = false
Break Force = 0

Min Angle = -135
Max Angle = 0

Move Type = Angular
Move Sound = joint_sewer_door.snt (just like hatch_ceiling)

I feel like the rest aint necessary from this point.

I havent clicked Set Parent/Child Body on the joint. Should I do so? Or is there something wrong with this above?


RE: Custom hatch falls through the floor - Daemian - 05-18-2014

Yes, set its parent/child. Parent for the static body, child for the door. So, two bodies.
Gravity on the door should be on, mass about 5 or 10, and collision with player/stuff on.
If the door goes mad in-game, make its body a little smaller than the model, so it doesn't collide with any border or anything nearby.
Check the attachments as well, the door model should be attached only to the body you made for it.
For your hatch I think you're gonna need to enable that option named Sticky Minimum on the hinge so the door stays in place until the player comes and moves it.


RE: Custom hatch falls through the floor - Neelke - 05-18-2014

Well, at least it doesn't fall through the map. But now I encountered another issue. Now it only rotates around, like when turning a wheel except that it rotates from the joint. I want it to be like the hatch_ceiling entity. I'm gonna assume you know how that hatch functions.

I think I need to change the MoveAxis in the joint or User Defined Variables. But I cannot really find it.


RE: Custom hatch falls through the floor - Mudbill - 05-18-2014

What joint type did you use? There are several. I think JointHinge is the one you want.


RE: Custom hatch falls through the floor - Daemian - 05-19-2014

I don't understand what you mean. Sorry.


RE: Custom hatch falls through the floor - Mudbill - 05-19-2014

[Image: diDGEvg.png]

Edit: Damn, again I misread the poster >o<
Oh well, it never hurts to explain a bit more.


RE: Custom hatch falls through the floor - Neelke - 05-19-2014

Well, with Asbergers along the way, it makes it incredibly difficult to explain it properly.

And Mudbill, I use a hinge joint.