PolyObjs with separate open/close sounds?

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
ace
Posts: 787
Joined: Tue Jun 21, 2005 10:14 am
Location: Just south of the True North

PolyObjs with separate open/close sounds?

Post by ace »

I am at an understanding (according to this thread) that with SNDSEQ it is possible to get PolyObjects to play separate sounds for closing and for opening. However, while granted I have hardly used SNDSEQ and as a result am inexperienced in it, I cannot seem to comprehend how it is possible to define seperate sounds while PolyObjects seem to always play the sound a second time when closing no matter what.

So at this point I am confused: I wish to simply have a common sound sequence that plays doors/dr1_open when a polyobject is opened and doors/dr1_clos when one is closed. Is this actually possible or did I just miss something about it? I tried getting something out of the SNDSEQ that was linked to in the aforementioned thread but I could get little out of it and nowhere does it define any door sequences for polyobjects either, so at this point I'm just a wee bit confused. :?
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Post by randi »

You can't do it with one sequence. You need three. Define one sequence for the opening sound, another sequence for the closing sound, and the final sequence combining them. See here for Heretic's doors:

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
]
When a door moves, the HereticDoor sequence is played. It jumps to the appropriate sequence based on which event caused the door to move. 0 and 1 are for normal speed doors, and 2 and 3 are for turbo speed doors. Since there is no speed differentiation for polyobject doors, they will only play events 0 and 1. This also only works with polyobjs moved with Polyobj_DoorSwing and Polyobj_DoorSlide.
User avatar
ace
Posts: 787
Joined: Tue Jun 21, 2005 10:14 am
Location: Just south of the True North

Post by ace »

How do I apply this, then? Simply as-is? I am using a PolyObj_DoorSlide, and earlier I tried simply copying/pasting the Doom excerpt from the SNDSEQ example, but it still played no sound, which leads me to believe there's more to it.
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Post by randi »

You need to specify the sequence's ID on the polyobj's Polyobj_StartLine (or all of its Polyobj_ExplicitLines if you used those). And to attach an ID to a sequence, you add "Door id" somewhere in its definition, where id is some number.
User avatar
ace
Posts: 787
Joined: Tue Jun 21, 2005 10:14 am
Location: Just south of the True North

Post by ace »

I am aware of that; but where to I define the ID? Defining it on one or the other of the separate sequences (as I expected) played just the sound the ID was attached to, and attaching it to the last one gave a "bad numerical constant" error. So either there is something else I am supposed to add to define a door ID or I simply have not seen to add it somewhere else.

And apologies for being a bit slow about this. Summer has officially fried my brain. :p
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Post by randi »

I guess it's broken, but it should go in the sequence defined with brackets.
User avatar
Nash
 
 
Posts: 17501
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

Wouldn't it be more convenient and more headache-free to add a new parameter to Polyobj_StartLine that defines the ID for the closing sound?
Locked

Return to “Editing (Archive)”