Best of the Wurst 10

Status
Not open for further replies.
Level 23
Joined
Jan 1, 2009
Messages
1,614

Best of the Wurst 10

JPGrjzv.jpg


In March and early April, we rolled out the previously announced wurst.build configuration file improvements, allowing for further code-based map metadata customization, and also laying additional groundwork for the independent map generation pipeline we envisage for the future of wurst.

You can now make full use of the toolsuite from the command line with our new Grill package manager. Additionally, welcome DamageEvent to the standard library: a new damage detection and modification API, which supports and uses the new 1.29 natives.

Tooling

  • Upgrades to the wurst.build configuration workflow. You can now modify scenario data such as players, teams, and loading screens, all without opening the world-editor. See the Tutorial for more information.
  • The WurstSetup received a face lift, including auto-update, better async tasks, and complete CLI functionality for power users.
  • Objects and other allocations inside compiletime expressions are now retained for use during runtime.
  • Updated switch statement with joined cases, duplicate case detection, and control flow improvements.
  • Annotations must now be properly defined to not throw a warning.
  • Experimental support for @LeP's "hot code reload", which enables code modifications while the map is running.

Standard Library

We are very excited about having merged over a dozen pull requests and fixed plenty of bugs, thanks to many contributors! The highlights:

  • Added the new package DamageEvent for damage detection and modification, and deprecated the older DamageType package.
  • The timer used for ClosureTimer executions can now be customized, allowing for the creation of a timer dialog.
  • Package LastOrder has been cleaned up and fixed.
  • Package Printing can now be fully configured.
  • Package ClosureEvents now only listens to mouse events if those events are used.
  • Package OrderStringFactory no longer generates default unit order strings, so they can be distinguished in events.
  • Generalized damageTarget and isAliveTrick from unit to widget.
  • Added additional overloads for flashEffect.
  • Added shorthand .setDummyAbility() to make any ability castable by a dummy caster.
  • Added missing field definitions in UnitDefinition and AbilityDefinitionWindWalk .
  • DummyCaster dummy units can now be accessed via the dummy caster API.
  • Fixed nested indexing/deindexing in UnitIndexer.
  • Fixed counted callbacks not stopping properly in certain cases.
  • Fixed image.hideForPlayer, and improved image documentation.
  • Fixed TimedLoop instances being executed incorrectly and now permits destroying instances directly.

Website

  • Added further - and improved existing - standard library documentation pages.
  • We also recently rolled out a new tutorial on closures - be sure to check it out.
  • Webpage interface breadcrumbs for tutorial, stdlib, and blog posts now include all parents.
  • Our domain is now verified on GitHub. :cool:
e: Regarding the new LUA option, if it makes sense to use, we will add another backend.

>> Continue to Spotlight <<
 
Last edited:
Level 23
Joined
Jan 1, 2009
Messages
1,614

Spotlight

30baEQt.jpg


Introduction

If you have been using Wurst for some time, you most likely made use of the Wurst Setup tool to install WurstScript, generate your project, and update dependencies.
We started with a graphical solution first, to enable everyone to install and use wurst easily. Now that the Setup tool has matured, we are improving the command line interface for more advanced terminal users.

Note that all of these improvements are added to the existing setup, and if you don't want to make use of them, you don't have to!
The only breaking change here is the new command line argument syntax, which is now unified and more aligned with other package managers.
Running grill without any arguments will open the GUI (Wurst Setup) frontend, as before. Passing any argument will assume CLI usage.

Grill Wrapper

Since all additions are kept in the setup, we proudly present the grill wrapper for easy CLI usage of the setup tool on any system.

How do I get it ?

Simply use the setup tool UI to install or update your wurstscript installation. Everything new is shipped inside.

To make proper use of the grill command in shells system wide, you need to add the Wurst installation folder (~/.wurst) to your environment PATH variable.
How exactly this is done varies a lot depending on your platform - refer to this tutorial. On Windows 10, the final result should look like this:
8bFJJVT.jpg


Now you can use the grill commands. Emoji support depends on the particular terminal you are using.
FNSBYgD.jpg



Headless Execution

The main benefit to having a fully-featured command line interface is that you can run it on systems that have no display (headless).
This enables us to automate the wurst mapfile build process easily - for example in continuous integration, as described below.

Passing any command-line argument to grill ensures that no user interface will prompt the user.

