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.
1. Update the manifest
Section titled “1. Update the 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.
2. Renamed functions
Section titled “2. Renamed functions”| Core 1.x | Core 2.0 |
|---|---|
sf2.shop.addItem { … } |
sf2.shop.add_item { … } |
3. Arenas take a location ID
Section titled “3. Arenas take a location ID”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.xlocation = "dojo",location = sf2.locations.name(my_arena),
-- core 2.0location = "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.
4. Text fields take localization handles
Section titled “4. Text fields take localization handles”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.xtitle = sf2.mod.id .. ":localization/battle.title",
-- core 2.0title = sf2.localization.key("battle.title"),A plain string is still shown as literal text.
5. Smaller conveniences
Section titled “5. Smaller conveniences”These need no change, but let you delete code:
sf2.ui.close,sf2.world.remove_marker,sf2.world.release_cameraandsf2.audio.stopacceptniland do nothing. Closing an already-closed view was already harmless, soif view and sf2.ui.is_open(view) then sf2.ui.close(view) endbecomessf2.ui.close(view).- Core content IDs are listed in the core catalog; see Finding core content.