Page 1 of 1

CMO ScenEdit_LocalSound (string)

Posted: Tue Dec 10, 2019 2:34 pm
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.

RE: CMO ScenEdit_LocalSound (string)

Posted: Wed Dec 11, 2019 4:09 am
by michaelm75au
ScenEdit_PlaySound("C:\\Command\\CMANO_Dev\\Debug\\Sound\\Effects\\Alert_missile.mp3", 0)
ScenEdit_PlaySound("Alert_missile.mp3", 0)

RE: CMO ScenEdit_LocalSound (string)

Posted: Wed Dec 11, 2019 4:21 am
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.

RE: CMO ScenEdit_LocalSound (string)

Posted: Wed Dec 11, 2019 8:32 pm
by kevinkins
Thanks ... think I have it now.