Chore: Move configs to their own files, load dynamically#98
Chore: Move configs to their own files, load dynamically#98sarahsturgeon merged 2 commits intomasterfrom
Conversation
There was a problem hiding this comment.
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
Initializehook - 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.
|
@copilot can you make sure i didn't typo anything while making new files /moving stuff around? also double check my loader logic |
|
@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>
Goal is to not include every config in
_Gat 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.