You should still hear the firing mechanism reverberating through the hull of the ship though, should you?Commander McLane wrote:... and therefore doesn't fit the Space Is Noisy-trope.pagroove wrote:I like the railgun! Good work and very original. It only need one thing more and that is: sound.
Its a bit silent.
But seriously, I'd love to have a sound effect, perhaps two sound effects: one for firing, and one for hitting. You're the man for sounds, would you like to provide some?
(And while you're at it, I'd also love to have a sound effect for the fireworks from fireworks.oxp.)
Railgun.oxp v 1.3 now available
Moderators: winston, another_commander
- DaddyHoggy
- Intergalactic Spam Assassin
- Posts: 8515
- Joined: Tue Dec 05, 2006 9:43 pm
- Location: Newbury, UK
- Contact:
Re: Railgun.oxp v 1.2 now available
Oolite Life is now revealed hereSelezen wrote:Apparently I was having a DaddyHoggy moment.
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Railgun.oxp v 1.2 now available
As I have never worked with sound effects or music before, how would I script the use of a sound effect let's say in railgun-firing.js? Is it enough to insert
somewhere? If I type this into the console, nothing happens.
Code: Select all
Sound.playMusic("laser.ogg");
Re: Railgun.oxp v 1.2 now available
As it is a sound that is used inflight and not only one or two times...
Put the sound in customsounds.plist, e.g.and in the scriptor
Put the sound in customsounds.plist, e.g.
Code: Select all
"[railgun_fire]" = "railgun_fire.ogg";
Code: Select all
this.bang = new SoundSource;
this.bang.sound = "[railgun_fire]";
this.bang.play();
Code: Select all
var bang = new SoundSource;
bang.sound = "[railgun_fire]";
bang.play();
- Cody
- Sharp Shooter Spam Assassin
- Posts: 16081
- Joined: Sat Jul 04, 2009 9:31 pm
- Location: The Lizard's Claw
- Contact:
Re: Railgun.oxp v 1.2 now available
A nice sound effect for the railgun would be very cool.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
And any survivors, their debts I will certainly pay. There's always a way!
- Smivs
- Retired Assassin
- Posts: 8408
- Joined: Tue Feb 09, 2010 11:31 am
- Location: Lost in space
- Contact:
Re: Railgun.oxp v 1.2 now available
Phut!
Commander Smivs, the friendliest Gourd this side of Riedquat.
- Disembodied
- Jedi Spam Assassin
- Posts: 6885
- Joined: Thu Jul 12, 2007 10:54 pm
- Location: Carter's Snort
Re: Railgun.oxp v 1.2 now available
There are some Creative Commons sound-effect libraries out there ... something like this might be good:
http://www.freesound.org/samplesViewSingle.php?id=39023
http://www.freesound.org/samplesViewSingle.php?id=39023
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Railgun.oxp v 1.2 now available
Now if you would be so kind and send it to me as an OGG.Smivs wrote:Phut!
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Railgun.oxp v 1.2 now available
@ Svengali: thanks!
(And as it turns out, I should've consulted the SoundSource documentation, not the Sound documentation. D'oh! )
(And as it turns out, I should've consulted the SoundSource documentation, not the Sound documentation. D'oh! )
- Smivs
- Retired Assassin
- Posts: 8408
- Joined: Tue Feb 09, 2010 11:31 am
- Location: Lost in space
- Contact:
Re: Railgun.oxp v 1.2 now available
My pleasure. Here you areCommander McLane wrote:Now if you would be so kind and send it to me as an OGG.Smivs wrote:Phut!
Commander Smivs, the friendliest Gourd this side of Riedquat.
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Railgun.oxp v 1.2 now available
Nothing personal, but I'm not quite convinced yet.Smivs wrote:My pleasure. Here you areCommander McLane wrote:Now if you would be so kind and send it to me as an OGG.Smivs wrote:Phut!
But seriously: I am imagining something not completely unlike the missile launching sound, but shorter, and more 'electric'.
- Smivs
- Retired Assassin
- Posts: 8408
- Joined: Tue Feb 09, 2010 11:31 am
- Location: Lost in space
- Contact:
Re: Railgun.oxp v 1.2 now available
Hehe, only kidding.
On a serious note (excuse the pun) this might be more suitable.
If it's any help to anyone, I found these here, available as .wav or mp3 files, and used the free online mp3 to ogg converter here.
On a serious note (excuse the pun) this might be more suitable.
If it's any help to anyone, I found these here, available as .wav or mp3 files, and used the free online mp3 to ogg converter here.
Commander Smivs, the friendliest Gourd this side of Riedquat.
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Railgun.oxp v 1.2 now available
Oh, shiny! Nice sound effects. I'll dig through those.
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Railgun.oxp v 1.2 now available
Another question: is it safe and sound to put this into theSvengali wrote:As it is a sound that is used inflight and not only one or two times...
Put the sound in customsounds.plist, e.g.and in the scriptCode: Select all
"[railgun_fire]" = "railgun_fire.ogg";
orCode: Select all
this.bang = new SoundSource; this.bang.sound = "[railgun_fire]"; this.bang.play();
Code: Select all
var bang = new SoundSource; bang.sound = "[railgun_fire]"; bang.play();
activated
handler?I have done this with the second version, and at least I don't get errors about a re-defined var bang. I am not sure about the nature of the activated handler. Does it create a new instance of the script each time (so it seems with the lack of an error message), or could I declare the soundSource somewhere else and only once, and then only use the
play()
in the activated
handler?- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Re: Railgun.oxp v 1.2 now available
A variable declared with
The sound source itself continues to exist until it is garbage collected, which can’t happen while it’s playing (i.e., the game code protects it; this is different from timers, which can randomly stop if you don’t keep a reference to them). In fact, sound sources will keep going even after the game resets (Bug #18108).
In general, it’s better style to set up one sound source, or a small pool, and reuse it. However, the behaviour of equipment scripts is somewhat weird and I don’t actually know if the script is reused or you’re getting a new instance each time (Kaks implemented this stuff).
var
inside a function exists for the duration of that activation of the function. It ceases to exist when the function returns.The sound source itself continues to exist until it is garbage collected, which can’t happen while it’s playing (i.e., the game code protects it; this is different from timers, which can randomly stop if you don’t keep a reference to them). In fact, sound sources will keep going even after the game resets (Bug #18108).
In general, it’s better style to set up one sound source, or a small pool, and reuse it. However, the behaviour of equipment scripts is somewhat weird and I don’t actually know if the script is reused or you’re getting a new instance each time (Kaks implemented this stuff).
E-mail: [email protected]
Re: Railgun.oxp v 1.2 now available
In the eq script for Cabal_Common_Comms I'm using
Code: Select all
this.activated = function()
{
if(!this.beep){
this.beep = new SoundSource;
this.beep.sound = "[cabal_common_commbeep]";
}
// Other stuff
this.beep.play();
}
Yep. Gave me some headaches for BGS when the player loads or reloads a savedgame, because BGS uses looped sounds.Ahruman wrote:In fact, sound sources will keep going even after the game resets (Bug #18108).