I'm working on Steam Workshop integration for my Unity game's user created levels and I use Steamworks.NET.
Uploading a level for the first time works just fine, I use this snippet to upload my "XYZ.lvl" file:
SteamAPICall_t handle = SteamRemoteStorage.PublishWorkshopFile(filePath, null, SteamUtils.GetAppID(), workshopTitle, workshopDescription, ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPublic, tags, EWorkshopFileType.k_EWorkshopFileTypeCommunity);
RemoteStoragePublishFileResult.Set(handle);
But when I try to update my own, just uploaded level, I get an error: k_EResultInvalidParam
I use this to update it:
var m_UGCUpdateHandle = SteamUGC.StartItemUpdate(SteamUtils.GetAppID(), publishedFileID);
bool ret = SteamUGC.SetItemContent(m_UGCUpdateHandle, dirPath);
if (ret)
{
SteamAPICall_t handle = SteamUGC.SubmitItemUpdate(m_UGCUpdateHandle, "Update Level");
ItemUpdateResult.Set(handle);
}
If instead of SetItemContent
, I want to just update the thumbnail with SetItemPreview
, everything works fine.
So I guess the problem is with my SetItemContent
call.
I tried passing these paths to it, but the same error still happens:
A path to just created directory which contains the new "XYZ.lvl" file.
A path to the new "XYZ.lvl" file.
A path to an empty directory, hoping for a different error.
The Steamworks documentation says this about the error:
k_EResultInvalidParam
- Either the provided app ID is invalid or doesn't match the consumer app ID of the item or, you have not enabled
ISteamUGC
for the provided app ID on the Steam Workshop Configuration App Admin page. - The preview file is smaller than 16 bytes.
Which is strange because as I said, if instead of SetItemContent
I call SetItemPreview
, the thumbnail is correctly uploaded, the API call ends successfully. So the first case doesn't stand: the app ID is good.
But if I add also a SetItemContent
call to the process, the API call fails with InvalidParam
. So the second case doesn't stand as well, because the thumbnail is correct due to the previous testing: it would be uploaded if I wouldn't call SetItemContent
.
I think that's all I know. Feel free to ask for more info and thanks in advance for the help! :)
UPDATE:
The workshop log says that it fails because:
Upload workshop item 2539371896 failed (no workshop depot found)