CMO ScenEdit_LocalSound (string)

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
User avatar
kevinkins
Posts: 2465
Joined: Wed Mar 08, 2006 11:54 am

CMO ScenEdit_LocalSound (string)

Post by kevinkins »

Never tried to play a sound before and can't get the function to work. Has anyone? Below is the syntax.

Functions in the Lua Documentation:
ScenEdit_MsgBox (string, style)
ScenEdit_LocalSound (string)

This is what I ran and the result:
ScenEdit_MsgBox ("This works", 1)
ScenEdit_LocalSound ("Explosion_air_medium.mp3")

Result:
>> ScenEdit_MsgBox ("This works", 1)
ScenEdit_LocalSound ("Explosion_air_medium.mp3")
ERROR: [string "Console"]:2: attempt to call global 'ScenEdit_LocalSound' (a nil value)

nil value might indicate the "ink" between the function and the sound\effects folder is nonexistent.

Have to relearn lua every time I use it - so no expert here. I want a sound to indicate a car bomb going off using the enter area trigger.

Thanks.
“The study of history lies at the foundation of all sound military conclusions and practice.”
Alfred Thayer Mahan
User avatar
michaelm75au
Posts: 12465
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: CMO ScenEdit_LocalSound (string)

Post by michaelm75au »

ScenEdit_PlaySound("C:\\Command\\CMANO_Dev\\Debug\\Sound\\Effects\\Alert_missile.mp3", 0)
ScenEdit_PlaySound("Alert_missile.mp3", 0)
Michael
User avatar
michaelm75au
Posts: 12465
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: CMO ScenEdit_LocalSound (string)

Post by michaelm75au »

My error.
I had built the commands with 'local' in them at one stage and then changed their names/values. Forgot to update the extract for the documentation.

The method showing in the Lua Console function list is generally correct as it validates against that.
Michael
User avatar
kevinkins
Posts: 2465
Joined: Wed Mar 08, 2006 11:54 am

RE: CMO ScenEdit_LocalSound (string)

Post by kevinkins »

Thanks ... think I have it now.
“The study of history lies at the foundation of all sound military conclusions and practice.”
Alfred Thayer Mahan
Post Reply

Return to “Lua Legion”