2019-02-20 snapshot

Post anything about MX Simulator here. Please. I'm begging you.
Jakob Hubbard
Posts: 1152
Joined: Fri Nov 24, 2017 3:16 am
Team: Phil's
Location: Cold
Contact:

Re: 2019-02-20 snapshot

Post by Jakob Hubbard »

so does this mean in supercross we could have a gate drop sound? :shock:
Image
Ddavis
Posts: 17959
Joined: Wed Sep 28, 2011 1:02 am

Re: 2019-02-20 snapshot

Post by Ddavis »

Import the MX vs ATV sounds into sim and we're dialed :lol:
jlv
Site Admin
Posts: 14931
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: 2019-02-20 snapshot

Post 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.
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
TeamHavocRacing
Posts: 8361
Joined: Thu Nov 19, 2009 5:52 am
Team: Havoc Racing
Contact:

Re: 2019-02-20 snapshot

Post 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!
jlv wrote:If it weren't for Havoc I'd have been arguing with the 12 year olds by myself.
Soul Designs
Posts: 102
Joined: Sat Sep 15, 2018 7:31 pm
Team: ilegal taco bell

Re: 2019-02-20 snapshot

Post 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
BcMxKx37
Posts: 1723
Joined: Sun Jun 02, 2013 5:20 am
Location: Costa Mesa, CA
Contact:

Re: 2019-02-20 snapshot

Post 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:
Image
AtlasZoor
Posts: 338
Joined: Wed Aug 02, 2017 12:51 am
Team: Atlas Trackworks
Location: Corn

Re: 2019-02-20 snapshot

Post 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)
Image
Shadow13
Posts: 80
Joined: Sat Mar 18, 2017 2:50 am
Team: Fuel Graphix

Re: 2019-02-20 snapshot

Post by Shadow13 »

keeps sayin i cant run as adminitrator
Image
DJ99X
Posts: 15523
Joined: Tue Jan 15, 2008 11:36 am
Location: Land Down Under

Re: 2019-02-20 snapshot

Post 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
AtlasZoor
Posts: 338
Joined: Wed Aug 02, 2017 12:51 am
Team: Atlas Trackworks
Location: Corn

Re: 2019-02-20 snapshot

Post 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...
Image
jlv
Site Admin
Posts: 14931
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: 2019-02-20 snapshot

Post 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.
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
AtlasZoor
Posts: 338
Joined: Wed Aug 02, 2017 12:51 am
Team: Atlas Trackworks
Location: Corn

Re: 2019-02-20 snapshot

Post 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.
Image
jlv
Site Admin
Posts: 14931
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: 2019-02-20 snapshot

Post 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]);
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
AtlasZoor
Posts: 338
Joined: Wed Aug 02, 2017 12:51 am
Team: Atlas Trackworks
Location: Corn

Re: 2019-02-20 snapshot

Post 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
Image
aaronr5
Posts: 596
Joined: Wed Dec 29, 2010 8:03 am
Team: DAM
Location: North Carolina

Re: 2019-02-20 snapshot

Post 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;
Post Reply