View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0002668 | FSSCP | scripting | public | 2012-06-19 05:31 | 2012-06-25 06:22 |
| Reporter | z64555 | Assigned To | |||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | won't fix | ||
| Platform | x86_32 | OS | Windows XP | OS Version | SP3 |
| Product Version | 3.6.14 RC6 | ||||
| Summary | 0002668: getSoundEntry missing from RC6 | ||||
| Description | One of our LUA scripts for FringeSpace uses getSoundEntry, upon running the mod, the LUA error occurs every time the main hall mission (attached) loads. | ||||
| Steps To Reproduce | Download the attached mission file Run a Debug build of 3.6.14 RC6 Open the mission file, and observe if any LUA errors arise | ||||
| Tags | No tags attached. | ||||
|
|
|
|
|
mantis_2668.patch (1,608 bytes)
Index: code/parse/lua.cpp
===================================================================
--- code/parse/lua.cpp (revision 8898)
+++ code/parse/lua.cpp (working copy)
@@ -9013,6 +9013,40 @@
//**********LIBRARY: Audio
ade_lib l_Audio("Audio", NULL, "ad", "Sound/Music Library");
+ADE_FUNC(getSoundentry, l_Audio, "string/number", "Return a sound entry matching the specified index or name. If you are using a number then the first valid index is 1", "soundentry", "soundentry or invalid handle on error")
+{
+ int index = -1;
+
+ if (lua_isnumber(L, 1))
+ {
+ int idx = -1;
+ if(!ade_get_args(L, "i", &idx))
+ return ade_set_error(L, "o", l_SoundEntry.Set(sound_entry_h()));
+
+ index = gamesnd_get_by_tbl_index(idx);
+ }
+ else
+ {
+ char *s = NULL;
+ if(!ade_get_args(L, "s", &s))
+ return ade_set_error(L, "o", l_SoundEntry.Set(sound_entry_h()));
+
+ if (s == NULL)
+ return ade_set_error(L, "o", l_SoundEntry.Set(sound_entry_h()));
+
+ index = gamesnd_get_by_name(s);
+ }
+
+ if (index < 0)
+ {
+ return ade_set_args(L, "o", l_SoundEntry.Set(sound_entry_h()));
+ }
+ else
+ {
+ return ade_set_args(L, "o", l_SoundEntry.Set(sound_entry_h(0, index)));
+ }
+}
+
ADE_FUNC(playGameSound, l_Audio, "Sound index, [Panning (-1.0 left to 1.0 right), Volume %, Priority 0-3, Voice Message?]", "Plays a sound from #Game Sounds in sounds.tbl. A priority of 0 indicates that the song must play; 1-3 will specify the maximum number of that sound that can be played", "boolean", "True if sound was played, false if not (Replaced with a sound instance object in the future)")
{
int idx;
|
|
|
Possible fix attached: I simply copied the getSoundentry function over from lua.cpp in trunk. |
|
|
I doubt that that will actually work as the whole new sound API isn't present in the 3.6.14 branch. The solution would be to either copy the new sound API or just use a trunk build if compatibility with 3.6.14 isn't needed. |
|
|
If I may ask, why isn't the new sound API in .14? |
|
|
Probably because it's a feature that got added after the 3.6.14 branch was created and was placed under a feature freeze. |
|
|
This is a post 3.6.14 feature, as we are in feature freeze this is very unlikely to be back ported. Nightly builds and the typical build process will kick off again once 3.6.14 in final and released. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2012-06-19 05:31 | z64555 | New Issue | |
| 2012-06-19 05:31 | z64555 | File Added: FSMenuMap.fs2 | |
| 2012-06-19 06:38 | CommanderDJ | File Added: mantis_2668.patch | |
| 2012-06-19 06:38 | CommanderDJ | Note Added: 0013677 | |
| 2012-06-19 08:08 | m_m | Note Added: 0013678 | |
| 2012-06-20 04:08 | CommanderDJ | Note Added: 0013682 | |
| 2012-06-20 07:43 | m_m | Note Added: 0013683 | |
| 2012-06-20 15:25 | Echelon9 | Note Added: 0013684 | |
| 2012-06-20 15:25 | Echelon9 | Status | new => closed |
| 2012-06-20 15:25 | Echelon9 | Resolution | open => won't fix |
| 2012-06-25 06:22 | Goober5000 | Product Version | 3.6.14 RC5 => 3.6.14 RC6 |
| 2012-06-25 06:22 | Goober5000 | Additional Information Updated |