S&box Wiki

Revision Difference

Games/GettingStarted#560960

<cat>Dev.Projects</cat> <title>Creating a Game Project</title> # A New Game Project When you first boot up the s&box editor you'll be greeted with the Welcome screen. <upload src="b3ffd/8db87a6ad738324.png" size="74489" name="image.png" /> The first step is to create a [Game Project](GameProject). You can do this by clicking "New Game Project..." in the top right. <upload src="b3ffd/8db83a335dd501b.png" size="5963" name="image.png" /> You'll be presented with `Create New Game` window, choose a template. Pick a name for your project and choose where you'd like to store it. <upload src="b3ffd/8db83a34b73fabd.png" size="33295" name="image.png" />⤶ ⤶ # Editing The Code⤶ ⤶ To open the solution in Visual Studio, go to `File > Open Solution` in the S&box Editor. The solution will contain a project containing your game's code, but will also include projects containing common code for the game and editor. You might wish to right click your game's project in the `Solution Explorer` and choose `Scope To This` to isolate just your project.⤶ ⤶ <note>Any changes you make to the code will be applied on save. The game will compile and hotload the new assemblies. You don't need to compile in Visual Studio.⤶ ⤶ This works flawlessly 99% of the time, but if you've changed something that we can't hotload you might have to restart the game.⤶ </note>⤶ ⤶ For the most part the templates are designed to act like tutorials. They are heavily documented to help explain what's going on. ⤶ ⤶ # Testing⤶ ⤶ If you want to test your multiplayer game, you don't have to publish it. If you start a server, people will download everything they need from you. You can test networking entirely by yourself by clicking `Join via new instance` under the `WiFi` icon next to the play button.⤶ ⤶ <upload src="b4aa4/8dc34a94f562829.png" size="4140" name="image.png" />⤶ ⤶ If you edit code, the code changes will be sent to them as you make changes. If you edit UI and stylesheets, they will be synchronized to other players too.⤶ ⤶ <warning>Downloading assets in this way is currently broken. To test your game you must upload it first and the other client will download the assets from asset party, even if marked as private.</warning>⤶ ⤶ # Publishing⤶ ⤶ To publish your game, under the edit drop down click `Publish Project..` and follow the instructions. ⤶ ⤶ <upload src="b4aa4/8dc34a9a86a2f14.png" size="3352" name="image.png" />⤶ ⤶ To make your game public for anyone to play, click the button at the end of setup that says `View and Edit on Web`, then change `Publish State` to `Released`, it should look like this.⤶ ⤶ <upload src="b4aa4/8dc34aa0d4aa36a.png" size="19395" name="image.png" /> <upload src="b3ffd/8db83a34b73fabd.png" size="33295" name="image.png" />