Skip to content
hokein edited this page Oct 14, 2014 · 11 revisions

##Object

greenworks.UGCMatchingType

This object is the same as enum EUGCMatchingUGCType in Steam SDK, representing Mathcing UGC types for queries.

  • Items
  • ItemsMtx
  • ItemsReadyToUse
  • Collections
  • Artwork
  • Videos
  • Screenshots
  • AllGuides
  • WebGuides
  • IntegratedGuides
  • UsableInGame
  • ControllerBindings

greenworks.UGCQueryType

This object is the same as enum EUGCQuery in Steam SDK, represents combination of sorting and filtering for queries across all UGC.

  • RankedByVote
  • RankedByPublicationDate
  • AcceptedForGameRankedByAcceptanceDate
  • RankedByTrend
  • FavoritedByFriendsRankedByPublicationDate
  • CreatedByFriendsRankedByPublicationDate
  • RankedByNumTimesReported
  • CreatedByFollowedUsersRankedByPublicationDate
  • NotYetRated
  • RankedByTotalVotesAsc
  • RankedByVotesUp
  • RankedByTextSearch

SteamUGCDetails

The object represents Steam SDK SteamUGCDetails_t(return by greenworks.ugcGetItems), details for a single published file/UGC

  • acceptForUse Boolean: Whether is flaged as accepted in Steam workshop.
  • banned Boolean: Whether is banned
  • tagsTruncated Boolean: Whether the list of tags is too long to be returned in provided buffer.
  • fileType Integer: Type of the file
  • result Integer: Result of the operation.
    • 1: Success
    • Others: Fail
  • visibility Integer: the visiblility of the file
    • 0: Public
    • 1: FriendsOnly
    • 2: Private
  • score Double: Calculated score
  • file String: Represents uint64
  • fileName String: Cloud file name of the primary file
  • fileSize Integer: Size of the primary file
  • previewFile String: Represents uint64, handle of preview file
  • previewFileSize Integer: Size of preview file
  • steamIDOwner String: Represents uint64, Steam ID of user who created the file.
  • consumerAppID Integer: ID of app that consumes the file
  • creatorAppID Integer: ID of app that created the file
  • publishedFileId String: Represents uint64, the file ID
  • title String: Title of the file
  • description String: Description of the file
  • URL String:
  • tags String: List of tags, separated by comma.
  • timeAddedToUserList Integer: Time when user added this file to list.
  • timeCreated Integer: Time when the file was created
  • timeUpdated Integer: Time when the file is last updated.
  • votesDown Integer: Number of votes down
  • votesUp Integer: Number of votes up

##APIs

greenworks.fileShare(file_path, success_callback, [error_callback])

  • file_path String
  • success_calback Function(file_handle)
    • file_handle Integer: The handle that can be shared with users and features
  • error_callback Function(err)

greenworks.publishWorkshopFile(file_path, image_path, title, description, success_callback, [error_callback])

  • file_path String
  • image_path String
  • title String
  • description String
  • success_callback Function(publish_file_id)
    • publish_file_id Integer: represents the published file id on Steam.
  • error_callback Function(err)

Publish file_path workshop item on Steam. The files file_path and image_path need to be existed on Steam Cloud(Using writeTextToFile or saveFilesToCloud API) and get shared(Using Greenworks.fileShare) first.

An empty String of image_path means no image for the workshp item.

greenworks.updatePublishedWorkshopFile(published_file_id, file_path, image_path, title, description, success_callback, [error_callback])

  • published_file_id String: Represents Uint64
  • file_path String
  • image_path String
  • title String
  • description String
  • success_callback Function()
  • error_callback Function(err)

An empty String of file_path/image_path/title/description means no update of that field.

greenworks.ugcPublish(file_path, title, description, image_path, success_callback, [error_callback], [progress_callback])

  • file_path String
  • title String
  • description String
  • image_path String
  • success_callback Function(published_file_id)
    • published_file_id String: Represent uint64
  • error_callback Function(err)
  • progress_callback Function(progress_msg)
    • progress_msg String: current process during publish period: Completed on saving files to Steam Cloud, Completed on sharing files.

Publishes user generated content(ugc) to Steam workshop.

greenworks.ugcPublishUpdate(published_file_id, file_path, title, description, image_path, success_callback, [error_callback], [progress_callback])

  • published_file_id String: Represents uint64
  • file_path String
  • title String
  • description String
  • image_path String
  • success_callback Function()
  • error_callback Function(err)
  • progress_callback Function(progress_msg)
    • progress_msg String: current process during publish-update period: Completed on saving files to Steam Cloud, Completed on sharing files.

Updates published ugc.

greenworks.ugcGetItems(ugc_matching_type, ugc_query_type, success_callback, [error_callback])

  • ugc_matching_type greenworks.UGCMatchingType
  • ugc_query_type greenworks.UGCQueryType
  • success_callback Function(nums_of_item, items)
    • nums_of_item Integer
    • items Array of SteamUGCDetails Object
  • error_callback Function(err)
Clone this wiki locally