Garry's Mod Wiki

Revision Difference

steamworks.DownloadUGC#512763

<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 and only argument is a string, containing path to the saved file, or nil if the download failed to any reason.</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( name )⤶ print( name )⤶ end)⤶ </code>⤶ ⤶ </example>