Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: torc on September 19, 2011, 05:23:47 pm
-
as i write,i need a way to assign a sound to the radar. maybe a sound that works only when the hud is on. obviously i need it for the diaspora DRADIS. thanks in advance for the help :)
-
Does it need to do anything special or just be on? If nothing special, you could easily do that in FRED with no changes and a single argument.
-
That however eats away at event counts, having an option per ship to set a sound and a MS delay for sweeps could be useful for a lot of projects (and tie into making ambient cockpit noises too)
-
Wut..
-true
-play-sound-from-file
--soundfile.ext
--loop count
One event... of course it will limit your ability to use that sound channel again...
-
thanks for the help, anyway having a dedicated sound is better,because the event sound is tie to the music channel, not the effects.
-
Wut..
And double wut? :confused: Event counts have been unlimited for years.
-
I understood that via SEXP you can add sounds,but here's another issue: a sound create for loop in Events don't work very well, because he interrupt and restart, instead,via table,the sound loop is played correctly.
-
Use play-sound-from-table then.
I don't know how such sound be more than an annoyance in "normal" FS, but I can think of a script/FRED based system in which you could turn off your radar to increase stealth. I'm planning to have it in Aces High.
-
If you put it in the mod, please put it in it's own file or build in some other way for people to turn it off. I know that hearing the dradis sound all the time would drive me crazy, not to mention that the sound being there isn't making much sense in the first place.
Submarine make pings because they use sound to locate and measure the enemy (or at least they used to). Since there is nothing in space to carry sound, they must use some other method, like radiation or light, neither or which makes any humming sound by itself.
-
I think he's talking about the DRADIS sound you hear in nearly every in-cockpit shot of the BSG TV series.
-
Yes I know. And that is also what I was talking about, only I didn't use capital letters when writing DRADIS.
-
You said "not to mention that the sound being there isn't making much sense in the first place." Yes, it does. It's an audio signal to tell the person flying the ship that DRADIS is active and tracking. It doesn't appear outside the ship.
-
I understood that via SEXP you can add sounds,but here's another issue: a sound create for loop in Events don't work very well, because he interrupt and restart, instead,via table,the sound loop is played correctly.
Sexp loops work. I use them.. often.
-
You said "not to mention that the sound being there isn't making much sense in the first place." Yes, it does. It's an audio signal to tell the person flying the ship that DRADIS is active and tracking. It doesn't appear outside the ship.
Still, it would make sense only if system I mentioned was implemented, since otherwise, DRADIS would always be "active and tracking".
-
the DRADIS sound will work very subtle and it will not be annoying.
anyway , if this is in BSG, it will be in Diaspora :)
-
Make sure to turn off the sound when the player turns off his targeting. :nervous:
-
Or his targeting computer gets taken out (weapons / sensor subsystem)
-
Which brings us round to reasons why this is something better handled in code than by SEXP. Anyway Swifty has said elsewhere he'll handle this for Diaspora so I think that basically brings the discussion basically to a close, right?
-
I guess that as long as it doesn't distract him from more important stuff (like performance improvements) for too long, it'd be nice to see that.
-
if noone wanna take care about it, then let's wait swifty code :) . anyway,thanks a lot for the help and the attention you gave me.
-
I guess that as long as it doesn't distract him from more important stuff (like performance improvements) for too long, it'd be nice to see that.
That's it. Dragon, I recommend you stop commenting on SCP topics in this way. Coders will work on what they consider to be a priority to them, not whatever you think they should work on.
-
I think he meant to speak in a larger scope of things, like what would (probably) be best for the community (in his opinion, if the coder / member in question wanted to listen to it)... but yeah, it does come off like he is telling people where they should put their efforts.
-
I think he meant to speak in a larger scope of things, like what would (probably) be best for the community (in his opinion, if the coder / member in question wanted to listen to it)...
That's what I meant, maybe I should have said it differently. Last time I heard, he was working on optimizing collision detection system, which is a very big deal regarding performance and something that a lot of people (especially those with weaker machines) would like to see.
-
I'm sorry, just like I don't buy Mobius' "language issues" as an excuse, I am unwilling to accept this one. You have been conversing here long enough to be fully aware of how to phrase such things, or, in this case, to not say anything in the first place.
-
I really don't think offense is warranted here. The E seems to be reading that sentence as "I think it would be more worthwhile if Swifty spent his time on X", whereas I read it as "I would like to see Swifty work on this, but I don't want my humble request to take priority over more important things [such as X] he may be working on".
-
I have a patch that adds the requested feature to the DRADIS HUD gauge and another feature which adds customizable sounds ("beeps") for the case that an object arrives or departs as torc requested (patch is attached).
Added options:
These go into the "Radar BSG" section after the last entry ("Cockpit Target") and have to appear in the specified sequence:
- Loop Sound: Integer or string identifying the looping sound to be played. This sound will not be played when the view is not in the cockpit or when the HUD is disabled
- Arrival Beep Sound: Same syntax as Loop Sound; specifies the sound that should be played when a ship arrives
- Minimum Beep Delay: float specifying the minimum delay in seconds between two sounds (default 0.25s) for the arrival beeps
- Departure Beep Sound: Same syntax as Loop Sound; specifies the sound that should be played when a ship departs
- Minimum Beep Delay: float specifying the minimum delay in seconds between two sounds (default 0.25s) for the departure beeps
Please take a look at it dear codes ;)
[attachment deleted by ninja]
-
Is there a specific reason why you created a new base virtual function for the HudGauge class? It seems like you could just put those sound calls for the Dradis gauge into the Dradis gauge's preprocess() method instead of the onFrame() method.
In fact, if the sounds are only supposed to be played when the gauge is rendering, you might as well throw them into the render() function since that depends on the canRender() condtional so at least the sound playback is dependant on Viewer_mode instead of having to check redundantly in doBeeps() and doLoopSound().
Are the sound entries optional btw? I haven't ever used parse_sound so I'm just wondering.
-
That method only gets called when cockpit_display_num is less than zero, see
if ( cockpit_display_num < 0 ) {
sip->hud_gauges[j]->preprocess();
}
and I didn't want to change that as I don't know for which reason that method doesn't get called when there is no cockpit target.
-
It really might be better to put those sound calls in the render() method. Are there any objections to that?
-
The only problem might be that there might be cases where render() doesn't get called for example when setupRenderCanvas() or canRender() fails although an update for the HUD gauge is needed. Thats why I created that method as it's more generic and can also be used for other gauges.
-
Well, if the gauge doesn't get rendered, the sound shouldn't be played, no? Is there a reason the sound needs to be played if the gauge isn't rendered?
-
Player looking to the side, for instance?
-
Player looking to the side, for instance?
The HUD doesn't get switched off for that.
-
Not entirely, but certain gauges are not rendered in that mode.
-
Not entirely, but certain gauges are not rendered in that mode.
From looking at the code, none of them get shut off.
-
Then it shouldn't be a problem (though it means they are somehow rendered, but I can't see them. Perhaps they could be seen if I had more monitors).
-
I think that for this specific case the location in the render() method is just fine, I used that new method because I thought that a method that gets called once per frame would be good if a HUD gauge needs to update some information regardless if it is rendered or not but if you think that this is not neccessary then I have no objections against the render() method :nod:.
-
Yeah for sure, that's definitely something that needs to be addressed. I think I need to think about it for a while and try to figure out what roles all these virtual functions have in relation with each other.
In the meantime, provide an implementation using the render method and I think we're good to go.
-
BTW, are you going to add these beeps to other radar types?
Arrival and departure beeps sound really interesting.
-
i suppose since they are in the code,you can use them for whatever you want
-
No currently they are limited to the DRADIS gauge but the code does not depend on that so you can just copy the added code to the normal radar gauge and you should be ready to go.
Anyway, patch with new code in render() method is attached.
[attachment deleted by ninja]
-
I'd like to see that implemented on other radar types, I'm sure it'd be useful (especially that it sounds like it'd not be difficult to do).
-
i have tested it...and i can assure you that the bleep sound helps a lot to understand if some wing jump in the area
My ideas are great :D
-
We also may at some point want to make it optional to play the arrival / departure sound. I'm sure several FREDders can tell you of times they've made something arrive/depart when they definitely DIDN'T want that announced to the player.
-
Could be done through a ship flag which could also hide that ship from the arrival/departure log like ship-vanish already does.
EDIT: And now I know why I needed that new method. I have to stop the sound when the player watches from outside which can't be done in the render method().
-
We also may at some point want to make it optional to play the arrival / departure sound. I'm sure several FREDders can tell you of times they've made something arrive/depart when they definitely DIDN'T want that announced to the player.
Indeed. I'd also like a flag to trigger the beep from SEXP, so uncloaking/hacked warpins/ships coming into range could be handled. Actually, I think that it could be nice if a new radar contact caused a beep, be it warpin, unstealthing or old target coming into radar range, (set by the player or by SEXP).