S&box Wiki

Revision Difference

Your_First_Project#551155

<cat>Dev.Projects</cat>⤶ <title>Getting Started - Your First Project</title>⤶ ⤶ <note>⤶ <key>WORK IN PROGRESS</key>⤶ ⤶ This page is a work in progress - contributions are encouraged! See notes for details.⤶ ⤶ This is supposed to be a beginner-friendly walkthrough, as a lot of the content here assumes prior knowledge.⤶ </note>⤶ ⤶ #Welcome to s&box!⤶ ⤶ Formalities over; it's time you started doing something with this opportunity! Roll up those sleeves and get knuckle deep in the mosh pit.⤶ ⤶ ## Choosing the right IDE⤶ ⤶ ###Visual Studio 2022⤶ ⤶ An IDE you're comfortable with is a must. We suggest [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/) as the Community Edition is free and you can open your code base inside s&box right away.⤶ <upload src="b3cb9/8db0552a67b41fd.png" size="5967" name="image.png" />⤶ ⤶ Follow this [external guide](https://docs.microsoft.com/en-us/visualstudio/install/install-visual-studio?view=vs-2022) to help you get set up for C# development.⤶ ⤶ Also, check out [Setting up Visual Studio](https://wiki.facepunch.com/sbox/Setting_up_Visual_Studio) to get your Visual Studio set up for s&box.⤶ ⤶ ### JetBrains Rider⤶ ⤶ This is a commercial product, depending on your workflow this might be your preferred choice.⤶ ⤶ See here, how to get started with [Jetbrains Rider](https://wiki.facepunch.com/sbox/Setting_up_Rider)⤶ ⤶ ### Visual Studio Code⤶ ⤶ This might be your preference if you have a weaker system or if you want a simple editor.⤶ ⤶ See here, how to get started with [Visual Studio Code](https://wiki.facepunch.com/sbox/Setting_up_VSCode)⤶ ⤶ #s&box Game Editor⤶ ⤶ Next up, start the s&box **Game Editor** through Steam.⤶ ⤶ <upload src="b3249/8daf3c5996c1760.png" size="34192" name="image.png" />⤶ <upload src="4a1b3/8db6d91884acdc7.png" size="76308" name="sbox_launch.png" />⤶ ⤶ ## Adjusting the Launch Settings⤶ ⤶ Chances are, you'll be opening this most of the time. If you wish, you can enforce to start the **Game Editor** by default.⤶ ⤶ 1. View the properties of S&box⤶ <upload src="b3cb9/8db0555a5b1d569.png" size="21013" name="steam_5LSW87SWxe.png" />⤶ ⤶ 2. Set the Options⤶ <upload src="b3cb9/8db05544b2a64d4.png" size="118762" name="image.png" />⤶ ⤶ Alternatively, select "Always use this option" when starting the Editor for the next time.⤶ ⤶ ⤶ ##Creating a Project⤶ ⤶ Don't get overwhelmed. There's lots to look at here, but we can work our way through it. You can check out the <page>Editor</page> overview for more information about the different sections of the editor.⤶ ⤶ ⤶ First things first, create a project.⤶ ⤶ <upload src="b3249/8daf3c7131e0dd5.png" size="25922" name="image.png" />⤶ <upload src="b3249/8daf3c734b69ac9.png" size="16604" name="image.png" />⤶ Leave the **Project Type** for this one as **Game**. Fill in the **Project Title** and then hit **OK**.⤶ ⤶ ##Opening your project in Visual Studio⤶ ⤶ Head back to Steam, and open S&box's local files.⤶ <upload src="b3249/8daf48067e017f0.png" size="40415" name="image.png" />⤶ ⤶ Then, open up **s&box.sln**⤶ <upload src="b3249/8daf48089817f43.png" size="9818" name="image.png" />⤶ ⤶ Any projects loaded in the S&box **Game Editor** will appear in this solution.⤶ ⤶ Just find **your_fantastic_gamemode** inside of the **Games** folder. This will appear under the **Solution Explorer** panel, on the right side of your screen by default.⤶ <upload src="b3249/8daf480d93f4181.png" size="6537" name="image.png" />⤶ ⤶ If you don't see this panel, try clicking on this tab on the right:⤶ <upload src="b3249/8daf3ca28e67db7.png" size="3387" name="image.png" />⤶ ⤶ ##Editing the Code⤶ ⤶ If you don't know what you're looking at now, you're in for a ride and a half.⤶ ⤶ <upload src="b3249/8daf48134240e73.png" size="172908" name="image.png" />⤶ ⤶ Get creative! Check out our picks of <page>CSharp Learning Resources</page> to help get you started.⤶ ⤶ S&box will automatically compile your gamemode whenever you **Save** (<key>CTRL</key> + <key>S</key>).⤶ ⤶ <note>⤶ <key>TODO: TESTING YOUR GAMEMODE</key>⤶ ⤶ Here would be a great place to demonstrate how to playtest your code edits ingame through the Game Editor⤶ </note>⤶ ⤶ ##Uploading your new Gamemode⤶ ⤶ Check out the <page>CreatingProjects</page> page.⤶ ⤶ <note>⤶ <key>WORK IN PROGRESS</key>⤶ ⤶ This page is a work in progress - contributions are encouraged! See notes for details.⤶ ⤶ This is supposed to be a beginner-friendly walkthrough, as a lot of the content here assumes prior knowledge.⤶ </note>