3. Setting Up ExtendedSharp In VisualStudio Code - skyewontmiss/ExtendedCharts-For-CSharp GitHub Wiki

Well, well, well. You finally joined the C# side. Thank you!

You will need a few things to complete this part of the tutorial! It's mainly downloading a ton of shit to make the process easier.

Setting up Visual Studio Code + C#

  1. Download Visual Studio Code and set it up - This is for writing your code. You can use just Visual Studio, although I found it much easier to run the Builder in VSC than VS.
  2. Download the 'C#' Extension inside VisualStudio Code. To do so, go to the sidebar, click 'Extensions' (or use the shortcut Ctrl+ Shift + X):

image

And search for 'C#' in the search bar. Click C#, NOT the C# Dev Kit.

image

Next, click 'Install', obviously... and wait for it to finish installing.

image

Setting Up CodeRunner and .Net

By the way, if you want, Here's a guide by Microsoft that explains setting this up, better than I can.

Now, for the scripts to be able to be run seamlessly from VisualStudio Code, we need the CodeRunner extension. Search 'Code Runner' in the search bar, and click the one by 'Jun Han', or one that looks like this:

image

and install it. After that, go and download .Net SDK. Oh, and .Net 7.0 will do quite enough here. image

Click on the installation executable, and follow the instructions in the executable.

When done, restart VisualStudio Code. On the sidebar, click 'Manage':

image

Then 'Settings'...

image

Now, in the search bar, type 'Executor Map', and click 'Edit in settings.json':

image

In here, search for CSharp in the .json, and you should notice that it says something like 'scriptcs'. ScriptCS requires Chocolatey, and Powershell to be installed. But frankly, this didn't work for me, so this next step is the next big thing.

In here... change 'scriptcs'...

image

To 'dotnet run'...

image

This will physically build the project and run the code. It works, granted it will be about 10 seconds slower, but it gets the job done.

Setting up the 'ExtendedSharp' Class Library in VisualStudio Code

Go to the ExtendedCharts For CSharp page, and click these:

image image image

Now, you should have a .zip on your computer called 'ExtendedCharts For CSharp', and extract it. You should now have these files in a directory: image

And double-click this:

image

Now, copy this folder with Ctrl+C on Windows, or your equivalent on other platforms:

image

And copy it to your map folder. This is where your game is installed, plus the Poly Beats_Data folder, the StreamingAssets folder, the Custom Maps folder, then the map folder. It could look something like this: C:\Users\Your Windows Username\Documents\Games\Poly Beats\Poly Beats_Data\StreamingAssets\Custom Maps\This Is The Map Folder's Name

Now, put your template in this folder, like so:

image

You can now rename this folder anything you want! I named it 'A Drowning Chart', for the sake of just making the occasional wordplay joke here.

Linking the ExtendedCharts file with the Map

This is incredibly important. Right-Click in an empty space inside the map folder, then Click 'Open With Code' in the folder (may be missing if you didn't add 'Include in Context Menus' when setting it up), or use the Directory navigator within Code, like so:

'Open With Code'

image

image

'Directory Navigator'

image

image image

Now, after opening, you should be able to view all the files inside the File Explorer here...

image

Oh, before I forget: Please DO NOT DELETE the 'obj' folder, as this contains dependencies that the C# script needs to function (like Newtonsoft.Json).

Okay, cool. Now click the C# file. VisualStudio Code should look like this if everything is done correctly:

image

Alright! Now that the arguably hardest part is out of the way, let's set up some things.

Setting up the '.extendedcharts' file

Replace the 'ChartMapFolder' variable with the actual path to your Map Folder:

image

image

You may see some squiggly red lines. This is because C# does not support backward slashes, so you will need to change these to forward slashes, like so:

image

After this, go to the 'ChartName' variable, and rename the first part before the extension of '.extendedcharts', to whatever you like. I want to change it to 'The Chart', so, I'm going to do this:

image

image

After this, go to the .info of the difficulty you want to have the chart applied to, which in my case is Limitless:

image

Scroll horizontally until you see 'ExtendedChartsFile':

image

If it is 'InfiniteEndpoints', change it to the name you set in the 'ChartName' variable earlier:

image

We're good now. If you head back to the C# file, you should find a section that looks a bit like this:

image

This is where your code goes. (The bit below it is the Compiler, but we don't need to go into detail about that one.)

Alright! Now we're officially ready, let me try to explain to you how to use ExtendedSharp as well as I can.