Members | Sign In
All Forums > Mission Scripting

play_sound_now documentation?

posted May 29, 2012 15:17:32 by name4026
Hi there. I'm trying to script up my first Artemis mission, and I'm running into some problems with a few commands. In particular, play_sound_now is causing me some grief, and I can't find any documentation on the command anywhere to see if I'm using it correctly, so I wondered if someone on here with more experience could help me out.

My problem is that every time I use play_sound_now, it crashes the game, with no terribly helpful debug info. I've tried using it in two ways. First, with a wav file in the /dat/ folder of the Artemis install directory, like so:

<play_sound_now filename="dat/alarm2.wav" />

And second, with an ogg in the MISS_xxx directory, like so:

<play_sound_now filename="geiger.ogg" />

Both seem to cause a crash (in that, when I take them out, the crash goes away). Can anyone shed any light on what I'm doing wrong?

page   1
3 replies
name4026 said May 29, 2012 16:02:41
Nnng. I am a stupid-head. I just found Artemis/mission-file-docs.txt. I've been using the forums and the wiki to cobble together a somewhat out-of-date understanding of mission scripting. This should help a lot.

In case someone else finds this problem via google or whatever, here's the relevant part of the docs:

COMMAND: play_sound_now
	ATTRIBUTE: filename
			VALID: text (name of the WAV file in the mission's directory)


The conclusion seems to be that the file must be both in wave format and in the mission folder. Having done that, play_sound_now works just fine.
madings said Sep 03, 2012 10:30:20
In past versions another undocumented feature was that the sound file had to be encoded with only one channel (mono). If it was encoded with two channels (stereo), it crashed. A lot of recording software defaults to stereo even when you only have one microphone by cloning the signal to both channels. You have to go in and tell it to not do that. I don't know if this is still the case but it kept happening with me when I was trying to make a mission script. stereo = crash on play_sound_now, mono = works fine.

Mike_Substelny said Sep 04, 2012 16:14:22
I don't think that two-channel audio crashes the server. Instead two-channel audio plays at half speed.
"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: