<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://g1r-mp.com/wiki/index.php?action=history&amp;feed=atom&amp;title=PlaySound3DFromGame</id>
	<title>PlaySound3DFromGame - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://g1r-mp.com/wiki/index.php?action=history&amp;feed=atom&amp;title=PlaySound3DFromGame"/>
	<link rel="alternate" type="text/html" href="https://g1r-mp.com/wiki/index.php?title=PlaySound3DFromGame&amp;action=history"/>
	<updated>2026-10-01T16:25:03Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://g1r-mp.com/wiki/index.php?title=PlaySound3DFromGame&amp;diff=1182&amp;oldid=prev</id>
		<title>QCherry: Document upcoming 0.1.7 game audio: 11 client APIs, result event, limits and complete dialogue catalog; not a release</title>
		<link rel="alternate" type="text/html" href="https://g1r-mp.com/wiki/index.php?title=PlaySound3DFromGame&amp;diff=1182&amp;oldid=prev"/>
		<updated>2026-10-01T10:20:37Z</updated>

		<summary type="html">&lt;p&gt;Document upcoming 0.1.7 game audio: 11 client APIs, result event, limits and complete dialogue catalog; not a release&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= playSound3DFromGame =&lt;br /&gt;
&amp;lt;div style=&amp;quot;background:#fff5f5; border:1px solid #d13b3b; border-left:5px solid #d13b3b; color:#111111; padding:0.85rem 1rem; margin:0.75rem 0 1rem;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#111111; font-weight:bold; letter-spacing:0.04em;&amp;quot;&amp;gt;PLANNED FOR UPDATE 0.1.7&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#111111; margin-top:0.25rem;&amp;quot;&amp;gt;This function is planned for G1R:MP 0.1.7. It is not included in the public 0.1.6 release.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Requests a game sound at a fixed world position on the local client.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
number|false playSound3DFromGame(string key, number x, number y, number z [, table options])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Name !! Type !! Required !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;key&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; || yes || Exact, case-sensitive key from [[getGameSoundCatalog]]. Accepts catalog entries only; no filename, URL or arbitrary event name.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || yes || World X coordinate in metres; finite and between -200000 and 200000, inclusive.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || yes || World Y coordinate in metres; finite and between -200000 and 200000, inclusive.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;z&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || yes || World Z coordinate in metres; finite and between -200000 and 200000, inclusive.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;options&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; || no || Optional settings: volume = 1, minDistance = 1, maxDistance = 30. Only these keys are accepted. Volume must be finite and between 0 and 1. Distances are metres, must be finite, and require 0 &amp;lt;= minDistance &amp;lt; maxDistance &amp;lt;= 200000 with maxDistance &amp;gt;= 0.01.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Returns a positive integer sound handle when the request is accepted, or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; when rejected locally. The handle is also the initial play request ID. [[onClientGameSoundResult]] reports native success or failure; a returned handle does not prove playback.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
Place a campfire sound at a chosen world position and stop it after five seconds. Replace the coordinates with a location near the player:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; line&amp;gt;&lt;br /&gt;
local sound = playSound3DFromGame(&lt;br /&gt;
    &amp;quot;event:/SFX/Objects/Fire/SFX_OBJ_Fire_Campfire_BurnLoop&amp;quot;,&lt;br /&gt;
    125.5, -48.0, 3.25,&lt;br /&gt;
    {volume = 0.5, minDistance = 1, maxDistance = 30}&lt;br /&gt;
)&lt;br /&gt;
if sound then&lt;br /&gt;
    setTimer(function() stopGameSound(sound) end, 5000, 1)&lt;br /&gt;
else&lt;br /&gt;
    outputDebugString(&amp;quot;3D game sound request rejected&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Planned for update 0.1.7; not included in public 0.1.6.&lt;br /&gt;
* Available only in client-side resource scripts. See [[Game audio]] for ownership, lifecycle, limits and server-triggered playback.&lt;br /&gt;
* Coordinates and distances use metres. Keep the usual game world axis order; no manual axis conversion is needed.&lt;br /&gt;
* A 3D request for an authored 2D event fails asynchronously with &amp;lt;code&amp;gt;event-is-2d&amp;lt;/code&amp;gt;. Successful 3D playback reports mode &amp;lt;code&amp;gt;world-3d&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Playback stays at the requested world position until [[setGameSound3DPosition]] moves it. It is not automatically attached to a player or object.&lt;br /&gt;
* Distance settings are per-instance FMOD overrides. The event&amp;#039;s authored attenuation and parameters still affect the result; no fixed falloff curve or silence boundary is guaranteed.&lt;br /&gt;
* The same catalog, language, ownership and lifecycle rules as [[playSoundFromGame]] apply.&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua Functions]]&lt;br /&gt;
[[Category:Client Functions]]&lt;br /&gt;
[[Category:Audio Functions]]&lt;/div&gt;</summary>
		<author><name>QCherry</name></author>
	</entry>
</feed>