-
Notifications
You must be signed in to change notification settings - Fork 3
Maps and Factories
The engine exposes none of its filesystem, so minqlxtended reads the pk3s itself, off the same
search paths the engine mounts: fs_basepath/baseq3, the workshop directory and
fs_homepath/baseq3.
minqlxtended.installed_maps() # every map, with sources and .arena data
minqlxtended.map_info("overkill").arena.gametypes # (Gametype.FFA, Gametype.CA, ...)
minqlxtended.map_supports("overkill", "ca") # True / False / None
minqlxtended.map_worldspawn("overkill")["message"] # the title, from the BSP itself
minqlxtended.map_entities("overkill", "info_player_deathmatch")
minqlxtended.factories() # every .factories entry, deduplicated
minqlxtended.map_supports_factory("overkill", "ctf")Game.map_info and Game.factory_info are the same lookups for whatever is running now.
These can do disk I/O on a cold or stale cache. Call them from a
@minqlxtended.threadworker.
Results come from a cache that re-stats at most every 30 seconds and only re-reads a pk3 whose
size or mtime changed. qlx_mapinfoScan warms it on a background thread at startup.
map_info is the cheap tier: zip directories plus the small declaration files.
map_worldspawn and map_entities decompress the BSP's entities lump on first ask, and an LRU
keeps the last eight maps.
Two forms are read. The stock game ships consolidated scripts/arenas.txt and
scripts/factories.txt in pak00.pk3; a workshop item ships a per-map scripts/<map>.arena.
Within one pk3 the per-map files layer over the consolidated list, so extras.arena and
holiday.arena supersede entries in arenas.txt. scripts/*.sp_arena is single-player bot
practice and is ignored.
map_supports answers None for a map with no declaration. Plenty of workshop maps play fine
in gametypes they never declared, so None is not "no".
No shipped map declares Overload, so map_supports(m, Gametype.OVERLOAD) is None everywhere.
Builds disagree with each other too: a later arenas.txt gives almost every map the full
ffa duel tdm ca ft rr core where an older one is selective. What a server has installed is
what it reports.
!mapinfo and !factories in the
plugins repository are the reference use.