Tutorials Packaging Trakpak3 - MagnumMacKivler/trakpak3 GitHub Wiki
Packaging Trakpak3 With Your Map
Fortunately, including the core of Trakpak3 (the officially-uploaded content) is as easy as listing Trakpak3's Workshop Addon as a Required Addon. For including other things, like custom models or materials or map-specific lua (like the files needed to run the signals), you will have to include copies of the files in the addon itself.
The Legacy Addon
Gmod, like any source game, has the ability to mount content (maps, materials, models, etc) directly from the "game" folder, which is GarrysMod/garrysmod/
. However, for developing maps, it's recommended that you create a Legacy Addon instead.
To do that, go into garrysmod/addons/
and create a new folder, and name it after your map. This will be known as the Legacy Addon Folder. Note that the name doesn't have to match the map name exactly, but it's a good idea to make the name descriptive.
For the purposes of this tutorial, we'll be using an example map called gm_example.bsp
, so you should be making a folder called garrysmod/addons/gm_example/
.
Signals, Dispatch Boards, Nodes, Etc.
Trakpak3's in-game tools like SigEdit, the Dispatch Board Editor, and Node Edit Tools create .txt files within the data/
folder that must be converted into .lua files and moved into subfolders of addons/gm_example/lua/trakpak3/
.
Dispatch Boards
data/trakpak3/dispatch/gm_example.txt
to addons/gm_example/lua/trakpak3/dispatch/gm_example.lua
Track Node Map
data/trakpak3/nodes/gm_example.txt
to addons/gm_example/lua/trakpak3/nodes/gm_example.lua
Signal Systems
data/trakpak3/signalsystems/my_signal_system.txt
to addons/gm_example/lua/trakpak3/signalsystems/gm_example/my_signal_system.lua
.
Note that for signal systems, the subfolder that my_signal_system.lua
is placed into MUST match the name of your map!
You've probably already done the above three steps (if your map has nodes, signals, and a dispatch board) because you wouldn't be able to test your map properly if you didn't.
Custom Models, Materials, Sounds, Etc.
If in the course of making a map you find that you want additional track not provided in stock Trakpak3, or a custom texture or model or anything else you can use in a map, you must package those assets with your map as well.
The easiest way to do this is to simply create maps/
, models/
, materials/
, sound/
etc. folders inside your legacy addon and place the content into those.
Packing content into the BSP itself is also an option, but it requires an external program, it's not required, and keeping them in folders instead is a much cleaner, nicer way to do it.
Once you're ready to publish the map
-
Create a workshop folder somewhere if you haven't already. I keep mine on the desktop, but you can put yours wherever you want as long as you know where to find it again.
-
Copy the entire legacy addon from your gmod
addons/
folder into theworkshop/
folder.