Skip to content

Migrating to core 2.0

Core 2.0 replaces several Lua shapes that copied the game’s internal XML with simpler ones. A mod whose manifest asks for core ">=1.0 <2.0" is disabled, and Details in the mod menu says it was built for core 1.x.

Mods without Lua are not affected. A mod that only ships translations or Moveset Lab edits keeps working with its old manifest.

Change the core dependency range:

[[dependencies]]
id = "core"
version = ">=2.0 <3.0"

Then go through the changes below. Each removed form fails with an error naming its replacement, so loading the mod and reading Details finds them one at a time.

Core 1.x Core 2.0
sf2.shop.addItem { … } sf2.shop.add_item { … }

A battle’s or fight’s location, and sf2.fights.patch { location = … }, take a location handle or a location ID. The bare arena name is no longer accepted.

-- core 1.x
location = "dojo",
location = sf2.locations.name(my_arena),
-- core 2.0
location = "core:locations/dojo",
location = my_arena,

A fight with no location uses its battle’s arena, so you only need to set it on the battle. Find arena IDs in the Locations catalog.

Battle alias, title and description, fight description, warrior first_name and last_name, and quest dialog text now accept a handle from sf2.localization.key. Replace hand-built text IDs:

-- core 1.x
title = sf2.mod.id .. ":localization/battle.title",
-- core 2.0
title = sf2.localization.key("battle.title"),

A plain string is still shown as literal text.

These need no change, but let you delete code:

  • sf2.ui.close, sf2.world.remove_marker, sf2.world.release_camera and sf2.audio.stop accept nil and do nothing. Closing an already-closed view was already harmless, so if view and sf2.ui.is_open(view) then sf2.ui.close(view) end becomes sf2.ui.close(view).
  • Core content IDs are listed in the core catalog; see Finding core content.