Page 2 of 5

Re: 2019-02-20 snapshot

Posted: Fri Feb 22, 2019 1:23 am
by Jakob Hubbard
so does this mean in supercross we could have a gate drop sound? :shock:

Re: 2019-02-20 snapshot

Posted: Fri Feb 22, 2019 2:14 am
by Ddavis
Import the MX vs ATV sounds into sim and we're dialed :lol:

Re: 2019-02-20 snapshot

Posted: Fri Feb 22, 2019 2:38 am
by jlv
aeffertz wrote:Assuming they have to be .sw audio files?
Yes. It's headerless 16 bit signed PCM samples.
808 wrote:Does this mean birds and wind or does this mean chain slapping and impact noises. Or both?
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.

Re: 2019-02-20 snapshot

Posted: Fri Feb 22, 2019 2:12 pm
by TeamHavocRacing
checkerz wrote:So we can get Turley's "What's up my duuuuudddeeeesssss" when someone passes for the lead?
In the name Science no!

Re: 2019-02-20 snapshot

Posted: Fri Feb 22, 2019 4:18 pm
by Soul Designs
TeamHavocRacing wrote:
checkerz wrote:So we can get Turley's "What's up my duuuuudddeeeesssss" when someone passes for the lead?
In the name Science no!
IMPAO

Re: 2019-02-20 snapshot

Posted: Fri Feb 22, 2019 4:59 pm
by BcMxKx37
jlv wrote:
Smidly wrote:Does this mean you can make the "oof" sound effect for when you go legs off?
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.
did you have to use the most annoying thing ever as a test :roll:

Re: 2019-02-20 snapshot

Posted: Fri Feb 22, 2019 9:16 pm
by AtlasZoor
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?

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);
In the sound_pos is there any way to have the position constant and not directional?

(my b if this made no sense)

Re: 2019-02-20 snapshot

Posted: Fri Feb 22, 2019 10:24 pm
by Shadow13
keeps sayin i cant run as adminitrator

Re: 2019-02-20 snapshot

Posted: Sat Feb 23, 2019 1:20 am
by DJ99X
AtlasZoor 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?

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);
In the sound_pos is there any way to have the position constant and not directional?

(my b if this made no sense)
Use the new camera location function to lock the sound to the camera

Re: 2019-02-20 snapshot

Posted: Sat Feb 23, 2019 1:37 am
by AtlasZoor
DJ99X wrote:Use the new camera location function to lock the sound to the camera
ah ok. any Idea what I would put in the (position, rotmatrix) part? Also, how would I sign the sound to the camera position.

Fairly new to js so sorry...

Re: 2019-02-20 snapshot

Posted: Sat Feb 23, 2019 2:30 am
by jlv
AtlasZoor wrote:
DJ99X wrote:Use the new camera location function to lock the sound to the camera
ah ok. any Idea what I would put in the (position, rotmatrix) part? Also, how would I sign the sound to the camera position.

Fairly new to js so sorry...
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.

Re: 2019-02-20 snapshot

Posted: Sat Feb 23, 2019 2:43 am
by AtlasZoor
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.
Im still kinda lost but this is what I have.

var p = [], r = []; {
mx.get_camera_location(p, r);
mx.set_sound_freq(g_ambient, 44100);
mx.set_sound_vol(g_ambient, 1.0);
}

I am for sure missing alot of stuff but I just don't know where to start.

Re: 2019-02-20 snapshot

Posted: Sat Feb 23, 2019 3:09 am
by jlv
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]);

Re: 2019-02-20 snapshot

Posted: Sat Feb 23, 2019 3:21 am
by AtlasZoor
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]);
So would this be correct to place the sound on the camera?

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

Re: 2019-02-20 snapshot

Posted: Sat Feb 23, 2019 5:03 am
by aaronr5
AtlasZoor wrote:
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]);
So would this be correct to place the sound on the camera?

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
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.

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;