GetGameSoundCatalog: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Document upcoming 0.1.7 game audio: 11 client APIs, result event, limits and complete dialogue catalog; not a release
 
Release 0.1.7 / BUILD199 / Protocol 39: current API availability, setup and improvements
 
Line 1: Line 1:
= getGameSoundCatalog =
= getGameSoundCatalog =
<div style="background:#fff5f5; border:1px solid #d13b3b; border-left:5px solid #d13b3b; color:#111111; padding:0.85rem 1rem; margin:0.75rem 0 1rem;">
<div style="background:#fff5f5; border:1px solid #d13b3b; border-left:5px solid #d13b3b; color:#111111; padding:0.85rem 1rem; margin:0.75rem 0 1rem;">
<div style="color:#111111; font-weight:bold; letter-spacing:0.04em;">PLANNED FOR UPDATE 0.1.7</div>
<div style="color:#111111; font-weight:bold; letter-spacing:0.04em;">AVAILABLE SINCE UPDATE 0.1.7</div>
<div style="color:#111111; margin-top:0.25rem;">This function is planned for G1R:MP 0.1.7. It is not included in the public 0.1.6 release.</div>
<div style="color:#111111; margin-top:0.25rem;">This function is available since G1R:MP 0.1.7.</div>
</div>
</div>


Line 41: Line 41:


== Notes ==
== Notes ==
* Planned for update 0.1.7; not included in public 0.1.6.
* Available since update 0.1.7.
* Available only in client-side resource scripts. See [[Game audio]] for ownership, lifecycle, limits and server-triggered playback.
* Available only in client-side resource scripts. See [[Game audio]] for ownership, lifecycle, limits and server-triggered playback.
* Entries are returned in key order. The offset is zero-based even though the Lua items array is one-based.
* Entries are returned in key order. The offset is zero-based even though the Lua items array is one-based.

Latest revision as of 23:50, 10 October 2026

getGameSoundCatalog

AVAILABLE SINCE UPDATE 0.1.7
This function is available since G1R:MP 0.1.7.

Searches and pages the compiled game sound metadata catalog on the client.

Syntax

table|false getGameSoundCatalog([string query = "", string category = "", int offset = 0, int limit = 50])

Parameters

Name Type Required Description
query string no Optional substring search across key and speaker, case-insensitive for ASCII text. Defaults to an empty string, which matches all entries. Maximum length: 160 bytes.
category string no Optional exact category: an empty string for all categories, or sfx, music or dialogue. Defaults to an empty string; category names are lowercase and case-sensitive.
offset int no Zero-based count of matching entries to skip. Must be at least 0; defaults to 0.
limit int no Maximum number of items to return, from 1 through 200. Defaults to 50.

Returns

Returns a Lua table with items (array of entry tables), total (number of all matches before paging) and offset (the requested zero-based offset), or false for invalid search or paging arguments. Each entry has key, category and speaker strings. Lua array entries are indexed from 1. A valid query with no matches, or an offset beyond the result set, returns an empty items table.

Examples

List the first twenty matching dialogue keys:

local page = getGameSoundCatalog("Diego", "dialogue", 0, 20)
if page then
    outputDebugString("Matching dialogue entries: " .. tostring(page.total))
    for _, item in ipairs(page.items) do
        outputDebugString(item.key .. " | " .. item.speaker)
    end
end

Notes

  • Available since update 0.1.7.
  • Available only in client-side resource scripts. See Game audio for ownership, lifecycle, limits and server-triggered playback.
  • Entries are returned in key order. The offset is zero-based even though the Lua items array is one-based.
  • Use nil for omitted earlier optional arguments when providing later ones, for example getGameSoundCatalog(nil, "sfx", 0, 20).
  • Search is a substring match, not a regular expression. Copy the exact returned key for playback because key lookup is case-sensitive.
  • The catalog contains metadata only. Recordings remain in the player's installed game; membership does not prove availability in every language/version or audible playback.
  • Catalog queries are local and synchronous; no ready game session or preload is required.