Modding > Spelunky 2 > Custom Levels


Simple library to load custom levels
By:
JayTheBusinessGoose
Downloads:
269
Mod Type:
Library
Added:
4 years, 10 months ago
Last Update:
2 years, 3 months ago
Average Rating:

Details


To keep current with updates, clone the repo at: https://github.com/jaythebusinessgoose/CustomLevels

git clone --recurse-submodules https://github.com/jaythebusinessgoose/CustomLevels

Check out the README for more information about usage and additional configuration/features.

Level Sequence

This library is lower-level than the Level Sequence library and doesn't do very much of what it does. For an easier way to load multiple level files or even a single level file, consider using Level Sequence instead (https://spelunky.fyi/mods/m/level-sequence).

Use this library if the Level Sequence doesn't fit your use case.

CustomLevels

Utility for loading custom levels.

The level loading supports levels of any size up to 8x15, which is the max Spelunky 2 can support.

Each room must be created as a setroom template with the format setroomy_x. This is slightly different from the setroomy-x that the game uses for setrooms.

The level file must be loaded in the ON.PRE_LOAD_LEVEL_FILES via the load_level() function, with the PRE_LOAD_LEVEL_FILES context passed in as the last parameter.

When loading a level that should not be overridden, such as the base camp, unload_level() can be called to clear the loaded level state.

Example:

set_callback(function(ctx)
    if state.screen ~= SCREEN.LEVEL or state.theme == 0 then
        custom_levels.unload_level()
    else
        local theme_properties = {
            theme = THEME.DWELLING,
            floor_theme = THEME.VOLCANA,
        }
        custom_levels.load_level_custom_theme(ctx, 'cool_level.lvl', theme_properties)
    end
end, ON.PRE_LOAD_LEVEL_FILES)

Procedural Spawns

Random spawns such as crates, rocks, webs, gold, and embedded items, are removed by default so that only
manually spawned items exist. For some of these items, this means that tile codes that add the item will not spawn the item.

Version History

2.2

  • Separated wall torches into their own removed spawn type so they can be disabled separately.
  • Added red lanterns to the removed procedural spawns.
  • Now checking for screen in POST_ROOM_GENERATION callback to make sure it only happens during the level.

2.1

Fixed crashes in some themes due to hacky vine/pole/chain growing logic. (It's still hacky, but doesn't crash as much anymore).

2.0

New method to load levels with a CustomTheme or create a CustomTheme from a theme properties table.
- Ice Caves no longer should crash.
- Additional customization possible.

Added some enemies and entities to the list of procedurally spawned entities that get removed:
- Hermit crabs.
- Tadpoles.
- Pots of Gold.
- Leprechauns.
- Pot of Gold indicator rainbows.

1.4

Removes naturally generated bats from back layers. There is a configuration option to disable this.

1.3

Enables spawns of items that can appear in the crust if they are spawned as a tile code and not as a crust overlay.

1.2

Added configuration to disable entrance door hiding.

Downloads


Latest Download
Downloads Name Uploaded
88 CustomLevels.zip 2 years, 3 months ago
Past Downloads (6)
Downloads Name Uploaded
91 CustomLevels.zip 4 years, 6 months ago
23 CustomLevels.zip 4 years, 8 months ago
20 CustomLevels.zip 4 years, 9 months ago
16 CustomLevels.zip 4 years, 10 months ago
8 CustomLevels.zip 4 years, 10 months ago
23 CustomLevels.zip 4 years, 10 months ago

Comments (1)


Please log in to leave a comment.

1 month, 3 weeks ago

useless