Revision Difference
steamworks.DownloadUGC#546087
<function name="DownloadUGC" parent="steamworks" type="libraryfunc">
<description>Downloads a Steam Workshop file by its ID and returns a path to it.</description>
<realm>Client and Menu</realm>
<args>
<arg name="workshopID" type="string">The ID of workshop item to download. **NOT** a file ID.</arg>
<arg name="resultCallback" type="function">The function to process retrieved data. The first argument is a string, containing path to the saved file, or nil if the download failed to any reason. The second argument is a <page>file_class</page> object pointing to the downloaded .gma file. The file handle will be closed after the function exits.</arg>⤶
<arg name="resultCallback" type="function">The function to process retrieved data. Arguments passed are:⤶
* <page>string</page> path - Contains a path to the saved file, or nil if the download failed for any reason.⤶
* <page>file_class</page> file - A file object pointing to the downloaded .gma file. The file handle will be closed after the function exits.</arg>⤶
</args>
</function>
<example>
<description>Downloads the Fire Extinguisher addon from Steam Workshop prints path to its .gma file to be used with <page>game.MountGMA</page>.</description>
<code>
steamworks.DownloadUGC( "104607228", function( path, file )
print( path, file )
end)
</code>
</example>