[Release]Missile warning

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Anonymissimus
---- E L I T E ----
---- E L I T E ----
Posts: 299
Joined: Mon Apr 27, 2015 9:03 pm

[Release]Missile warning

Post by Anonymissimus »

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.
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
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2691
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: missile warner

Post by spara »

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 ?
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:
-It's apparently not possible to pass an argument to the function called by a timer ?
Here's one way to do it:

Code: Select all

this.$fooTimer = new Timer(this, function(){this._fooTimer(fooVariable)}, 1)
Hopefully someone else will be able to answer your other questions.

And congrats for you first OXP :D .
User avatar
Norby
---- E L I T E ----
---- 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

Post by Norby »

Anonymissimus wrote:
What's up with the $ or _ markers in front of what seem to be "private" functions/variables ?
It is important.
Anonymissimus wrote:
It's apparently not possible to pass an argument to the function called by a timer ?
I use global variables like this.$var and .bind(this) as a workaround.
Anonymissimus wrote:
Is the shipAttackedWithMissile function only called if it's the player ship
In a worldScript, yes. In a ship script, for a ship where the script is attached in shipdata.plist or 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.
Anonymissimus
---- E L I T E ----
---- E L I T E ----
Posts: 299
Joined: Mon Apr 27, 2015 9:03 pm

Re: missile warner

Post by Anonymissimus »

Norby wrote:
Soundbible.com and slicing with audacity can help also.
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...
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
User avatar
Diziet Sma
---- E L I T E ----
---- 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

Post by Diziet Sma »

Anonymissimus wrote:
Norby wrote:
Soundbible.com and slicing with audacity can help also.
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.
Did you try searching Soundbible for buzzer type noises? Some of them may be suitable.

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
Anonymissimus
---- E L I T E ----
---- E L I T E ----
Posts: 299
Joined: Mon Apr 27, 2015 9:03 pm

Re: missile warner

Post by Anonymissimus »

Well, thanks, but...
my personal favourite is the Loud Alarm Clock Buzzer
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 ?
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
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2466
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: missile warner

Post by Wildeblood »

In your heart, you know it's flat.
Anonymissimus
---- E L I T E ----
---- E L I T E ----
Posts: 299
Joined: Mon Apr 27, 2015 9:03 pm

Re: Missile warning

Post by Anonymissimus »

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
warning sound if a missile is inbound: Missile warning
User avatar
Diziet Sma
---- E L I T E ----
---- 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

Post by Diziet Sma »

Anonymissimus wrote:
Well, thanks, but...
my personal favourite is the Loud Alarm Clock Buzzer
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 ?
<grins> Well, I would shorten it to just 3 or 4 beeps.. so, about a second at most.
Anonymissimus wrote:
Anyway, so Sampling Plus 1.0 and Attribution 3.0 are usable ?
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. :wink:)

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.
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. :)
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.. :mrgreen: :wink:
Anonymissimus wrote:
I don't see and docs about distribution via the oxz manager.
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? :shock:

(It's also linked to at the wiki, on the [EliteWiki] 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
Anonymissimus
---- E L I T E ----
---- E L I T E ----
Posts: 299
Joined: Mon Apr 27, 2015 9:03 pm

Re: missile warner

Post by Anonymissimus »

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? :shock:
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.
warning sound if a missile is inbound: Missile warning
User avatar
Diziet Sma
---- E L I T E ----
---- 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

Post by Diziet Sma »

Anonymissimus wrote:
IIRC it was more like...did not find something in the wiki...
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.
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
User avatar
Norby
---- E L I T E ----
---- 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

Post by Norby »

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.
User avatar
Diziet Sma
---- E L I T E ----
---- 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

Post by Diziet Sma »

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.
Hmm.. as an (albeit minor) equipment upgrade, it belongs in Equipment, surely?
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
User avatar
Amah
---- E L I T E ----
---- 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

Post by Amah »

Just saved my behind in a property related disagreement with some spacewaymen. Cool project!
Amah
User avatar
Diziet Sma
---- E L I T E ----
---- 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

Post by Diziet Sma »

Amah wrote:
Just saved my behind in a property related disagreement with some spacewaymen.
Therein lies a tale, by the sounds of things.. please tell us more.
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
Post Reply