Uploading to the Workshop and Sharing - nZombies-Time/nZombies-Rezzurrection GitHub Wiki

Uploading a Config to the Workshop

The Steam Workshop doesn't allow .txt files to be uploaded to the Workshop, neither does it allow anything inside the /data/ folder. This guide will show you how you can get your config uploaded to the workshop in a way that will make the gamemode load it with the "Workshop" label.

Prerequisites

  • A config that works fully in-game (Be sure to test!)
  • A square image to work as a thumbnail
  • A navmesh file if the map doesn't already have or you edited it

1) Creating your addon folder

This is probably easy for many who has done it before. Basically you would just go to /garrysmod/addons and create a new folder by any name there.

The folder needs the following in the end:

  • Your config in youraddon/lua/nz
  • If you have an edited navmesh file, that file in youraddon/maps
  • An addon.json or addon.txt in the root folder of your addon /youraddon
  • If you have a mapscript, lua file in lua/nzmapscripts/map_name;ConfigName.lua

2) Converting your Config file

This only applies if your config file is not already a .lua file. nZombies saves configs as .txt, but as mentioned before, The Workshop doesn't allow these files. You can very easily convert it to a .lua file though. All you have to do is rename the file extension to .lua instead of .txt

Don't worry about the file type, the gamemode can read these just as well. In fact all official configs shipped with the gamemode are in .lua format. If you don't see the file extension, see this guide on how to turn them on, or this for Mac OSX.

3) Adding your Navmesh file (if applicable)

This only applies if your Config plays on a map that doesn't have a navmesh or it uses one that has been edited. You will need to grab this new .nav file from garrysmod/maps/mapname.nav and move it to youraddon/maps/mapname.nav.

The navmesh may conflict with other addons' navmesh files if they also have one for this map, so be sure to disable all addons that may do this before you play.

4) Uploading

This is the final required step. After fully packing your config file, your .nav file if you need it, and editing the addon.json/addon.txt to what you want, you now just have to compile the .gma and upload it to the workshop! See this official guide on how to create addons for The Workshop. If the first option is confusing, try this one here.

If you want to use the logo on your Workshop Thumbnail, you can get it with this link: http://i.imgur.com/DwMTMYj.png

5) Adding Workshop ID

(Optional)

To get the above result on your workshop config, you will need to add your Workshop ID to the config .lua file. The interface loads the data off of your Workshop Page by using a special box of data you can add. To do this, you must first have uploaded your config to the workshop. Then get the ID of your workshop item:

You need to put this at the end of your config file seperated by another semicolon:

Now recompile and update your addon with the newly changed config file name. Finally, all you need after this is to paste in the block of text below to your config's Workshop Page description and edit it to fit your config. Here is the template:

Config Data (used in the config loader):
[quote]{Config Name} = {
  "Description": "[Description]",
  "Map ID": "[Map ID]",
  "Creator": "[Your Name]",
"Pack Name": "[Name of pack]",
 "Used Packs": {
 "[Addon]": "[Addon ID]",
 "[Addon2]": "[Addon ID 2]",
 "[Addon3]": "[Addon ID 3]"
  },
"Note": "[Optional Note]"
}{end}[/quote]
  • Replace Config Name with the name of the config this info belongs to (Only the save name).
  • Replace [Description] with a short description of your config's setting.
  • Replace [Map ID] with the Workshop ID of the map (will become link in-game).
  • Replace [Your Name] with the name you wish to be listed under Creator.
  • Replace [Name of pack] with the name you wish to link to your workshop page.
  • Replace [AddonX] with the name of used addons or collections (such as weapons), and [Addon ID X] with the Workshop ID of that addon/collection. These will become links to the right. You can have as many as you want. The last one must not have a comma at the end!
  • Replace [Optional Note] with a note if you have one, otherwise completely remove the "Note": part

Commas, colons, curly brackets, and quotation marks are important. Make sure they are positioned correctly or it will fail loading the data.

You can find the official configs' data on the Content Pack's Workshop Page which can be used as examples.

Done!

If you've done it correctly, your addon should now be on The Workshop, and you can add more pictures and a description to it if you want. If done correctly, the map should also appear in-game in your Load Config interface with the label "Workshop" under the map status.