
In the core game, a sound is played only at the launch of a missile at you, but not later on when the missile is still there. This is a problem, the missile may not get destroyed by auto ECM, or I may want to shoot something else previously. I tend to forget about the still incoming missile while doing that. Then there are the extremely dangerous Kamikaze orbiters from TCAT OXP which seem to not even emit the usual "woop woop" missile launch sound and I sure want a warning for those. Furthermore, that same "woop woop" sound is also used when ships start to attack you, which happens that frequently I tend ignore the sound. In combat situations with more than 2 parties, hostile NPCs tend to toggle between the player and something else as their target causing woop woop all the time.
So, my OXP shall play a unique sound repeatedly for as long as there is at least one missile in the player's scanner range which is targeting the player ship, so the player is reminded he should use key_target_missile and deal with it.
I've created a poor alert like sound with audacity that suits for now - maybe someone can point me to something with a compatible license I could use ? It should be less alerting than the Q-bomb detector sound as a missile is a lesser threat and they should not be confused in combat. The sound from asteroid storm is the same as from thargoid wars and I don't want to use it. Any others available ?
I've got a few questions:
-What's up with the $ or _ markers in front of what seem to be "private" functions/variables ? Is that just a so-so notation standard ?
-It's apparently not possible to pass an argument to the function called by a timer ?
-Is the shipAttackedWithMissile function only called if it's the player ship or if any ship is attacked by a missile ?
(That is another use of my OXP - if there are missiles in the scanner range but sound doesn't play, no need to check with key_target_missile whether they are targeting the player).
EDIT
The sound also needs to be very short (max 1 second) as the checking interval for whether there's currently a missile inbound should not be longer.