[Release]Missile warning
Moderators: winston, another_commander
-
- ---- E L I T E ----
- Posts: 299
- Joined: Mon Apr 27, 2015 9:03 pm
[Release]Missile warning
I should have my first OXP almost ready (tested successfully ):
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.
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.
Last edited by Anonymissimus on Fri Oct 16, 2015 7:33 pm, edited 1 time in total.
warning sound if a missile is inbound: Missile warning
Re: missile warner
It's a convention to prevent possible future clashes with events. No event name will start with _ or $. Core local js functions start with _ and variables with $. I personally find it easier to read other peoples codes when they use the same convention.Anonymissimus wrote: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 ?
Here's one way to do it:Anonymissimus wrote:-It's apparently not possible to pass an argument to the function called by a timer ?
Code: Select all
this.$fooTimer = new Timer(this, function(){this._fooTimer(fooVariable)}, 1)
And congrats for you first OXP .
- Norby
- ---- E L I T E ----
- Posts: 2577
- Joined: Mon May 20, 2013 9:53 pm
- Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
- Contact:
Re: missile warner
It is important.Anonymissimus wrote:What's up with the $ or _ markers in front of what seem to be "private" functions/variables ?
I use global variables likeAnonymissimus wrote:It's apparently not possible to pass an argument to the function called by a timer ?
this.$var
and .bind(this)
as a workaround.
In a worldScript, yes. In a ship script, for a ship where the script is attached in shipdata.plist orAnonymissimus wrote:Is the shipAttackedWithMissile function only called if it's the player ship
ship.[url=http://wiki.alioth.net/index.php/Oolite_JavaScript_Reference:_Ship#setScript]setScript[/url]("some.js")
(and not by ship.[url=http://wiki.alioth.net/index.php/Oolite_JavaScript_Reference:_Ship#script]script[/url]="some.js";
due to this parameter is read-only). You must attach it individually, there is no general attachment and you should not attach a script generally to do not break the ship scripts already attached is many OXPs. You should solve in a worldScript using filters, for example system.[url=http://wiki.alioth.net/index.php/Oolite_JavaScript_Reference:_System#allShips]allShips[/url]
or ship.[url=http://wiki.alioth.net/index.php/Oolite_JavaScript_Reference:_Ship#checkScanner]checkScanner()[/url]
.Soundbible.com and slicing with audacity can help also.
-
- ---- E L I T E ----
- Posts: 299
- Joined: Mon Apr 27, 2015 9:03 pm
Re: missile warner
Unfortunately I can't find something that is in the public domain and sounds sufficiently alarming, but not too annoying, so that one can listen to it so often. The ladder condition is much harder to fulfill as it may seem...Norby wrote:Soundbible.com and slicing with audacity can help also.
A few others are okay to listen to but don't sound much like an alarm sound. More like a ping signal.
warning sound if a missile is inbound: Missile warning
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Re: missile warner
Did you try searching Soundbible for buzzer type noises? Some of them may be suitable.Anonymissimus wrote:Unfortunately I can't find something that is in the public domain and sounds sufficiently alarming, but not too annoying, so that one can listen to it so often.Norby wrote:Soundbible.com and slicing with audacity can help also.
Here's a link that does a 'buzz' search at Soundbible for you:
http://soundbible.com/suggest.php?q=buzz&x=0&y=0
Of the 50+ sounds returned, there are only four items in the entire listing that are restricted in a way that would prevent use in Oolite. (my personal favourite is the Loud Alarm Clock Buzzer, though it would need trimming)
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
-
- ---- E L I T E ----
- Posts: 299
- Joined: Mon Apr 27, 2015 9:03 pm
Re: missile warner
Well, thanks, but...
Anyway, so Sampling Plus 1.0 and Attribution 3.0 are usable ? I like http://soundbible.com/1501-Buzzer.html although it's somewhat too long but an 1.5 s interval probably still suffices. Sounds as if you're one the engine deck of a freighter with a missile inbound.
Seriously ? Imagine you need to hear that all the time in a furball with assassins, maybe with some barracudas (from Aquatics OXP) equipped with pylon reloader, so 12 missiles per ship in total ?my personal favourite is the Loud Alarm Clock Buzzer
Anyway, so Sampling Plus 1.0 and Attribution 3.0 are usable ? I like http://soundbible.com/1501-Buzzer.html although it's somewhat too long but an 1.5 s interval probably still suffices. Sounds as if you're one the engine deck of a freighter with a missile inbound.
warning sound if a missile is inbound: Missile warning
- Wildeblood
- ---- E L I T E ----
- Posts: 2453
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: missile warner
In your heart, you know it's flat.
-
- ---- E L I T E ----
- Posts: 299
- Joined: Mon Apr 27, 2015 9:03 pm
Re: Missile warning
It's now available at github https://github.com/anonymissimus/oolite-MissileWarning
(You must clone it into a folder in the addons directory where the manually installed addons are with a local git client and name the folder such as oolite-MissileWarning.oxp)
I don't see and docs about distribution via the oxz manager.
EDIT
You can also download a zip from github, then no need to bother with git:
https://github.com/anonymissimus/oolite ... master.zip
(You must clone it into a folder in the addons directory where the manually installed addons are with a local git client and name the folder such as oolite-MissileWarning.oxp)
I don't see and docs about distribution via the oxz manager.
EDIT
You can also download a zip from github, then no need to bother with git:
https://github.com/anonymissimus/oolite ... master.zip
warning sound if a missile is inbound: Missile warning
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Re: missile warner
<grins> Well, I would shorten it to just 3 or 4 beeps.. so, about a second at most.Anonymissimus wrote:Well, thanks, but...Seriously ? Imagine you need to hear that all the time in a furball with assassins, maybe with some barracudas (from Aquatics OXP) equipped with pylon reloader, so 12 missiles per ship in total ?my personal favourite is the Loud Alarm Clock Buzzer
Yes.. Sampling Plus 1.0 is an old (and deprecated) Creative Commons licence that allows you to do what you like with it so long as you include attribution (e.g. - in the readme and on the OXP wiki page). Attribution 3.0 is similar, except that you must also provide a link to the licence, and indicate if you made any changes to the original product. See the links for details. (This is why you should always google licences, instead of making assumptions about them. )Anonymissimus wrote:Anyway, so Sampling Plus 1.0 and Attribution 3.0 are usable ?
Actually, the only truly restrictive licence at SoundBible, from a gaming point of view, is the "Personal Use Only" one. After all, the whole point of the website is to make the recordings available for others to use. As it happens, my first preference for the QBD alarm turned out to be a Personal Use Only sound.. which I was quite annoyed about, so I had to settle for the one now in use.
That one sounds good too. Though I bet if you had dozens of missiles flying about, per your example above, you'd probably get tired of hearing it too..Anonymissimus wrote:I like http://soundbible.com/1501-Buzzer.html although it's somewhat too long but an 1.5 s interval probably still suffices. Sounds as if you're one the engine deck of a freighter with a missile inbound.
So.. you're saying you totally missed the stickied thread here in the Expansion Pack section, titled The All-in-One Guide to OXZ Packaging and Distribution?Anonymissimus wrote:I don't see and docs about distribution via the oxz manager.
(It's also linked to at the wiki, on the OXP howto page)
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
-
- ---- E L I T E ----
- Posts: 299
- Joined: Mon Apr 27, 2015 9:03 pm
Re: missile warner
IIRC it was more like...did not find something in the wiki...wrote that post...later on realized that I had that thread in an open tab in my browser, it must have been brought up by a previous search, perhaps google...and then didn't bother to edit the post.Diziet Sma wrote:So.. you're saying you totally missed the stickied thread here in the Expansion Pack section, titled The All-in-One Guide to OXZ Packaging and Distribution?
warning sound if a missile is inbound: Missile warning
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Re: missile warner
Now that we've had some time pass for any necessary corrections/additions to that thread to appear, I guess it's time I added the information to the wiki.Anonymissimus wrote:IIRC it was more like...did not find something in the wiki...
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
- Norby
- ---- E L I T E ----
- Posts: 2577
- Joined: Mon May 20, 2013 9:53 pm
- Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
- Contact:
Re: [Release]Missile warning
Nice work! I can upload the oxz into the manager if you need but better if you ask your logins from cim and maik, especially if you plan regular updates.
A minot thing that the date in changelog should be updated, another is the category in manifest.plist must be filled. If you think this is a big help in gameplay then put into the Mechanics category, if not then Ambience.
A minot thing that the date in changelog should be updated, another is the category in manifest.plist must be filled. If you think this is a big help in gameplay then put into the Mechanics category, if not then Ambience.
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Re: [Release]Missile warning
Hmm.. as an (albeit minor) equipment upgrade, it belongs in Equipment, surely?Norby wrote:another is the category in manifest.plist must be filled. If you think this is a big help in gameplay then put into the Mechanics category, if not then Ambience.
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
- Amah
- ---- E L I T E ----
- Posts: 486
- Joined: Tue Aug 28, 2012 8:05 pm
- Location: aboard the Laenina Crowne - Yasen-N class space freighter
- Contact:
Re: [Release]Missile warning
Just saved my behind in a property related disagreement with some spacewaymen. Cool project!
Amah
- about Amah: wiki
- noshaders versions of Griff's extra, alternate ships and accessories: discussion, wiki
- ocpc - customize the player ship: discussion, oxp repository
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Re: [Release]Missile warning
Therein lies a tale, by the sounds of things.. please tell us more.Amah wrote:Just saved my behind in a property related disagreement with some spacewaymen.
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied