Garry's Mod

Garry's Mod

评价数不足
How to fix 'addon too new to use old api' in Garry's Mod (For Creators)
由 Shaklin 制作
How to fix 'addon too new to use old api' in Garry's Mod (For Creators)
   
奖励
收藏
已收藏
取消收藏
For Creators
How to fix 'addon too new to use old api' in Garry's Mod (For Creators)

Short Answer:
Use gmad.exe (to convert your Addon-folder with all your files to a .gma file) and gmpublish.exe (to publish the .gma file to Steam Workshop).
You can find these tools in the Gmod Main/bin folder (\Steam\steamapps\common\GarrysMod\bin).

Long Answer / Tutorial:
1.
If you have your Addon-folder, you will need a addon.json file in it.
It should look like this:

{ "title" : "My awesome Addon", "type" : "model", "tags" : ["roleplay", "fun"], "ignore" : [ "*.psd", "*.vcproj", "*.svn*", "*.git*", "*.bat*" ] }

Change it like you want. This can help:
type: "ServerContent", "gamemode", "map", "weapon", "vehicle", "npc", "tool", "effects", "model"
tags: "fun", "roleplay", "scenic", "movie", "realism", "cartoon", "water", "comic", "build"
ignore: Ignore is what files (you can use the * as a wildcard to ignore file extensions - e.g. *.txt) you dont want gmad to compile for use in the resulting .gma file.

If you dont know how to create a .json file:
Rightclick in your Addon-folder on a free spot and select 'New > Text Document'. Rename it to addon.json.
You can open it then with Editor and editing it.

2.
Drag&Drop your Addon-Folder onto gmad.exe. You have then a .gma file. If not, then some files or the addon.json are not correct.

3.
Now its time to publishing it. If you doubleclick gmpublish.exe you can see how to use it.
You can use the cmd or you create a .bat file:
-Rightclick in the Main/bin folder on a free spot and select 'New > Text Document'
-Rename it, for example, to: gmpublish.bat
-Open the new created gmpublish.bat file with Editor. Now you can write the line, depends what you want:

If you want to upload a completely new Addon
gmpublish.exe create -icon path/to/image512x512.jpg -addon path/to/gma.gma
example: gmpublish.exe create -icon C:/myicons/thumbnail.jpg -addon C:/mygmafiles/myaddon.gma

Or if you want update an Addon
gma file + changing text:
gmpublish.exe update -id 1337 -addon path/to/gma.gma [-changes "fixed smthing"]
example: gmpublish.exe update -id 833253366 -addon C:/mygmafiles/myaddon.gma [-changes "I fixed something"]

gma file + thumbnail image + changing text:
gmpublish.exe update -id 1337 -addon path/to/gma.gma -icon path/to/image512x512.jpg [-changes "fixed something"]
example: gmpublish.exe update -id 833253366 -addon C:/mygmafiles/myaddon.gma -icon C:/myicons/thumbnail.jpg [-changes "fixed something"]

only thumbnail image update:
gmpublish.exe update -id 1337 -icon path/to/image512x512.jpg
example: gmpublish.exe update -id 833253366 -icon C:/myicons/thumbnail.jpg

If you dont know your Addon ID, then go to the steam workshop site with your browser. Click on your Addon. You can see now in the browser address bar your Addon id.
For example:
https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=833253366
the id is 833253366

-Save the gmpublish.bat file.
-Doubleclick on the gmpublish.bat and your Addon will be updated. Thats it :).


If you don't want the .bat file to close itself at the end (because you want to read what it's doing), then write after the line: pause
example:
gmpublish.exe update -id 833253366 -addon C:/mygmafiles/myaddon.gma [-changes "I fixed something"] pause

If it still not work and you still get the error 'addon too new to use old api', then unsubscribe your Addon and subscribe it again.
Maybe it is necessary to start the game briefly between unsubscribe and subscribe.
For Users
Thank you Umbree!

Install the addon and check its date. If the addon you wish to download is older than around 2017 or 2018. Then you want to check your legacy addon folder. which is found at:
?:\SteamLibrary\steamapps\common\GarrysMod\garrysmod\addons
it should be named to the workshop item and should have its addon iD on the end of it.
Find it and right click it > properties > opens with.. change > (Find the gmad.exe found in the bin folder of GMod) and then if it isn't already unpacking, double click it to open it up. You shouldn't need to mess with it anymore if its in already in the Legacy Addons folder.

But if its a rather new addon then you will have to go to a different folder to find it. And you will need its addon iD. To find the Addon iD you can go to the addons page and copy its url. Then paste it somewhere and find those numbers.
For instance; https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id= 3007508952
Once you have the numbers copied. Go to your drive that has Garry's Mod on it.
And go to ?:\SteamLibrary\steamapps\workshop\content you will find a bunch of folders with numbers on them. For this guide you are going to open up the 4000 folder. As this is GMod's game iD on steam.

once done you can look for the Addon iD you copied earlier. for a quicker route you can paste the iD into the explorer path by adding a \ then the iD. If all goes well you should be taken to a folder with a .gma file in it. and you can follow the last few steps in the legacy addon folder. regarding the right click it and properties. But you WILL have to move it to your addons legacy folder for GMod to recognize it.
If it is a .bin file. you will want to open GMod up and let the addon download properly.
8 条留言
Skeletonclown777™ 2023 年 11 月 12 日 上午 7:34 
its to much ahhhhhh:steamsad:
Tiny Baby 2023 年 10 月 12 日 上午 8:54 
too many steps :steamsad:
MrDuv 2023 年 10 月 1 日 上午 3:59 
bro its to hard
:steamsad:
Umbree 2023 年 7 月 25 日 下午 12:23 
once done you can look for the Addon iD you copied earlier. for a quicker route you can paste the iD into the explorer path by adding a \ then the iD. If all goes well you should be taken to a folder with a .gma file in it. and you can follow the last few steps in the legacy addon folder. regarding the right click it and properties. But you WILL have to move it to your addons legacy folder for GMod to recognize it.
If it is a .bin file. you will want to open GMod up and let the addon download properly.
Umbree 2023 年 7 月 25 日 下午 12:23 
But if its a rather new addon then you will have to go to a different folder to find it. And you will need its addon iD. To find the Addon iD you can go to the addons page and copy its url. Then paste it somewhere and find those numbers.
For instance; https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id= 3007508952
Once you have the numbers copied. Go to your drive that has Garry's Mod on it.
And go to ?:\SteamLibrary\steamapps\workshop\content you will find a bunch of folders with numbers on them. For this guide you are going to open up the 4000 folder. As this is GMod's game iD on steam.
(more on above comment)
Umbree 2023 年 7 月 25 日 下午 12:23 
[h1]For users;[/h1]
Install the addon and check its date. If the addon you wish to download is older than around 2017 or 2018. Then you want to check your legacy addon folder. which is found at;
?:\SteamLibrary\steamapps\common\GarrysMod\garrysmod\addons
it should be named to the workshop item and should have its addon iD on the end of it.
Find it and right click it > properties > opens with.. change > (Find the gmad.exe found in the bin folder of GMod) and then if it isn't already unpacking, double click it to open it up. You shouldn't need to mess with it anymore if its in already in the Legacy Addons folder.
Shaklin  [作者] 2023 年 5 月 11 日 上午 7:06 
@Teders123
I can't make instructions how to edit foreign addons.
If you're just doing this privately for yourself, then you can look for a gmadconv.exe. With this you can decompile the gmad file and then you can do it like in my tutorial.
teders 2023 年 5 月 11 日 上午 3:20 
I need "For users"