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
Model Editor Help Custom door - sounds not working as they should
GrimReaper Offline
Junior Member

Posts: 2
Threads: 1
Joined: Jan 2013
Reputation: 0
#1
Custom door - sounds not working as they should

Hello, I just recently started fiddling around with Amnesia's level editor and the model editor. Now I have a few problems with the model editor and a selfmade door entity...

I tried searching the net and the forums but didn't get any answers. So I just registered this forum in hope you could solve my problems or at least help me doing so! Big Grin

Two days ago I just had the idea to build a swingable door from the originally static door entity "castle_gate_arched01" - if possible.

So I looked at already exiting door entities from the original Amnesia to see what changes would be necessary.

Based on my observations I performed the following changes:

  1. opened the file "castle_gate_arched01.ent" and saved it under another name
  2. created two new cylindric bodies inside the mesh's faked hinges to use them as pivots
  3. added two hinge-joints and moved them to their correct places on the pivots
  4. turned the hinges to make sure both sides open in the correct direction (one hinge is therefore upside down)
  5. set the type of the entity to SwingDoor
  6. attached the new bodies of the hinges to the joints (as parents) so that they remain static
  7. attached the bodies of the door sides to the joints (as children) so that they pivot around the hinge-bodies
  8. scaled the width and height of the door's bodies down a litte bit so that they won't collide with each other and the floor while opening or closing the door
  9. took the same body values for mass, dampening, moving speed and collision as in the mansion door entity
  10. set the joints' angles to min. 0.1 and max. 90 degrees (same as in mansion door)
  11. set the joints' moving sound to linear and the sound file to "joint_door_move_special.snt"
  12. opened up the user defined variables and chose "close_door.snt" for CloseOnSound, "open_door.snt" for CloseOffSound and "lock_door.snt" for InteractLockedSound

That actually got the door to work - but only with some problems I don't know how to fix.

The problems are:
  • the door can be opened and closed simply by walking right through or against it allthough I set "Collide character" to true and "Pushed by player gravity" to false
  • allthough having set them the sounds for opening and closing the door (open_door.snt and close_door.snt) don't play, that means there is no sound when clicking and unclicking the door ingame (but the moving sound works)
  • both sides of the door won't snap to the minimal angle like e.g. the mansion door does

All in all the door now behaves like the "elevator_door" entity and I can't figure out why. I would rather like the door to behave like the mansion door or the metal door entities.

Opening the door's .ent-file in Notepad++ shows every set value in its correct place.

What has to be changed to get this done? Or are there technical limits to the editor/enginge/whatever preventing this?

Like I said, I hope you can help me.


GrimReaper
(This post was last modified: 01-24-2013, 11:06 PM by GrimReaper.)
01-24-2013, 11:03 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#2
RE: Custom door - sounds not working as they should

Haven't you tried copy-pasting the main settings from the original doors? It's just easier.

The door sounds go in the joint. This joint controlls the body, which controlls the mesh. Just go to View<Outline and assign the parent and the child (the joint parent is the small and non-gravitatorial body which you set in the invisible part of the door (the hinges) and the child of the joint is the body which contains the door's mesh.

Just some tips. Try deleting the entity and making another one with these settings, just in case.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
01-25-2013, 10:47 AM
Find
GrimReaper Offline
Junior Member

Posts: 2
Threads: 1
Joined: Jan 2013
Reputation: 0
#3
RE: Custom door - sounds not working as they should

Thanks for your answer! Rep. inbound! Wink

(01-25-2013, 10:47 AM)The chaser Wrote: Haven't you tried copy-pasting the main settings from the original doors? It's just easier.
I copied each value manually but I compared several entity-files in Notepad++ to make sure I didn't miss any important options. Of course everything was identical but not successful.

Quote:The door sounds go in the joint. This joint controlls the body, which controlls the mesh. Just go to View<Outline and assign the parent and the child (the joint parent is the small and non-gravitatorial body which you set in the invisible part of the door (the hinges) and the child of the joint is the body which contains the door's mesh.
Yes, I attached child and parent to the joints in exactly this way. Aside from the player gravity collision issue I can grab the doors and open and close them without any problems. So the bodies are attached correctly.

Indeed I can assign a sound directly to the joint. But then only the sound being played when reaching the joint's minimal angle (that means the closing sound) work.
That way the whole entity works exactly like the elevator_door-entity: While moving the door, the moving sound is being played, upon slamming the door shut the closing sound is being played. Nothing more, nothing less.

Quote:Just some tips. Try deleting the entity and making another one with these settings, just in case.
I tried that one, too. It only led to the same unwanted result.


Now something new:
Since yesterday I seem to have located the source of my problems:

All of the mentioned behavior is caused by using more than one hinge joint!

After writing my initial post I just remembered that I checked everything but the amount of joints. Since all doors behaving like I wished my door would only have one single hinge joint and since the elevator door and my door have two hinge joints I thought there might be a correlation.

And yes, after deleting one hinge joint and setting the mass of the now unattached door body to zero (thus making it static) my door worked exactly like it should - aside from now only one side being movable.

With only one hinge joint the door snaps close, plays sounds upon opening and closing, is unaffected by the player's gravity and so forth.

But just by adding a second hinge joint, the door's behavior changes back to its "faulty" state. Dodgy

It seems to me as if this behavior is determined by the system and not changeable.


So now I think I have to familiarize myself with Blender to divide the two submeshes of the left and right sides of the door into seperate files and to create two single door entities to place them side by side in the level editor. Through scripting I can then make them both work together in union like they should (locking/unlocking etc.). Smile


If anyone has better solutions, please tell me.
01-25-2013, 04:51 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#4
RE: Custom door - sounds not working as they should

Wait a sec, two hinges aren't necessary Smile

The only thing about the meshes:

You must have:

The door mesh (the door itself)
The door hinges (THIS IS ONLY ONE MESH) //You can Join several meshes in Object Mode, at the left bar.
In the model editor, create three shapes: One that fits the door itself, and one for each hinge, but ATTENTION!

With the door shape create a body, attach it, etc-With the hinges, choose the two shapes and make a body: Then relate the body to the hinges mesh.
In the joint, the parent is the static body of the hinges, and the child is the door itself.

Note that this is what I do when I want to make doors, I guess one of these should work. In extreme case, you can give me your model and I'll fix it for you, I've done it several times Wink

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
01-25-2013, 05:22 PM
Find




Users browsing this thread: 1 Guest(s)