Skip to content

Upgrade Your Quest from Solarus 2.0 to Solarus 2.1

The 2.1 version of Solarus adds a new concept of Audio Contexts which allows game developers to decide "where" to play sounds and musics in order to apply audio effects (like echo or frequency filters) if desired.

As always, you should make a backup before any upgrade.

In this page, we only focus on the incompatibilities. See the changelog to know more about the new features.

Compatibility layer with 1.5/1.6/2.0

Good news for players! Quests in format 1.5, 1.6 and 2.0 can still be played by Solarus 2.1 with no modification. Indeed, Solarus 2.1 will detect their old version in quest.dat and will keep the old and fully compatible API for them. It is only when you upgrade your quest to 2.1 that your quest gets the new API, and that you need to take care of instructions on this page.

Upgrading Data Files

Data files other than scripts can be upgraded automatically with Solarus Editor. Open your quest with Solarus Editor 2.1 and a dialog will guide you to upgrade data files.

Upgrading Lua Scripts

The Lua scripting API of Solarus 2.1 introduces a small number of incompabilities. We give below the list of potential incompatilibies you may have to take care of when upgrading your quest to the Solarus 2.1 format.

Enemy entities invulnerabilities

Because we added a duration parameter to enemy:set_invincible(), the behavior of this method changed slightly.

As described in the lua API documentation, when the duration is 0 (default value), the enemy stays invincible to all attack consequences, it's equivalent to call enemy:set_attack_consequence(attack, "ignored") for each attack type or to call the new enemy:set_no_attack_consequences() which is more explicit.

This is to ensure backward compatibility with games from previous versions of Solarus.

As well, we deprecated enemy:set_invincible_sprite(sprite) so you should now use enemy:set_no_attack_consequences_sprite(sprite). That's because this last one is the equivalent of the explicit version enemy:set_no_attack_consequences() that we recommend you to use.

More information in the Lua API documentation here: Enemy API