View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002878 | FSSCP | scripting | public | 2013-05-20 09:29 | 2013-09-02 07:22 |
Reporter | niffiwan | Assigned To | niffiwan | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.6.19 | ||||
Target Version | 3.7.2 | ||||
Summary | 0002878: LUA playMusic ignores players music volume level | ||||
Description | playMusic expects a volume to be passed to it, otherwise it defaults to 100%/max volume. This ignores the player set music volume. If the player makes a manual volume change, it overrides the volume the script set. | ||||
Steps To Reproduce | Download & install the BtA Demo (seriously, it's good :)) Enter either mission from the tech room Note the music volume Press F2 & change the volume | ||||
Additional Information | Music script used by BtA is play-music-from-file-sct.tbm. http://www.hard-light.net/forums/index.php?topic=78475.0 | ||||
Tags | No tags attached. | ||||
|
mantis2878-svn.patch (1,290 bytes)
Index: code/parse/lua.cpp =================================================================== --- code/parse/lua.cpp (revision 9677) +++ code/parse/lua.cpp (working copy) @@ -11026,7 +11026,8 @@ return ade_set_args(L, "b", idx > -1); } -ADE_FUNC(playMusic, l_Audio, "string Filename, [float volume = 1.0, bool looping = true]", "Plays a music file using FS2Open's builtin music system. Volume should be in the 0.0 - 1.0 range, and is capped at 1.0. Files passed to this function are looped by default.", "number", "Audiohandle of the created audiostream, or -1 on failure") +extern float Master_event_music_volume; +ADE_FUNC(playMusic, l_Audio, "string Filename, [float volume = 1.0, bool looping = true]", "Plays a music file using FS2Open's builtin music system. Volume is currently ignored, uses players music volume setting. Files passed to this function are looped by default.", "number", "Audiohandle of the created audiostream, or -1 on failure") { char *s; float volume = 1.0f; @@ -11038,7 +11039,8 @@ if(ah < 0) return ade_set_error(L, "i", -1); - CLAMP(volume, 0.0f, 1.0f); + // didn't remove the volume parameter because it'll break the API + volume = Master_event_music_volume; audiostream_play(ah, volume, loop ? 1 : 0); return ade_set_args(L, "i", ah); |
|
discussion here seems mostly in favour of always using the player set music volume (i.e. ignore the volume set by the script) http://www.hard-light.net/forums/index.php?topic=84615.0 I'll commit this post 3.7.0 final unless anyone else comments before then |
|
Fix committed to trunk@9763. |
Date Modified | Username | Field | Change |
---|---|---|---|
2013-05-20 09:29 | niffiwan | New Issue | |
2013-05-20 09:29 | niffiwan | Status | new => assigned |
2013-05-20 09:29 | niffiwan | Assigned To | => niffiwan |
2013-05-20 09:31 | niffiwan | File Added: mantis2878-svn.patch | |
2013-05-20 09:31 | niffiwan | Status | assigned => code review |
2013-08-06 02:05 | niffiwan | Note Added: 0015208 | |
2013-08-06 02:05 | niffiwan | Target Version | => 3.7.2 |
2013-09-02 07:22 | niffiwan | Changeset attached | => fs2open trunk r9763 |
2013-09-02 07:22 | niffiwan | Note Added: 0015257 | |
2013-09-02 07:22 | niffiwan | Status | code review => resolved |
2013-09-02 07:22 | niffiwan | Resolution | open => fixed |