Skip to content

Chore: Move configs to their own files, load dynamically#98

Merged
sarahsturgeon merged 2 commits intomasterfrom
chore/move-configs-to-own-file
Dec 29, 2025
Merged

Chore: Move configs to their own files, load dynamically#98
sarahsturgeon merged 2 commits intomasterfrom
chore/move-configs-to-own-file

Conversation

@sarahsturgeon
Copy link
Member

Goal is to not include every config in _G at all times.

I think this should work. It's not a perfect end-game design, we should probably have the files return a raw table and then we can do more clever logic at the loading level. (i.e. for any gm_cfc_* we could load the same config, we can also set aliases at the top level)

Mostly just check for stupid typos when moving the configs to their own files. Make sure the loader logic makes sense.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the spawn configuration system by moving map-specific spawn configurations from a single monolithic sv_config.lua file to individual per-map configuration files under the configs/ directory. The goal is to load configs dynamically on-demand rather than keeping all configs in global memory at all times.

Key Changes:

  • Removed ~2700 lines of hardcoded spawn configs from sv_config.lua
  • Added dynamic config loading via Initialize hook
  • Created individual config files for each map in lua/cfc_random_spawn/configs/

Reviewed changes

Copilot reviewed 40 out of 41 changed files in this pull request and generated no comments.

Show a summary per file
File Description
lua/cfc_random_spawn/sv_config.lua Replaced all inline configs with dynamic loader that includes map-specific files on initialization
lua/cfc_random_spawn/configs/sb_omen_v3.lua New file containing spawn config for sb_omen_v3 map
lua/cfc_random_spawn/configs/rp_southside_day.lua Alias file that includes and references rp_southside config
lua/cfc_random_spawn/configs/rp_southside.lua New file containing spawn config for rp_southside map
lua/cfc_random_spawn/configs/rp_nycity.lua Alias file that includes and references rp_nycity_day config
lua/cfc_random_spawn/configs/rp_genova_redux_v1.lua New file containing spawn config for rp_genova_redux_v1 map
lua/cfc_random_spawn/configs/gm_tornadoalley_day.lua Alias file that includes and references gm_tornadoalley config
lua/cfc_random_spawn/configs/gm_novenka_night.lua Alias file that includes and references gm_novenka config
lua/cfc_random_spawn/configs/gm_genesis.lua New file containing spawn config for gm_genesis map

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sarahsturgeon
Copy link
Member Author

@copilot can you make sure i didn't typo anything while making new files /moving stuff around? also double check my loader logic

Copy link

Copilot AI commented Dec 8, 2025

@sarahsturgeon I've opened a new pull request, #99, to work on those changes. Once the pull request is ready, I'll request review from you.

Co-authored-by: StrawWagen <64710817+StrawWagen@users.noreply.github.com>
@sarahsturgeon sarahsturgeon merged commit cc2680d into master Dec 29, 2025
1 check passed
@sarahsturgeon sarahsturgeon deleted the chore/move-configs-to-own-file branch December 29, 2025 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants