setting_up_an_addon
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| setting_up_an_addon [2023/07/31 03:03] – antigravities | setting_up_an_addon [2026/05/01 23:28] (current) – frank_lee_smith | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== About Addons ====== | + | coming soon when facepunch |
| - | + | ||
| - | Addons are additional s&box content packs loadable in the context of a game. In this tutorial, we'll create an addon for Trouble of Terrorist Town so you can add code that changes the behavior of the game - whether it be custom weapons, custom roles, or something else entirely. | + | |
| - | + | ||
| - | ====== If we're making an addon, let's get started! ====== | + | |
| - | + | ||
| - | Before creating an addon, you'll need: | + | |
| - | + | ||
| - | - **At least some knowledge of C#.** s&box and the game's addons are written in C#. C# tutorials are available at the [[https:// | + | |
| - | - **A copy of the game redeemed to your Steam account and installed.** | + | |
| - | - **Your favorite IDE set up.** Full-fat Visual Studio is usually the preference here as it provides the best Intellisense and the most features, but you can also use Visual Studio Code (if you hate yourself) or JetBrains Rider. Instructions on setting up your IDE with s&box are available on the [[https:// | + | |
| - | + | ||
| - | ===== Open the game in tools mode ===== | + | |
| - | + | ||
| - | By default, Steam will prompt you to select which mode to launch s&box in when you start the game from your Library. If Steam does not prompt you to start in "Game Editor" | + | |
| - | + | ||
| - | - Right click s&box in your Steam library, and then click **Properties**. {{ : | + | |
| - | - Under **General**, | + | |
| - | - Now, you'll be able to click Play as normal and see **Launch Game Editor**. {{ : | + | |
| - | + | ||
| - | ===== Creating your addon ===== | + | |
| - | + | ||
| - | Once you have tools mode open and can see the Welcome screen, you can create your first addon. | + | |
| - | + | ||
| - | - Click **Content Mode** at the top left of the screen. {{ : | + | |
| - | - You'll now see the game's normal menu screen with a bunch of information panels around it. For more information about what these panels are and what they' | + | |
| - | - Select **Addon** at the top left of the top left of the screen that pops up, and fill out the information that is asked for. {{ : | + | |
| - | - The **Title** is a user-visible title for your addon. For example, you might want to call this "My Cool Overpowered Gun (TTT)" | + | |
| - | - The **Ident** is a machine-visible title for your addon. For example, you might want to put " | + | |
| - | - The **Location** is where your addon' | + | |
| - | - The **Create .gitignore** option controls whether a file for used with the [[https:// | + | |
| - | - Click **Create**. Your new project will show up on the left in the **Projects** pane. In order to your addon work with TTT, we'll need to make a quick change - first, right click the addon in the Projects pane and then click **Project Settings...** | + | |
| - | - Under the **Project Setup** menu, under the **Target Game** option, click the folder icon, and then click **From asset.party** to pick an addon from asset.party. | + | |
| - | - Find **Trouble in Terrorist Town! (TTT)** by **Three Thieves** in the menu. You may need to search for it. Then select it and click **OK**. This will select **Trouble in Terrorist Town! (TTT)** as the Target Game. {{ : | + | |
| - | - Click **Save** and close the window - your addon is now set up for TTT. Finally, we'll set up a **Launch Configuration** to make loading the game with your addon easy. | + | |
| - | - Above the game menu, at the top left, you'll see a dropdown next to a Play button, Stop button, and a Menu button. Click it and select **Edit Launch Configurations** to add a launch configuration for your addon. {{ : | + | |
| - | - On the left, at the bottom, click **Create New Config**. Then fill out the form as follows: {{ : | + | |
| - | - The **Configuration Name** field controls what the configuration is titled in your editor. | + | |
| - | - The **Game** field controls what game this launch configuration is for. Click the folder icon to the right of the dropdown, then click **From asset.party**. Find **Trouble in Terrorist Town! (TTT)** by **Three Thieves** in the menu. You may need to search for it. Then select it and click **OK**. This will select **Trouble in Terrorist Town! (TTT)** as the Game. | + | |
| - | - The **Map** field controls what map is loaded when running this launch configuration. Popular maps for debugging include **dev/ | + | |
| - | - The **Maximum Players** field controls the number of players that can join games launched with this launch configuration. It is recommended to set this to at least 8, so that bots are allowed to join the game (they consume player slots like real players). | + | |
| - | - The **Pre Launch Command** allows you to specify concommands to run before launching the game. We can leave this blank for now. | + | |
| - | - The **Post Launch Command** allows you to specify concommands to run after launching the game. You may want to disable the **automoderator** and **idle spectator timeout** - you can do this by entering '' | + | |
| - | - The **Addons** field controls which addons | + | |
| - | - Click **Save** and close - now we're ready to launch the game and start coding! Select the launch configuration you just created from the dropdown and then click the **Play** button. The game will load and your addon will be enabled! | + | |
| - | + | ||
| - | ====== Writing your addon' | + | |
| - | + | ||
| - | You can open the addon in your preferred code editor by right clicking it in the Projects pane. From there, you'll be able to create C# files and write code as usual. | + | |
| - | + | ||
| - | Two things that you might want to do (but anything is possible in theory): | + | |
| - | + | ||
| - | * [[custom_weaponry|Add custom weapons to the game]] | + | |
| - | * [[custom_teams_and_roles|Add custom teams and roles to the game]] | + | |
| - | + | ||
| - | When you save your code, s&box will **automagically** compile it and load it in the game. With a few exceptions, your changes will be visible **immediately**. | + | |
| - | + | ||
| - | ====== Publishing your addon to asset.party ====== | + | |
| - | + | ||
| - | Once you've finished writing and testing your code, you can upload it to asset.party in order to allow players to select it when creating a lobby or dedicated server. | + | |
| - | + | ||
| - | - Right click your project in the Project Settings pane, and then click **Project Settings** to open the project settings menu. | + | |
| - | - Select **Upload To Asset Party** in the menu on the left. | + | |
| - | - Confirm your ident as created earlier in this guide, and select the organization you want to publish it under. If you haven' | + | |
| - | - Confirm that all of the files that you want to upload show in this screen, then click **Upload Files**. | + | |
| - | - Provide a change title and optional description, | + | |
| - | - Congratulations, | + | |
setting_up_an_addon.txt · Last modified: 2026/05/01 23:28 by frank_lee_smith