WurstScript and its related tools require Java to run. Please install or verify your installation.
Download the Java Runtime appropriate for your system and follow the installation procedure.
Once finished, continue to the next step.
Many tasks rely on a environment variable called JAVA_HOME which might not have been set by the installer. To verify your installation, open a command prompt and enter java -version
.
A valid installation will return something like this:
> java -version
java version "1.8.0_131"
Make sure your minor version 1.8.0_xxx
(xxx) is higher than 101 to avoid any certificate issues. If it is lower, make sure to update your Java installation, otherwise your connection will be insecure.
If you get an error or get a lower versions displayed, even though you installed a newer one, your JAVA_HOME is either missing or configured wrong.
Refer to this Windows tutorial in order to setup your JAVA_HOME correctly.
Once you have setup Java correctly, continue by installing VSCode.
VSCode is a free, open source, cross platform code editor. WurstScript support is provided through a VSCode extension.
Download and install VSCode on your system.
Once finished, open VSCode and continue to the next step
Press F1 to open the VSCode command prompt and run the task >Install Extensions:
In the panel that opened on the left, type Wurst into the search bar and press enter. Install the Wurst language support extension.
Reload the window to activate the extension.
Packaged with the Wurst extension are two other extensions, YAML and vscode-icons.
You can minimize VSCode now and continue with the next steps.
Now we will setup a Wurst compiler environment and create a project using the the Wurst Setup.
The Wurstsetup can be used from either the commandline or a graphical application.
To use the setup from the commandline you need to complete the initial installation once. After that you can make use of the setup via the grill
executable.
For the first time you have to run the .jar file directly, because the executable hasn’t been installed yet.
java -jar WurstSetup.jar install wurstscript
Now you need to add the ~/.wurst
folder to your PATH environment variable, so you can use it from the commandline. Refer to this tutorial. On Windows 10, the result should look like this:
The grill
command should now be recognized by your terminal of choice.
If not, a restart might be required.
If you prefer not using the commandline, simply running the setup without any arguments will open the graphical user interface (double-click).
Use the special wurstscript
keyword to install or update wurst on your system for the current user.
grill install wurstscript
To install or update the compiler simply click the Install Wurst button. When everything is done, the setup should tell you that your installation is up to date and the Create Project button is now enabled:
Use generate
to create new projects. The project will be generated in a folder inside your current location with the name provided.
grill generate myProjectName
Now that the compiler is installed you can go ahead and create your Wurst project. Select your desired project folder and name and start the process by clicking the Create Project button. The setup will now create a wurst project structure and download the necessary dependencies. If everything setup correctly, you should see the following message:
After you finished installation and project setup, you can open the project’s root folder in VSCode.
File -> Open Folder
Once the project is opened, you can click the Hello.wurst file on the left to activate the Wurst plugin. The code should compile and the setup should be done. Using VSCode’s command console (F1
) you can execute wurst commands such as running or building your map.
If you are new to WurstScript but not new to programming, you probably want to continue with the Beginner’s Guide
If you want to import someone else’s project or work on a different machine, you need to setup the project with local configuration and pull dependencies first.
Navigate to the project’s root and run install
to update dependencies and configuration of the wurst project.
grill install
By clicking the import button you can load an existing wurst.build file. After a successful load clicking the Update Project
button will update your dependencies and generate local files as necessary.