Report Mod
Modworkshop Self-updating
Version 1.1 | Last Updated: 09-12-2017, 07:22 PM
Status: Public
Views: 350
Downloads: 47
9 1
andole
Author (Submissions)

Shortlink:
This does not work due modworkshop changes

This script makes your modworkshop mod self-updating.

If an update is available, player will receive a BLT notification and will be able to update the mod using BLT's download manager.

If player clicks 'patch notes' button, the steam overlay browser will open 'Changelog' section on your mod's page.


How to use:
1. Put the script somewhere inside the folder with your mod.
2. Open it and specify your mod's ID (modworkshop ID can be found in the end of the link to mod's modworkshop page).
3. Open mod.txt and hook the script to something that loads in main menu (I use lib/managers/menu/NewHeistsGui).

Optional:
If you want players to be able to toggle the mod's updates then put this into mod.txt:
Code:
"updates" :
[
 {
   "identifier" : "ID"
 }
]
Where ID is your mod's modworkshop id.

Example of use: https://modworkshop.net/mydownloads.php?...&did=18012

The script checks if the version on modworkshop is the same as in mod.txt.

When you test it, do not keep the folder with the mod open in windows explorer. It often causes BLT to fail the updating process which leaves you without the mod.

Any bug reports are appreciated.
1.1
-The mod page in BLT's mod manager will now display 'Check updates' button and 'Toggle updates' button.

[-]
Leave a comment
To leave a comment you must log in.

09-13-2017, 11:38 PM
Strange, I can come up with at least 2 different ways of doing that, and I even have an (unpublished, but working) mod doing it.
Then again I already said I don't see the point of this mod so I'll just leave you to it...

09-13-2017, 09:31 AM
@Takku
It is impossible to override BLT's functions until the mod is loaded. And by that time BLT has already read blt_data.txt and launched update checks. This means that if you need the 'update enabled' setting from blt_data.txt then you need 'updates' node with the update ID. Just for the setting not to be lost (because it is not saved if there is no update with that ID). The only other way here is to read blt_data.txt again, which is I am going to have to do.

09-13-2017, 08:06 AM
Also... "It cannot be done through another node in mod.txt"? Are you being serious? You're mistaken there.

09-13-2017, 07:56 AM
Every mods that doesn't require BeardLib can use the official BLT auto-updates. I don't see the point of this.
Also the game launches much quicker without checking for updates, so I'm inclined to believe this mod might have an impact on loading times as well when and if a certain number of mods using it are installed by the user.

09-13-2017, 07:54 AM
@=TBM= BangL
@Takku
It cannot be done through another node in mod.txt, but I am thinking on a way to bypass making the invalid requests.
I do not see any reason why there cannot be 3 ways of updating. As for beardLib, as said below, your mod may not need it.
If someone puts link instead of uploading a file then this will not work, obviously, though the links usually are paydaymods links which means that the mod can update using BLT's normal system.

09-13-2017, 05:32 AM
@Schmuddel
Doesn't mean they can't use the official BLT update server.

09-13-2017, 12:56 AM
@BangL Most BLT mods don't use BeardLib.

09-12-2017, 11:16 PM
also... isnt an updater that uses modworkshop already implemented in beardlib?
do we really need 3 different ways of updating?

09-12-2017, 11:14 PM
reusing the "updates'' node causes the blt to send invalid requests to the blt update server.
couldnt atleast make it an own node that gets ignored by the blt?

09-12-2017, 11:13 PM
Why not use the BLT update server which is the standard for auto-updates? Why spam the BLT update server with invalid requests? Not to mention this won't even work if you put links instead of uploading a file here, I don't think. WTH is this?

09-09-2017, 07:55 PM
@❂ Beater | csgoatse.com 
@Schmuddel
I added a link to an example in the description. Change its version in mod.txt to see the script working.

09-09-2017, 07:47 PM
@❂ Beater | csgoatse.com 
No. Only one ID, since the script updates only one mod. If you have several mods then add the script to every mod. And every mod will have its special ID...

09-09-2017, 07:10 PM
Code:
local mwsID = '16986','someOtherID', 'anotherID'

like this ?

09-09-2017, 05:54 PM
@Schmuddel 
Yes, you are supposed to add it to your mod (and to your mod.txt).

09-09-2017, 05:45 PM
Is it supposed to not have a folder or mod.txt file?