Particularly useful for Frikbot waypoints, CTF or altering the entities in a single player map for whatever reason.
Every engine should support this, there is a bit of naming differences among the engines as to the cvar name to turn the feature on or off (it is always defaulted on by every engine) ...
DarkPlaces uses: sv_entpatch
FTEQW, ezQuake use: sv_loadentfiles
Oldy QIPQuake uses: external_ents
Anyway ...
1. Open sv_main.c and go to the function SV_SpawnServer.
2. Locate this code:
Code: Select all
ED_LoadFromFile (sv.worldmodel->entities);
Code: Select all
{
#define SUPPORTS_EXTERNAL_ENTS 1
#if SUPPORTS_EXTERNAL_ENTS
char *entitystring = NULL;
if ((entitystring = (char *)COM_LoadHunkFile (va ("maps/%s.ent", sv.name))))
{
Con_DPrintf ("Using entfile maps/%s.ent\n", sv.name);
// To do: Maybe set some cvar to the .ent file name
ED_LoadFromFile (entitystring);
// Ideally we should free the entitystring here, except we put it on the hunk
// which gets cleared on a new map. But we are wasting some memory here
// .ent files can occasionally be rather big (1 MB or 2 MB) but usually aren't.
}
else // Either we aren't using external ent files or we didn't have one, load the old fashioned way
#endif
ED_LoadFromFile (sv.worldmodel->entities); // Baker: This isn't loading from "file" but from memory
}