Oolite Bulletins

For information and discussion about Oolite.
It is currently Tue Jun 27, 2017 2:06 pm

All times are UTC




Post new topic  Reply to topic  [ 19 posts ]  Go to page 1 2 Next
Author Message
 Post subject: [Release]Missile warning
PostPosted: Wed Oct 14, 2015 7:30 pm 
Offline
---- E L I T E ----
---- E L I T E ----

Joined: Mon Apr 27, 2015 9:03 pm
Posts: 276
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.

_________________
warning sound if a missile is inbound: Missile warning


Last edited by Anonymissimus on Fri Oct 16, 2015 7:33 pm, edited 1 time in total.

Top
   
 Post subject: Re: missile warner
PostPosted: Wed Oct 14, 2015 8:29 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Aug 15, 2012 4:19 am
Posts: 2401
Location: Finland
Quote:
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.
Quote:
-It's apparently not possible to pass an argument to the function called by a timer ?
Here's one way to do it:
Code:
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 .


Top
   
 Post subject: Re: missile warner
PostPosted: Wed Oct 14, 2015 8:35 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Mon May 20, 2013 9:53 pm
Posts: 2276
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Quote:
What's up with the $ or _ markers in front of what seem to be "private" functions/variables ?
It is important.
Quote:
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.
Quote:
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.

_________________
OXPs by Norby


Top
   
 Post subject: Re: missile warner
PostPosted: Thu Oct 15, 2015 5:47 pm 
Offline
---- E L I T E ----
---- E L I T E ----

Joined: Mon Apr 27, 2015 9:03 pm
Posts: 276
Quote:
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


Top
   
 Post subject: Re: missile warner
PostPosted: Fri Oct 16, 2015 4:43 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Mon Apr 06, 2009 12:20 pm
Posts: 6177
Location: Aboard the Pitviper S.E. "Blackwidow"
Quote:
Quote:
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


Top
   
 Post subject: Re: missile warner
PostPosted: Fri Oct 16, 2015 2:21 pm 
Offline
---- E L I T E ----
---- E L I T E ----

Joined: Mon Apr 27, 2015 9:03 pm
Posts: 276
Well, thanks, but...
Quote:
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


Top
   
 Post subject: Re: missile warner
PostPosted: Fri Oct 16, 2015 3:50 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sat Jun 11, 2011 6:07 am
Posts: 2161
Location: Western Australia
Try this one:

http://soundbible.com/2082-Hammering.html


Top
   
 Post subject: Re: Missile warning
PostPosted: Fri Oct 16, 2015 7:33 pm 
Offline
---- E L I T E ----
---- E L I T E ----

Joined: Mon Apr 27, 2015 9:03 pm
Posts: 276
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


Top
   
 Post subject: Re: missile warner
PostPosted: Sat Oct 17, 2015 1:14 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Mon Apr 06, 2009 12:20 pm
Posts: 6177
Location: Aboard the Pitviper S.E. "Blackwidow"
Quote:
Well, thanks, but...
Quote:
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.
Quote:
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.
Quote:
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:
Quote:
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


Top
   
 Post subject: Re: missile warner
PostPosted: Sat Oct 17, 2015 3:09 am 
Offline
---- E L I T E ----
---- E L I T E ----

Joined: Mon Apr 27, 2015 9:03 pm
Posts: 276
Quote:
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


Top
   
 Post subject: Re: missile warner
PostPosted: Sat Oct 17, 2015 7:02 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Mon Apr 06, 2009 12:20 pm
Posts: 6177
Location: Aboard the Pitviper S.E. "Blackwidow"
Quote:
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


Top
   
PostPosted: Sat Oct 17, 2015 9:47 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Mon May 20, 2013 9:53 pm
Posts: 2276
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
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.

_________________
OXPs by Norby


Top
   
PostPosted: Sat Oct 17, 2015 12:57 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Mon Apr 06, 2009 12:20 pm
Posts: 6177
Location: Aboard the Pitviper S.E. "Blackwidow"
Quote:
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


Top
   
PostPosted: Sat Oct 17, 2015 1:12 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Tue Aug 28, 2012 8:05 pm
Posts: 485
Location: aboard the Laenina Crowne - Yasen-N class space freighter
Just saved my behind in a property related disagreement with some spacewaymen. Cool project!

_________________
Amah


Top
   
PostPosted: Sat Oct 17, 2015 1:23 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Mon Apr 06, 2009 12:20 pm
Posts: 6177
Location: Aboard the Pitviper S.E. "Blackwidow"
Quote:
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


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 19 posts ]  Go to page 1 2 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
Powered by phpBB® Forum Software © phpBB Limited