View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003263 | The Dark Mod | Coding | public | 26.11.2012 18:07 | 16.03.2013 02:34 |
Reporter | tels | Assigned To | grayman | ||
Priority | normal | Severity | normal | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | TDM 1.08 | ||||
Target Version | TDM 2.00 | Fixed in Version | TDM 2.00 | ||
Summary | 0003263: snd_opened does not work on sliding doors | ||||
Description | There is some code that supports snd_opened: void idMover_Binary::Event_Reached_BinaryMover( void ) { if ( moverState == MOVER_1TO2 ) { // reached pos2 idThread::ObjectMoveDone( move_thread, this ); move_thread = 0; if ( moveMaster == this ) { StartSound( "snd_opened", SND_CHANNEL_ANY, 0, false, NULL ); } However, if you put such a spawnarg on a atdm:mover_door_sliding, no sound is played. A script which plays the same sound manually after the mover changed its state to open works, so the sound file and spawnarg are correct, but somehow the above code is not triggered, breaking "snd_opened" on binary movers. | ||||
Tags | No tags attached. | ||||
Isn't there a different spawnarg that works for sliding doors? | |
No, there is none mentioned in the def files nor in the code. Plus, it makes sense to use the same spawnarg for all movers (when they reach their "open" state) instead of having different spawnarg that nobody can remember then. This are all that are mentioned in the code: $ ack snd_open game/BinaryFrobMover.cpp 1042: FrobMoverStartSound("snd_open"); game/Mover.cpp 2049: StartSound( "snd_open", SND_CHANNEL_ANY, 0, false, NULL ); 2255: StartSound( "snd_opened", SND_CHANNEL_ANY, 0, false, NULL ); |
|
The wiki says: "The above sounds are triggered as the door begins to open (eg, unlatch sound) and when it finally closed (eg, slam.) For special doors that need an on-going sound, eg, a big stone slab that moves slowly, then use: 'snd_move' " I'm pretty sure I've seen that used in ToSL. |
|
Yes, but I'm talking about a snd the plays when the mover has reached the final opening position. snd_move plays when it _starts_ opening/closing, snd_close when it finished closing. What is missing here is the sound when it _finishes opening_. snd_move and snd_close have nothing to do with snd_opened! Edit: To make this even more clear. The sound that is played when the movin starts has a fixed length - but there is no clear indication on how long the door actuall will open (and thus no indication when the opened state is reached). This means that is is not possible to create a sound of a specific length to cover the opening sequence, because every door can have a different speed (its a spawnarg). So splitting the sound up in "snd_open" (the door starts to open), "snd_move" (the door still moves) and "snd_closed" or "snd_opened" (the door finished moving) makes sense, because otherwise on or the other direction will miss the "slam". To further clarify this, normal doors don't need a "snd_opened", as they just stand in air when fully open. But sliding doors can hit an obstacle at the end of their movement (think portcullis hitting ceiling, sliding secret door hitting some end-stop element) and that is what "snd_opened" is for - to play the sound that happens exactly at this moment. Hope this finally clears it up. |
|
Ah, so there are actually 4 different spawnargs for door sounds? 1. snd_open -- the sound played immediately upon starting to open 2. snd_move -- the sound looped while the door is moving (for sliding doors only?) 3. snd_opened -- the sound played when the door stops opening 4. snd_closed -- the sound played when the door stops closing |
|
It should be actually five, er six: (Edit: updated this note) 1. snd_open -- the sound played immediately upon starting to open 2. snd_closing -- (name not fix) the sound played immediately upon starting to close 3. snd_move -- the sound looped while the door is moving (for sliding doors only? and elevators, not sure) 4. snd_opened -- the sound played when the door stops opening 5. snd_close -- the sound played when the door stops closing 6. snd_stopped -- (name not fix) played when the mover encounters an obstacle and collides with it and stops * 1 works * 2 is not implemented yet * 3 is not documened good enough, but seems to work (used for elevators f.i.). * 4 seems to not work on binaryfrobmovers (but is documented and there is code for it on the general mover class). * 5 works (although is ill-named, it should be snd_closed). * 6 is not implemented yet and tracked under 0003215 |
|
In testing whether a sliding door emits sounds, is it possible that the door's origin sliding into a worldspawn brush prevents the sound from being heard? | |
Attaching a script object to the door and making it emit "snd_opened" when the door is full open via the same channel plays the sound loud and clear. Me thinks for snd_opened its a C++ inheritance issue, the routine simply never emits the sound in that code path on the "open position reached" case. |
|
The Door class CFrobMover is a child of the CBinaryFrobMover class. This class has two methods for when a door reaches its fully open and fully closed positions: CBinaryFrobMover::OnOpenPositionReached() CBinaryFrobMover::OnClosedPositionReached() Despite the comments in Mover.cpp, doors are not in the idMover_Binary class. So none of the idMover_Binary methods (i.e. the one Tels cited above) will be used with doors. CBinaryFrobMover::OnClosedPositionReached() says this: // play the closing sound when the door closes completely FrobMoverStartSound("snd_close"); so I added this to CBinaryFrobMover::OnOpenPositionReached(): // play the opened sound when the door opens completely FrobMoverStartSound("snd_opened"); And now doors will play snd_opened when defined and they reach their fully open positions. I tested this with both sliding and rotating doors and it works. Is that sufficient to solve the problem and resolve this issue? |
|
Play snd_opened when binary frob movers hit their open position. rev. 5706: BinaryFromMover.cpp |
|
Is snd_move supposed to be working on regular doors now, or does it still only work for sliding doors? I'd like to have a long, drawn out creak that plays while a door is opened, but using snd_move doesn't appear to do anything. | |
Yes. I just tested a rotating atdm:mover_door with a looping snd_move, then tested it again with a non-looping snd_move. Both worked fine. |
|
Date Modified | Username | Field | Change |
---|---|---|---|
26.11.2012 18:07 | tels | New Issue | |
27.11.2012 02:21 | Springheel | Note Added: 0004949 | |
28.11.2012 18:10 | tels | Note Added: 0004950 | |
29.11.2012 00:47 | Springheel | Note Added: 0004952 | |
29.11.2012 00:47 | Springheel | Note Edited: 0004952 | |
30.11.2012 16:53 | tels | Note Added: 0004953 | |
30.11.2012 16:57 | tels | Note Edited: 0004953 | |
30.11.2012 21:57 | Springheel | Note Added: 0004954 | |
01.12.2012 09:43 | tels | Note Added: 0004955 | |
01.12.2012 09:45 | tels | Note Edited: 0004955 | |
01.12.2012 09:47 | tels | Note Edited: 0004955 | |
01.12.2012 09:47 | tels | Note Edited: 0004955 | |
01.12.2012 09:49 | tels | Note Edited: 0004955 | |
05.12.2012 13:13 | grayman | Note Added: 0004958 | |
06.12.2012 22:21 | tels | Note Added: 0004959 | |
27.02.2013 01:58 | grayman | Note Added: 0005117 | |
27.02.2013 01:58 | grayman | Assigned To | => grayman |
27.02.2013 01:58 | grayman | Status | new => assigned |
08.03.2013 15:53 | grayman | Note Added: 0005125 | |
08.03.2013 15:53 | grayman | Status | assigned => resolved |
08.03.2013 15:53 | grayman | Resolution | open => fixed |
08.03.2013 15:53 | grayman | Fixed in Version | => TDM 2.00 |
08.03.2013 15:53 | grayman | Target Version | => TDM 2.00 |
15.03.2013 20:04 | Springheel | Note Added: 0005191 | |
16.03.2013 02:34 | grayman | Note Added: 0005193 |