Skip to content

Better Map Replacement System

The gamemapwadfolder variable is used to determine what folder in MAPS/ for pk3 files is preferred for loading the current map and supports read and write with Lua. By default, the gamemapwadfolder variable is set to \0, which means no folder is preferred and the last file with a map that meets the criteria of gamemapwadname. The gamemapwadname is used to determine which file is going to be used for the gamemap, which is set to '\0' by default as well which means that the last wad file that has a map in the mapslot for the current gamemap is going to be used, while if the gamemapwadname is set to zones.pk3 then the vanilla zones will be used even if files are added that have maps that replace those maps. If no maps are found in the file set by gamemapwadname or the file set by gamemapwadname doesn't exist when gamemapwadname is not equal to '\0', then the old behavior of replacing maps that is used in the latest vanilla SRB2 version will be used instead. There is also now support for a special SOC lump called MODCFG, which will only support the maincfg and map headers and will be loaded when necessary. It will be recommended to use this special lump now for level packs once this merge request gets merged and SRB2 gets updated. Folders mark the game as modified no matter what order the files are in, because folders are for development-purposes only.

Test files: srb2win_mrstest.exe Mrstest_script.lua Mrstest_mapset1.pk3 Mrstest_mapset2.pk3

New Recommended Load Order for Files After Mainfiles:

  1. Characters, Lua scripts, level packs w/o MODCFG lump that sets GameData, and other game-modifying type of files
  2. Level pack 1 with MODCFG lump that sets GameData
  3. (Optional) Music file(s) for level pack 1
  4. Level pack 2 with MODCFG lump that sets GameData
  5. (Optional) Music files(s) for level pack 2
  6. etc.
Edited by ChaoLoveIceMDBoy

Merge request reports

Loading