For quest makers
For Solarus developers
For quest makers
For Solarus developers
Solarus 1.5 brings important new features: a quest launcher GUI, an execution console, a customizable camera as entity, maps with more than 3 layers, and more. It also improves global performance, fixes a lot of issues. Dozens of new functions were added to the Lua API.
As always, you should make a backup before any upgrade.
Data files other than scripts can be upgraded automatically with the editor. Open your quest with Solarus Quest Editor 1.5 and a dialog will let you to perform the upgrade.
In case of trouble, please ask for help on the Solarus forums.
A new user interface allows users to select a quest, to run it and to change some settings like video and audio settings.
In this new quest launcher, each quest can now have a logo and some icons that are displayed.
The logo and icons are optional, but it is recommended to make some for your quest to be better identified in the quest list of the launcher GUI.
The logo of your quest should be a PNG image of size 200×140 called
logos/logo.png. It is optional.
An icon is also useful for the Solarus GUI to distinguish your quest. Like the logo, the icon is optional. Multiple icon sizes are allowed, and each size should be in a separate PNG file. The following icon file names are allowed, with the corresponding sizes from 16×16 pixels to 1024×1024 pixels:
It is possible (and recommended) to provide an icon with multiple sizes. The Solarus GUI will then automatically pick the most suitable one(s) to fit its needs.
The Lua scripting API of Solarus 1.5 introduces some incompabilities in order to get rid of legacy design choices. Luckily, most of them are very simple or will not impact you. Yet, we give below the exhaustive list of potential problems you may encounter.
chest:on_empty() no longer exists. It is replaced by the more general chest:on_opened(item, variant, savegame_variable), which is called no matter if the chest is empty or has a treasure.
This is more natural: if you don't define the event, then the built-in behavior of the engine is executed (giving the treasure if any), and if you define it you can customize what happens.
In almost all cases, you can simply replace
function chest:on_empty() by
When walking into deep water without the
swim ability, the hero no longer automatically jumps over the water: by default, he simply drowns instead. Most users don't want the jump.
If you need the jump like before, there is a new ability
“jump_over_water”. Just call game:set_ability("jump_over_water", 1) when starting the savegame and you will get the old behavior back.
rank property of enemies no longer exist. It is automatically removed from your map data files when upgrading. Its only effect was to set the initial hurt style to
Instead, just call enemy:set_hurt_style("boss") from enemy scripts that are bosses or minibosses.
Because of a bug, when brandishing a treasure, for example from a chest or by calling hero:start_treasure(), the treasure sprite was not animated (it remained stuck at its first frame). The same was true for shop treasures.
This problem is now fixed, but you may be surprised if a fixed image was actually what you wanted!
If like me, you want hearts to be animated when they are appear as pickable treasures on the map (to make them fall nicely), but fixed when they are brandished from a treasure chest, then you need two different heart animations in the
entities/items sprite. You should rename the
heart animation to
heart_falling, and make a fresh
heart animation with only one frame. The
heart item script should then explicitly set the
heart_falling animation to pickable hearts:
function item:on_pickable_created(pickable) ... pickable:get_sprite():set_animation("heart_falling") end
Collision checks were greatly improved. Collisions with non-moving entities were not always detected. Similarly, notifications of position or ground changes were not always sent, in particular at map initialization time.
It means that events like
custom_entity:on_ground_below_changed() and custom entity collision callbacks are now called in situations where they were missed before due to bugs.
You might want to check that your enemies and custom entities still work as expected.
The following functions are now deprecated. You can still use them in Solarus 1.5, but they will show a warning. They might be removed in a future version.
map:draw_sprite()is now deprecated, use map:draw_visual() instead. This new function also works with surfaces and text surfaces.
map:on_camera_back()are now deprecated for the same reason. Use a movement on the camera entity instead, and you can fully customize this movement like you do for any other entity. If you need to reproduce the exact behavior of
map:move_camera()for compatibility, here is an implementation in pure Lua.
The remaining incompatibilities in the Solarus API are less disruptive. They don't have any consequence in most games, and if they do, they should be easy to address.
heightare now mandatory. It was an error that they were not (their default value was 16).