Greetings,
I'm afraid that's not it, gooner...
The problem is, in fact, the addAction command. BIS, in their infinite wisdom, made the addAction command in such a way that you can only do one thing with it: execute scripts.
So:
player addAction ["Speak", "TestSpeech.sqs"]
would execute a script called TestSpeech.sqs. The command
this addaction ["Test Speach", playsound "Speach1"]
would try to execute a script called "playsound "speach1"". It can't do that, so it would return an error. The solution is simple, but annoying (since you have to write a script that does virtually nothing):
Put:
this addAction ["Test Speech", "TestSpeech.sqs"]
in place of your first addAction command. Then open up Notepad, and type/ copy this:
===============================
: ***************
; TestSpeech.sqs
; ***************
playSound "Speach1"
exit
===============================
The first three lines are just comments, and are optional.
Go to File > Save. In the 'Save' dialogue, under 'Save As Type', select 'All Files (*.*)'. Navigate to the Codemasters\OperationFlashpoint\Users\[YourName]\[MissionName] directory. Call the file "TestSpeech.sqs" - make sure you put the .sqs extention on.
That's it. Now, when you preview the mission, and select the "Test Speech" action, the script will execute, play the sound, and quit.
The upshot of this: You need a seperate script for every single action you use...
Reference:OFPEC Commented Command Reference (COMREF):
http://www.ofpec.com/editors/comref.php?letter=A#addAction-Supr. Cmdr. PsyWarrior
-Psychic Productions