Re: 2019-02-20 snapshot
Posted: Fri Feb 22, 2019 1:23 am
so does this mean in supercross we could have a gate drop sound?
Yes. It's headerless 16 bit signed PCM samples.aeffertz wrote:Assuming they have to be .sw audio files?
I'd use it for sounds specific to the track. Things like gate drops, crowd noise, fireworks or whatever else is making noise around the track. While you could use it to add something like chain noise, it wouldn't be the right place to do it since it would only apply to the one track and might end up conflicting with any chain sounds that were eventually added to the game itself.808 wrote:Does this mean birds and wind or does this mean chain slapping and impact noises. Or both?
In the name Science no!checkerz wrote:So we can get Turley's "What's up my duuuuudddeeeesssss" when someone passes for the lead?
IMPAOTeamHavocRacing wrote:In the name Science no!checkerz wrote:So we can get Turley's "What's up my duuuuudddeeeesssss" when someone passes for the lead?
did you have to use the most annoying thing ever as a testjlv wrote:Wouldn't be ideal for that. You could check for sudden accelerations and play a sound but there's no way to check for legs off currently.Smidly wrote:Does this mean you can make the "oof" sound effect for when you go legs off?
Code: Select all
var g_sproing = mx.add_sound("@jstest/sproing.sw")
mx.set_sound_freq(g_sproing, 22050);
mx.set_sound_vol(g_sproing, 1.0);
mx.set_sound_pos(g_sproing, x, y, z);
Use the new camera location function to lock the sound to the cameraAtlasZoor wrote:So I just took a quick look at the js file and scrolled to the sound section, I some questions. When adding in sounds how would you add ambient sound? Because if I were to set the sound position to any coordinate wouldn't it play in your speakers/headphones based on the direction you are facing instead of just being constant in both sides? Also does a sound need to be linked to an object?
In the sound_pos is there any way to have the position constant and not directional?Code: Select all
var g_sproing = mx.add_sound("@jstest/sproing.sw") mx.set_sound_freq(g_sproing, 22050); mx.set_sound_vol(g_sproing, 1.0); mx.set_sound_pos(g_sproing, x, y, z);
(my b if this made no sense)
ah ok. any Idea what I would put in the (position, rotmatrix) part? Also, how would I sign the sound to the camera position.DJ99X wrote:Use the new camera location function to lock the sound to the camera
Like this:AtlasZoor wrote:ah ok. any Idea what I would put in the (position, rotmatrix) part? Also, how would I sign the sound to the camera position.DJ99X wrote:Use the new camera location function to lock the sound to the camera
Fairly new to js so sorry...
Im still kinda lost but this is what I have.jlv wrote: Like this:
var p = [], r = [];
mx.get_camera_location(p, r);
// now 'p' has 3 elements with the camera x, y and z coords and 'r' has a 9 element rotation matrix.
So would this be correct to place the sound on the camera?jlv wrote:You mean to place the sound on the camera? Do it like this:
var p = [], r = [];
mx.get_camera_location(p, r);
mx.set_sound_pos(g_ambient, p[0], p[1], p[2]);
That would not work. The first problem is you are not calling mx.start_sound(g_ambient) any where in the script so the sound will never play. Second you have some invalid JavaScript here. You are opening a block on the first line after you declare your variables which should not be there. Something like this would make a sound loop and follow the camera. Not sure if this is the best way but it worked for me.AtlasZoor wrote:So would this be correct to place the sound on the camera?jlv wrote:You mean to place the sound on the camera? Do it like this:
var p = [], r = [];
mx.get_camera_location(p, r);
mx.set_sound_pos(g_ambient, p[0], p[1], p[2]);
var p = [], r = []; {
g_ambient = mx.add_sound("@blank/sounds/ambient.sw")
mx.get_camera_location(p, r);
mx.set_sound_pos(g_ambient, p[0], p[1], p[2]);
mx.set_sound_freq(g_ambient, 44100);
mx.set_sound_vol(g_ambient, 1.0);
}
if so it does not work ingame
Code: Select all
var g_ambient = mx.add_sound("@blank/sounds/ambient.sw");
var p = [], r = [];
mx.set_sound_freq(g_ambient, 44100);
mx.set_sound_vol(g_ambient, 1.0);
mx.set_sound_loop(g_ambient, 1);
mx.start_sound(g_ambient);
function updateCamPosition() {
mx.get_camera_location(p, r);
mx.set_sound_pos(g_ambient, p[0], p[1], p[2]);
}
mx.frame_handler = updateCamPosition;