|
1 | 1 | --- |
2 | 2 | title: Installation |
3 | | -excerpt: Install WurstScript and setup your first project. |
4 | | -date: 2024-02-08 |
| 3 | +excerpt: Install WurstScript and set up your first project. |
| 4 | +date: 2025-12-08 |
5 | 5 | icon: |
6 | | - type: fa |
7 | | - name: fa-paper-plane |
| 6 | + type: fa |
| 7 | + name: fa-paper-plane |
8 | 8 | color: green |
9 | | ---- |
| 9 | +------------ |
10 | 10 |
|
11 | | -WurstScript is a programming language and modding toolkit working in unison to create awesome Warcraft 3 maps. |
12 | | -In this guide we will show you how to install WurstScript and set up your first project. |
| 11 | +WurstScript is a programming language and modding toolkit working in unison to create Warcraft 3 maps. |
| 12 | +This guide explains the streamlined setup using the updated VSCode extension, which now manages compiler updates and the CLI automatically. |
13 | 13 |
|
14 | 14 | ## Prerequisites |
15 | 15 |
|
16 | | -WurstScript and its related tools require Java 11+ to run. Editor support is provided via a VSCode extension. |
17 | | - |
18 | | -### Java |
19 | | - |
20 | | -[_ _{: .fa .fa-download} Download Java from Adoptium](https://adoptium.net/?variant=openjdk11){: .btn .btn-orange} |
21 | | - |
22 | | -Download the Java Runtime appropriate for your system and follow the installation procedure. |
| 16 | +WurstScript editor support is provided via the VSCode extension. |
| 17 | +The extension now **downloads, installs, and updates both the compiler and the CLI (`grill`) automatically**, requiring no manual setup for most users. |
23 | 18 |
|
24 | 19 | ### VSCode |
25 | 20 |
|
26 | | -[_ _{: .fa .fa-download} Download VSCode](https://code.visualstudio.com/){: .btn .btn-primary} |
| 21 | +[* *{: .fa .fa-download} Download VSCode](https://code.visualstudio.com/){: .btn .btn-primary} |
27 | 22 |
|
28 | 23 | ### Wurst Extension |
29 | 24 |
|
30 | | -Install the VScode [Wurst language support extension](https://marketplace.visualstudio.com/items?itemName=peterzeller.wurst). |
| 25 | +Install the VSCode [Wurst language support extension](https://marketplace.visualstudio.com/items?itemName=peterzeller.wurst). |
| 26 | + |
| 27 | +## Activate the Extension |
31 | 28 |
|
32 | | -## Install Wurstscript |
| 29 | +After installation, open a Wurst project or any `.wurst` file. |
| 30 | +The extension initializes itself and installs all required components. |
| 31 | +You can also trigger setup manually via the command palette (F1): |
33 | 32 |
|
34 | | -Now we will setup a Wurst compiler environment and create a project using the the WurstSetup, also known as `grill`. |
| 33 | +* `>wurst: Install` |
| 34 | +* `>wurst: New Wurst Project` |
35 | 35 |
|
36 | | -[_ _{: .fa .fa-download} Download WurstSetup](https://grill.wurstlang.org/hudson/job/WurstSetup/lastSuccessfulBuild/artifact/downloads/WurstSetup.jar){: .btn .btn-green} |
| 36 | +Once activated, the extension will keep your compiler up-to-date in the background. |
37 | 37 |
|
38 | | -Download WurstSetup and perform installation by running `java -jar WurstSetup.jar install wurstscript` or double-clicking to start the graphical user interface. |
| 38 | +## Creating and Working With Projects |
39 | 39 |
|
40 | | -Now you need to add the `~/.wurst` folder to your PATH environment variable, so that `grill` is recognized from the commandline. |
41 | | -Refer to this [tutorial](https://www.java.com/en/download/help/path.xml). |
| 40 | +The extension ships with `grill`, which it installs for you. |
| 41 | +Add the `~/.wurst` folder to your PATH so the `grill` command is available everywhere. |
| 42 | +See this guide: [https://www.java.com/en/download/help/path.xml](https://www.java.com/en/download/help/path.xml) |
42 | 43 |
|
43 | | -## Commandline Usage |
| 44 | +For regular users, the only grill command you normally need is: |
44 | 45 |
|
45 | | -Using `grill` from the commandline you can now start with generating a new project or installing an existing project. The user experience is similar to tools such as `npm`, `mvn`. etc. |
| 46 | +### Install project dependencies |
46 | 47 |
|
47 | | -### Updating the Compiler |
| 48 | +Run inside your project root: |
48 | 49 |
|
49 | | -Use the special `wurstscript` keyword to install or update wurst on your system for the current user. |
| 50 | +``` |
| 51 | +grill install |
| 52 | +``` |
50 | 53 |
|
51 | | -`grill install wurstscript` |
| 54 | +This sets up dependencies for a new project or updates an existing one. |
52 | 55 |
|
53 | | -### Create a new Wurst Project |
| 56 | +### Add a new dependency |
54 | 57 |
|
55 | | -Use `generate` to create new projects. The project will be generated in a folder inside your current location with the name provided. |
| 58 | +``` |
| 59 | +grill install https://github.com/Frotty/wurst-astar-jps |
| 60 | +``` |
56 | 61 |
|
57 | | -`grill generate my-wurst-project` |
| 62 | +This adds the dependency to your project and updates it. |
58 | 63 |
|
59 | | -### Open in VSCode |
| 64 | +### Opening a project |
60 | 65 |
|
61 | | -After you finished installation and project setup, you can open the project's root folder in VSCode. |
| 66 | +Open the project’s root folder in VSCode: |
62 | 67 |
|
63 | | -`code my-wurst-project` |
| 68 | +``` |
| 69 | +code my-wurst-project |
| 70 | +``` |
64 | 71 |
|
65 | 72 | {: .answer} |
66 | | -_ _{: .fa .fa-exclamation-circle} Make sure you are opening the project's root folder (contains wurst.build file) using `File -> Open Folder` |
| 73 | +* *{: .fa .fa-exclamation-circle} Open the folder containing your `wurst.build` file. |
| 74 | + |
| 75 | +After opening the project, selecting a `.wurst` file will activate the language server. |
| 76 | +Compilation, map building, and other workflows are available directly through VSCode commands (`F1` → search for “wurst”). |
67 | 77 |
|
68 | | -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. |
| 78 | +--- |
| 79 | + |
| 80 | +## Optional: CLI Usage for Non-VSCode Users |
69 | 81 |
|
70 | | -If you are new to WurstScript but not new to programming, you probably want to continue with the [_ _{: .fa .fa-external-link-square} Beginner's Guide](tutorials/wurstbeginner.html) |
| 82 | +If you prefer using WurstScript without VSCode, or you want full manual control, you can enable standalone CLI usage. |
71 | 83 |
|
72 | | -### Installing and Updating a project |
| 84 | +### Create a new project (CLI-only) |
73 | 85 |
|
74 | | -Run the `install` command to update your project's dependencies, or to initially setup a fresly cloned project to work on your machine. |
| 86 | +``` |
| 87 | +grill generate my-wurst-project |
| 88 | +``` |
75 | 89 |
|
76 | | -`grill install` |
| 90 | +### Update the compiler manually |
77 | 91 |
|
78 | | -### Adding dependencies |
| 92 | +``` |
| 93 | +grill install wurstscript |
| 94 | +``` |
79 | 95 |
|
80 | | -To add a new dependency, run the `install` command with a second parameter that points to a git repo. |
| 96 | +This is no longer required when using VSCode, as the extension manages compiler updates automatically. |
81 | 97 |
|
82 | | -`grill install https://github.com/Frotty/wurst-astar-jps` |
| 98 | +--- |
83 | 99 |
|
84 | 100 | ## Graphical User Interface |
85 | 101 |
|
86 | | -By running the `WurstSetup.jar` without any arguments or simply by double-clicking, you can alternatively use the deprecated, graphical user interface. |
| 102 | +> Deprecated |
| 103 | +
|
| 104 | +Running `WurstSetup.jar` without arguments opens the legacy GUI installer. |
| 105 | +This workflow is no longer recommended. |
| 106 | + |
| 107 | +--- |
87 | 108 |
|
| 109 | +If you are new to WurstScript but not new to programming, continue with the |
| 110 | +[* *{: .fa .fa-external-link-square} Beginner's Guide](tutorials/wurstbeginner.html). |
0 commit comments