Members | Sign In
All Forums > Mission Scripting
avatar

play_sound_now - does it work?

posted Dec 06, 2011 06:10:00 by tallasse
I'm trying to put together a few missions, but I can't seem to get play_sound_now to work. I've tried .wav files and .ogg files, stereo, mono, in the mission directory, /dat/ directory, and main directory. It crashes when play_sound_now is triggered if I use anything but a mono .wav in the Mission directory, so I figure that's where it's supposed to go, but it doesn't actually play the sound when the event triggers. Is there a volume setting I'm missing?
page   1
4 replies
avatar
Mike_Substelny said Dec 06, 2011 13:47:42
I have been working on a few mission scripts that use this feature and play_sound_now definitely *does* work. Yes, your sound needs to be a mono .wav file in the mission folder. The sound will play on the main screen speakers. I suggest that you turn down the music to 10% or lower.

When I run my missions on my bridge the sound comes through loud and clear. However others have reported that they can barely hear my play_sound_now files. They said that the engine sound was so loud that it drowned out my sounds. I have been unable to replicate the problem on my bridge, where the play_sound_now files come out much louder than the engine sounds.

Perhaps it is because the other bridge runs main screen on a laptop with a small sound system(?).

On my bridge I use either a desktop PC with a subwoofer and huge speakers, or a large laptop with a powerful on-board sound system. Both work equally well for play_sound_now.

I, too, would like to get this figured out so that my missions will work correctly on any bridge.
"Damn the torpedoes! Four bells, Captain Drayton!"

(Likely actual words of Admiral David Farragut, USN, at the battle of Mobile Bay. Four bells was the signal for the engine room to make full steam ahead).
avatar
tallasse said Dec 06, 2011 16:12:59
After sleeping on it, I tried it again during a break at work, and I figured it out. It does work as advertised, the play_sound_now does trigger, with the caveat that play_sound_now sounds aren't audible if the main screen game window doesn't have focus. In a practical game, the main screen will almost always have focus. However, usually in testing scripts you've got multiple Artemis windows open, so a different process has focus, and if you're using the main screen to also run a bridge station, the main screen won't have focus.

Basically, the main screen instance of Artemis must have focus in order for play_sound_now sound events to be audible.
[Last edited Dec 06, 2011 16:13:29]
avatar
ThomRobertson said Dec 07, 2011 01:47:38
Whoops! You're right, tallasse, that's a bug. I'll fix it in the next version. Upon reviewing the code, I also realized that the play_sound_now command didn't obey any volume controls at all, so I made it obey the Comms volume slider.
Creator of Artemis
avatar
Mike_Substelny said Dec 09, 2011 15:45:12
FWIW I long ago abandoned script development on a single computer. I use one for scripting/server and at least on more for client. This means I can see and hear everything that goes to main screen.

The only time I run a client on the server machine is when I am testing a mission with a lot of script-generated Comms (e.g. "Truce or Consequences"). In that case I open two instances of Artemis on my server: a large Main Screen window with a small Comms window beside it. That way I can see the pace of messages coming in.

Another consideration for this is Helm. You can't navigate with a joystick if Helm doesn't have focus. While working on "Truce or Consequences" I pulled out an additional netbook just to run the Helm.
"Damn the torpedoes! Four bells, Captain Drayton!"

(Likely actual words of Admiral David Farragut, USN, at the battle of Mobile Bay. Four bells was the signal for the engine room to make full steam ahead).
Login below to reply: