S&box Wiki

Revision Difference

Your_First_Project#548618

<cat>Dev.Projects</cat> <title>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. ##Visual Studio 2022 An IDE you're comfortable with is a must. We suggest [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/). Follow [this guide](https://docs.microsoft.com/en-us/visualstudio/install/install-visual-studio?view=vs-2022) to help you get set up for C# development. #S&box Game Editor Next up, start the S&box **Game Editor** through steam: Next up, start the S&box **Game Editor** through Steam: <upload src="b3249/8daf3c5996c1760.png" size="34192" name="image.png" /> <upload src="b3249/8daf3c5c4ff7cc1.png" size="10113" name="image.png" /> Chances are, you'll be opening this most of the time, so you'd better get into the habit now. ##Creating a Project Don't get overwhelmed. There's lots to look at here, but we can work our way through it. <note> <key>TODO: Familiarising yourself with the Game Editor</key> Here would be a great place to introduce new developers to the different sections and tools inside of the editor. </note> 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 Navigate to your project's location on your PC <upload src="b3249/8daf3c7ed9e46b5.png" size="74321" name="image.png" /> Open the folder with **Visual Studio** <upload src="b3249/8daf3c84ee9e201.png" size="26509" name="image.png" /> 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. Your new Gamemode's code can be found inside the `code` folder, on the right side of your screen by default. <upload src="b3249/8daf48134240e73.png" size="172908" name="image.png" /> <upload src="b3249/8daf3c902065e3d.png" size="8112" name="image.png" /> If you don't see this panel, click on this tab on the right: <upload src="b3249/8daf3ca28e67db7.png" size="3387" 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>