The special wurstscript package

Use grill install wurstscript to install, or update an existing installation of, the WurstScript tools.
The installation will be the same as for the setup, inside your user's home folder ~/.wurst.


Generating a new project

grill generate <project_name> will create a new directory with your chosen name, and generate a new wurst project inside.
The generation includes an up-to-date copy of the default standard library dependency, and basic vscode project configuration metadata.

Importing an existing project

Unlike installing WurstScript or generating a project, the following commands are expected to be run from your project's root folder.

If you have an existing project, or want to contribute to someone else's project, you only need to install the project once after cloning/copying.
This fetches a local copy of any dependencies that the project requires.

Code:
$ git clone <git_repo_url>
$ cd <repo_name>
$ grill install

Package Management

grill is not a fully-fledged package manager, as it doesn't resolve transitive dependencies.
It mainly pulls a list of git repositories for you, and configures them for the wurst compilation.
Soon, we'll add support for dependencies on branch or commit ID.
The following commands must be executed from within a project's root folder.

Installing a new git dependency:
grill install <git_repo_url>

Removing a git dependency:
grill remove <git_repo_url>

Updating existing dependencies:
grill install

Continuous Integration

Simplified, CI is the process of automating the building and testing of your project on each version change (commit).
Popular git hosts such as bitbucket, gitlab, and github enable us to use CI with our wurst projects.
Arguably, the easiest way to do this is to use the docker-wurst image.

Wurst Docker Image

Docker provides mechanisms to containerize applications and systems into images, which can be run similarly to a virtual machine.
That machine then comes with all the tools and dependencies installed and preconfigured, so that you can immediately use grill from the command line.

$ docker run --rm -it frotty/wurstscript /bin/sh -c "grill help"

Travis CI example: wurstscript/WurstStdlib2

Circle CI example: island-troll-tribes/island-troll-tribes

That's it :thumbs_up: We hope you enjoyed the tenth entry in the BotW series.
 
Last edited:
Level 11
Joined
Mar 6, 2008
Messages
898
Thank you very much for the hard work on WurstScript!
I am looking forward into working with it. Kind of a bad timing with the long awaited patch 1.31 release and I feel sorry for you a bit for that. :S
Will WurstScript in its current version be compatible with patch 1.31?
When approx. can we expect Lua codegen support for WurstScript? I think it could change a ton of things there and might improve some APIs and replace dirty work arounds and make WurstScript even more a better choice to work with.

> Experimental support for @LeP's "hot code reload", which enables code modifications while the map is running.

How can I imagine this to be working?

Also how does the new damage detection system interferes with the new patch 1.31 blizzard API for exactly that?
 

LeP

LeP

Level 13
Joined
Feb 13, 2008
Messages
542
Thank you very much for the hard work on WurstScript!
I am looking forward into working with it. Kind of a bad timing with the long awaited patch 1.31 release and I feel sorry for you a bit for that. :S
Especially since the mods took their sweet time to approve this post.

Will WurstScript in its current version be compatible with patch 1.31?
When approx. can we expect Lua codegen support for WurstScript? I think it could change a ton of things there and might improve some APIs and replace dirty work arounds and make WurstScript even more a better choice to work with.
No reason for wurst to not be compatible. Normally wurst only supports fully released patches and not PTR. That being said, there is/will probably be work done to be ready once the full patch hits us.

> Experimental support for @LeP's "hot code reload", which enables code modifications while the map is running.

How can I imagine this to be working?
You can look at my thread where i explain it a bit
 
Level 23
Joined
Jan 1, 2009
Messages
1,614
I am primarily interested in the hot reload + grill support here.

Though I doubt I'll bother with grill until there are more packages in the spell section, might be convenient to be able to do "grill install x" rather than running around looking for 10 individual packages.
Glad the option exists already though.

Time to submit some wurst spells then :) grill doesn't resolve transitive dependencies though, so you would still need to enter multiple "grill install x" commands.

I am really happy to see a tutorial on closures. So far I haven't really understood what it is about so hopefully now I will be able to use it

:thumbs_up: Let me know if you have suggestions on how to improve the tutorial for beginners.
 

Deleted member 219079

D

Deleted member 219079

upload_2019-8-10_0-52-37.png

Hmm, it's a typo here so I so can't recommend Wurst
 
Status
Not open for further replies.
Top