Solarus-Games English Forum

Community => Your scripts => Topic started by: llamazing on January 27, 2021, 01:57:34 AM

Title: Default Destination Checker
Post by: llamazing on January 27, 2021, 01:57:34 AM
So apparently if a map has no default destination designated, then the first one listed in the map data file becomes the default. This caused a bug in Ocean's Heart where if someone saved the game on a particular map then they would spawn at a destination that was blocked by a locked door, and the hero would be stuck. The solution is to always designate one of the map's destinations as the default whenever there is more than one (choosing one that won't be blocked by an obstruction, of course).

I wrote a script to scan all the map data files, reporting any found that have more than one destination without a default destination specified.

Usage:
require"scripts/default_destination_checker"()

The list of maps found is printed to the console.
Title: Re: Default Destination Checker
Post by: PeterB on January 29, 2021, 08:29:17 PM
Great catch llamazing, thanks for posting this.