• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Kregritt

Sergeant
2 Badges
Jul 19, 2016
70
0
  • Crusader Kings II: Holy Fury Pre-order
  • Crusader Kings II: Holy Fury
This is an issue experienced by many modders, but I haven't been able to find any solutions online.

The problem is that when you buy yourself a new PC, you are no longer able to update the mods you've previously published on Steam Workshop, you are only able to publish them again, creating a completely new page for the mod, which isn't ideal for anyone.

Is there any workaround for this? How does Steam/the game itself recognize which mods have been previously published?
 
I think nobody knows how CK2 engine associates local mods to workshop items...

But I'm looking at an alternative solution to upload mods outside of the game, based on Steam API https://partner.steamgames.com/doc/features/workshop/implementation#CreateUploadContent
Regarding to Steam API, m_unAppID is required for using it. So we can not use it from 3rd party app without mocking.(correct me if I'm wrong)

I had some experiments with SteamCMD (steam console client). It is capable to upload workshop files via bash/cmdline.
First talk about the conclusion, I still failed to update a exist mod via SteamCMD. But it is possible that you can update/create a new workshop item via SteamCMD, which bypass CK2 and the game can not manage them after upload, of course.
Something weird is, the params I use allow me upload files to workshop of other games (ya I upload a CK2 portrait mod to Age Of Empire II HD lol). But it never successes for workshop of CK2.

Alternatively, a possible way is to find how and where CK2 stores m_nPublishedFileId values returned from Steam API, and make a backup of it.
I searched but in vain.
 
I had some experiments with SteamCMD (steam console client). It is capable to upload workshop files via bash/cmdline.
First talk about the conclusion, I still failed to update a exist mod via SteamCMD. But it is possible that you can update/create a new workshop item via SteamCMD, which bypass CK2 and the game can not manage them after upload, of course.
Something weird is, the params I use allow me upload files to workshop of other games (ya I upload a CK2 portrait mod to Age Of Empire II HD lol). But it never successes for workshop of CK2.

Interesting !

From my investigations (trying with Steamworks .NET) CK2 does NOT support the newer API for Steam Workshop ( ISteamUGC::SubmitItemUpdate )
It always fails with k_EResultInvalidParam and log "Unable to create depot" which according to the doc means it is not enabled by game in Steam admin panel.

Based on Steam logs (Steam\logs\cloud_log.txt) for a mod update the game is using ISteamRemoteStorage:UpdatePublishedFile API that was deprecated in 2013.
It relies on steam cloud synchronization mechanism between folder Steam\userdata\<UserID>\203770\remote\mod and the Steam servers.

[2019-11-09 00:02:14] [AppID 203770] Starting UpdatePublishedFile
[2019-11-09 00:02:15] [AppID 203770] HTTP upload for file 'mod/mymod.zip' beginning . . .
[2019-11-09 00:02:15] [AppID 203770] HTTP upload for file 'mod/mymod.zip' (offset=0, length=302) to (2a00:1450:4007:812::2010 / 2a00:1450:4007:812::2010, host: steamcloud-ugc.storage.googleapis.com) - success.
[2019-11-09 00:02:15] [AppID 203770] Upload OK for file mod/mymod.zip
[2019-11-09 00:02:16] [AppID 203770] UpdatePublishedFile complete, result OK

I'm guessing during a mod update, CK2.exe is:
  • zipping the mod folder
  • writing the descriptor.mod in the zip from the .mod file
  • copying the zip to steam remote\mod folder
  • triggering cloud synch by calling ISteamRemoteStorage
I'm trying to replicate the same thing in a .NET console application, but so far no luck. :mad:
 
It always fails with k_EResultInvalidParam and log "Unable to create depot" which according to the doc means it is not enabled by game in Steam admin panel.
That's quite the same I have in SteamCMD workshop_log.txt
[2019-10-13 15:04:37] [AppID 203770] Upload workshop item failed, no workshop depot found
Based on Steam logs (Steam\logs\cloud_log.txt) for a mod update the game is using ISteamRemoteStorage:UpdatePublishedFile API that was deprecated in 2013.
I'm guessing during a mod update, CK2.exe is:
  • zipping the mod folder
  • writing the descriptor.mod in the zip from the .mod file
  • copying the zip to steam remote\mod folder
  • triggering cloud synch by calling ISteamRemoteStorage
Agree with that, CK2 is using legacy API. For which SteamCMD provides only limited supports, I have a dead end with SteamCMD.
The process you guessed is much identical with my observation by using Process Monitor. But I can not fetch a working .vdf file used for Steam-CK2 communication. Maybe a crash can leave some dump there...
 
Last edited:
I just got a (slightly) better pc and ran into this problem. So it's up to PDX to fix things on their end then?