Small SNDSEQ problem

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
AntiRellik
Posts: 8
Joined: Fri Aug 28, 2009 4:02 pm

Small SNDSEQ problem

Post by AntiRellik »

Hi guys
I added new sounds to my Pk3 for my swinging doors. My sounds are defined and this is what I got in SNDSEQ:

Code: Select all

:SeqSwingDoor
	door 5
	play DoorCrack
	stopsound DoorStop
end
It works perfect, my problem is that I want to use another sound when the door closes.
It plays DoorCrack while opening and closing, and of course, DoorStop when the polyobject movement stops.
The SNDSEQ article in the Wiki wasn't very useful for this matter.
It has this example that shows how to specify the sounds in the lump

Code: Select all

[DoorMine
 Door 1
 0  MyDoorOpen
 1  MyDoorClose
 2  MyDoorFastOpen
 3  MyDoorFastClose
]
I haven't gotten that to work, and if it were to work I'd still like to keep the stopsound. I tried using playrepeat too but it didn't work either. :?
Any help is greatly appreciated =)
User avatar
Ceeb
Posts: 5125
Joined: Wed Jun 11, 2008 4:07 pm
Location: Castle Wut

Re: Small SNDSEQ problem

Post by Ceeb »

I'm not 100% on this, but [wiki]SoundSequenceOnPolyobj[/wiki] may be what you need.
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Re: Small SNDSEQ problem

Post by randi »

Modify your SeqSwingDoor sequence by removing the "Door 5" line and rename it (if desired):

Code: Select all

:SeqSwingDoorOpen
   play DoorCrack
   stopsound DoorStop
end
Now create SeqSwingDoorClose that you want played when the door closes, like this:

Code: Select all

:SeqSwingDoorClose
   play DoorCrackClose
   stopsound DoorStop
end
Then you tie the two together into a single selector sound sequence. This sequence doesn't play any sounds but rather groups together otherwise distinct sequences so that they play for different conditions on the object. Note that the "Door 5" that was in the original SeqSwingDoor is on this one, since this is the sequence that actually gets attached to an object:

Code: Select all

[SeqSwingDoor
   Door 5
   0 SeqSwingDoorOpen
   1 SeqSwingDoorClose
   2 SeqSwingDoorOpen
   3 SeqSwingDoorClose
]
If you need more examples, please refer to the sndseq.txt in zdoom.pk3.
AntiRellik
Posts: 8
Joined: Fri Aug 28, 2009 4:02 pm

Re: Small SNDSEQ problem

Post by AntiRellik »

Whoa that worked like a charm!
Thanks a lot! So that last definition was actually to tie up sound sequences... I should of realized that before. :oops:
Thats a lot guys =D
Double(Super)Shotgun
Posts: 75
Joined: Fri Jul 25, 2014 2:16 pm

Re: Small SNDSEQ problem

Post by Double(Super)Shotgun »

In case anyone's slow like me, the example above goes like this in its entirety into SNDSEQ:

Code: Select all

:SeqSwingDoorOpen
   play DoorCrack
   stopsound DoorStop
end

:SeqSwingDoorClose
   play DoorCrackClose
   stopsound DoorStop
end

[SeqSwingDoor
   Door 5
   0 SeqSwingDoorOpen
   1 SeqSwingDoorClose
   2 SeqSwingDoorOpen
   3 SeqSwingDoorClose
]
So you'd want to include both the individual open and close definitions, AS WELL AS the collection thingy at the end. Also, for some reason using the simple lump name wasn't working for me, but it worked just fine after I gave it an alias in SNDINFO.
User avatar
Hindsight2020
Posts: 261
Joined: Wed Mar 20, 2013 3:29 am
Location: Indiana, USA

Re: Small SNDSEQ problem

Post by Hindsight2020 »

Funny, I was just having an eerily similar issue today. Except my issue seemed to be that I wanted a latch sound to occur as StopSound. It took me a bit to realize that the StopSound wouldn't play if the polyobject completed its motion after the sequence had complete. I had to shorten my polyobject movement or pick a longer door creak. I decided instead to go with this exact setup and create my own collection of sounds. Lol

I still can't figure out, tho, why "play sound1" won't work and I have to use "playuntildone sound1" instead?
Locked

Return to “Editing (Archive)”