<?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=SetGameSound3DPosition</id>
	<title>SetGameSound3DPosition - 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=SetGameSound3DPosition"/>
	<link rel="alternate" type="text/html" href="https://g1r-mp.com/wiki/index.php?title=SetGameSound3DPosition&amp;action=history"/>
	<updated>2026-10-01T15:25:43Z</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=SetGameSound3DPosition&amp;diff=1186&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=SetGameSound3DPosition&amp;diff=1186&amp;oldid=prev"/>
		<updated>2026-10-01T10:20:49Z</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;= setGameSound3DPosition =&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 new world position for a sound created by [[playSound3DFromGame]].&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 setGameSound3DPosition(number handle, number x, number y, number z)&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;handle&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || yes || Positive integer handle returned by [[playSoundFromGame]] or [[playSound3DFromGame]], owned by the current resource. Valid IDs do not exceed 9007199254740991.&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;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Returns a positive integer request ID when the command is accepted for asynchronous processing, or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; when rejected locally. The request ID identifies this command; it is not a new sound handle. Observe [[onClientGameSoundResult]] for the result.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
Move a 3D campfire source after one second. Replace both positions with locations near the player:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; line&amp;gt;&lt;br /&gt;
local sound = playSound3DFromGame(&amp;quot;event:/SFX/Objects/Fire/SFX_OBJ_Fire_Campfire_BurnLoop&amp;quot;, 125.5, -48.0, 3.25, {volume = 0.4})&lt;br /&gt;
if sound then&lt;br /&gt;
    setTimer(function()&lt;br /&gt;
        local requestId = setGameSound3DPosition(sound, 129.5, -48.0, 3.25)&lt;br /&gt;
        if not requestId then outputDebugString(&amp;quot;Position request rejected&amp;quot;) end&lt;br /&gt;
    end, 1000, 1)&lt;br /&gt;
    setTimer(function() stopGameSound(sound) end, 4000, 1)&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;
* Controls require a nonterminal handle owned by the current resource. Unknown, expired, foreign-resource or terminal handles are rejected.&lt;br /&gt;
* A return value of &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; has no result event for that attempted command. Rejection can also mean the game is not ready or a request limit has been reached.&lt;br /&gt;
* Control acceptance does not change the cached playback state immediately. Native acknowledgements and observed state changes arrive asynchronously.&lt;br /&gt;
* Only handles created with [[playSound3DFromGame]] are accepted. A listener-relative sound created with [[playSoundFromGame]] is still a 2D request and cannot be moved through this function.&lt;br /&gt;
* Coordinates use metres and the game world axis order. The cached sound state does not include the current position.&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>