[Solved] Sound behaviour of swinging doors?

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Tormentor667
Posts: 13554
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

[Solved] Sound behaviour of swinging doors?

Post by Tormentor667 »

Dear ZDoomers,

out of curiosity, if I create a SNDSEQ for a swinging door, how does it actually behave? Which sound is played when? Or actually can I give different sounds to the situation when the door "opens" and when it "closes" (so to be more precise "open" when I first use the polydoor and "closes" when it's closing animation ends)
Last edited by Tormentor667 on Sun Mar 12, 2017 12:43 pm, edited 1 time in total.
User avatar
Enjay
 
 
Posts: 27026
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Sound behaviour of swinging doors?

Post by Enjay »

I don't know if things have been improved since this, but the method described here has worked for me.


viewtopic.php?t=11388

Image
User avatar
Tormentor667
Posts: 13554
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Re: Sound behaviour of swinging doors?

Post by Tormentor667 »

Thanks Enjay,

Code: Select all

    :HereticDoorOpen
       play       doors/dr1_open
       nostopcutoff
    end

    :HereticDoorClose
       play       doors/dr1_open
       stopsound  doors/dr1_clos
    end

    [HereticDoor
       0      HereticDoorOpen
       1      HereticDoorClose
       2      HereticDoorOpen
       3      HereticDoorClose
    ]
If that's the code I am having trouble with understanding the last part... :-/
User avatar
Enjay
 
 
Posts: 27026
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Sound behaviour of swinging doors?

Post by Enjay »

Here's what I used in my Before The Storm mod:

Code: Select all

//////////////////////////////////////////////////////////////
//door opening sound for polyobjects (fast door open sound)
:PolyOpenFast
	play		PolyOpenFast
	nostopcutoff
end

//door closing sound for polyobjects (fast door open sound)
:PolyCloseFast
	play		PolyCloseFast
	nostopcutoff
end

[PolyFastNJ
	DOOR		32
	0		PolyOpenFast
	1		PolyCloseFast
	2		PolyOpenFast
	3		PolyCloseFast
]
//////////////////////////////////////////////////////////////
See how I've added DOOR 32 to my definition? Putting 32 on to the line in the editor as the sound sequence parameter did the trick IIRC. I *think* what ZDoom does internally is if the poly is moving quickly, it picks the fast sounds and it also distinguishes between whether it is opening or closing. At least that's how I remember it. So, again from memory, the one sequence can be set to pick a fast or slow sound and an open or close sound depending on how the poly is moving... I think.


[edit] and more...

From zdoom.pk3

Code: Select all

// Doom Doors ---------------------------------

:DoorOpenNormal
	play		doors/dr1_open
	nostopcutoff
end

:DoorCloseNormal
	play		doors/dr1_clos
	nostopcutoff
end

:DoorOpenBlazing
	play		doors/dr2_open
	nostopcutoff
end

:DoorCloseBlazing
	play		doors/dr2_clos
	nostopcutoff
end

[DoorNormal
	0		DoorOpenNormal
	1		DoorCloseNormal
	2		DoorOpenBlazing
	3		DoorCloseBlazing
]
From that it looks as if things should be set up so that the normal/slow sounds should be sequences 0 and 1 and the fast sounds 2 and 3. If you want only one type of sound (speed-wise) then you duplicate things so that 0 and 1 read the same as 2 and 3.

[edit2]
Aaaand, there's a bit of detail towards the bottom of the wiki [wiki]SNDSEQ[/wiki] page on this too.
User avatar
Tormentor667
Posts: 13554
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Re: Sound behaviour of swinging doors?

Post by Tormentor667 »

Thanks alot Nigel :) With this information I was able to solve the problem.
Gez
 
 
Posts: 17945
Joined: Fri Jul 06, 2007 3:22 pm

Re: Sound behaviour of swinging doors?

Post by Gez »

Too bad, one '8' too many to make the Lucas ref really relevant.
User avatar
Enjay
 
 
Posts: 27026
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: [Solved] Sound behaviour of swinging doors?

Post by Enjay »

I didn't even spot that. Good eye.
Locked

Return to “Editing (Archive)”