steam_ugc_set_item_visibility

Set (or update) the visibility of the given item handle.

Syntax:

steam_ugc_set_item_visibility(ugc_update_handle, visibility);


Argument Description
ugc_update_handle The unique handle for the UGC to be updated.
visibility The visibility (a constant, listed below) to be used for the item.


Returns: Boolean


Description

This function will set the visibility of the given item, set using one of the following constants:

Constant Description
ugc_visibility_public Set the item to be publicly visible
ugc_visibility_friends_only Set the item to be visible to only people on the users friends list
ugc_visibility_private Set the item to be private



The update handle is the value returned when you called the function steam_ugc_start_item_update, and function will return true if the API was successfully accessed and false if there was an issue.




Example:

var app_id = steam_get_app_id();
var updateHandle = steam_ugc_start_item_update(app_id, global.Publish_ID);
steam_ugc_set_item_title(updateHandle, "My workshop item(3)!");
steam_ugc_set_item_description( updateHandle, "testing workshop...");
steam_ugc_set_item_visibility(updateHandle, ugc_visibility_public);
var tagArray;
tagArray[0] = "Test";
tagArray[1] = "New";
steam_ugc_set_item_tags(updateHandle, tagArray);
steam_ugc_set_item_preview(updateHandle, "promo.jpg");
steam_ugc_set_item_content(updateHandle, "WorkshopContent1");
requestId = steam_ugc_submit_item_update(updateHandle, "Version 1.2");

The above code gets the game ID, then uses that along with a previously stored published file ID to generate an update handle for the item. This handle is then used to update various pieces of information before the update is pushed to the Workshop servers.


Back: Steam API - User Generated Content
Next: steam_ugc_set_item_tags
© Copyright YoYo Games Ltd. 2018 All Rights Reserved