Mapbase v2.0; bulk commit

- Added custom map compile tools (vbsp, vvis, vrad)
- Changed blink fix (shouldn't change anything in-game)
- Added auto-completion to ent_create, npc_create, and the main set of "npc_" debug commands
- Added ent_create_aimed, an ent_create equivalent of npc_create_aimed
- Made hunters start using the "vs. player" melee animation against smaller NPCs that look weird with the "stab" attack
- Added "explosion_sparks" convar, which fixes broken code for giving explosions sparks (disabled by default because of how different it looks)
- Made interaction code capable of being dispatched on any entity, not just combat characters
- Added npc_barnacle_ignite convar, which lets barnacles be ignited by flares
- Fixed certain NPCs getting out of the way for the player when they hate them
- Fixed auto-generated "speak" scene responses not using parameters that work on real VCDs
- Made "stop_on_nonidle" capable of being used in any mod, not just HL2 episodic mods
- Selectable color for ragdoll boogie/point_ragdollboogie
- Fixed PickupWeaponInstant not firing weapon pickup outputs
- Introduced inputs and keyvalues for "lerping" to math_counter_advanced
- Fixed ClearConsole on logic_console
- logic_convar should now detect client convars correctly
- New NormalizeAngles input on math_vector
- logic_modelinfo LookupActivity input
- math_generate fixed and expanded to be more like math_counter
- Added a WIP game logging system for playtesting maps
- Introduced logic_playerinfo, an entity that can read a player's name or ID
- Fixed some new filters not working with filter_multi
- Added radius pickup spawnflag to func_physbox
- Added "Preserve name" spawnflag to weapons
- Added cc_achievement_debug message for when an achievement doesn't exist
- Made npc_combine_s not speak while in logic_choreographed_scenes
- Fixed zombie torsos/legs/headcrabs not being serverside when zombie is forced to server ragdoll
- Expanded and cleaned up npc_zombie_custom
- Fixed func_commandredirects not cleaning up correctly and sometimes crashing the game
- Allowed player squad commands to go through +USE-held objects
- Added a bunch of I/O/KV to trigger_waterydeath for better configuration
- Changed save comment system to use the chapter title from world properties, and the ability to suppress the title popup that normally results from it
- Adjusted game_convar_mod for MP planning
- Removed the func_precipitation custom particle/splash code for now, as it was causing problems
- Fixed env_global_light not accepting lightcolor
- Added "Additional Buttons" to player_speedmod
- Added save comment to RPC
- Added env_projectedtexture attenuation
- Added scripted_sequence OnPreIdleSequence
- Added OnCrab to zombies
- Added skill_changed game event (may need further testing)
- Added a fix for viewmodels flipping under extreme FOV values
- Added code that allows mappers to change the skin on shotgunners without it usually flipping back randomly
- Fixed a very, very, very major shader performance issue
- New SetAbsOrigin/Angles inputs on all entities, analogous to SetLocalOrigin/Angles
- Code improvements for I/O involving angles
- logic_entity_position improvements/fixes, including a new OutAngles output that outputs the angles on position calls
- Alternate collision/player avoidance spawnflag obsoletion enforcement disabled
- Enable/DisableHazardLights inputs on the EP2 jalopy, equivalent to the keyvalue
- Miscellaneous shader formatting adjustments and fixes
- Fixed AlwaysDrawOff on env_projectedtexture not being a valid input
This commit is contained in:
Blixibon
2019-12-14 04:20:02 +00:00
parent a1dba884a3
commit dc7f20acc8
97 changed files with 2845 additions and 485 deletions

View File

@@ -43,7 +43,11 @@ qboolean noshare;
qboolean nosubdiv;
qboolean notjunc;
qboolean noopt;
#ifdef MAPBASE
qboolean noleaktest;
#else
qboolean leaktest;
#endif
qboolean verboseentities;
qboolean dumpcollide = false;
qboolean g_bLowPriority = false;
@@ -85,182 +89,6 @@ int entity_num;
node_t *block_nodes[BLOCKS_SPACE+2][BLOCKS_SPACE+2];
#ifdef MAPBASE
//-----------------------------------------------------------------------------
// Manifest stuff
//-----------------------------------------------------------------------------
CUtlVector<const char *> g_szManifestFiles;
bool g_bManifestVerbose = true; // Change to false when testing is over
#define ManifestMsg(msg, ...) g_bManifestVerbose ? Msg(msg, __VA_ARGS__) : NULL
#define ManifestWarning(msg, ...) g_bManifestVerbose ? Warning(msg, __VA_ARGS__) : NULL
void SetManifestFile(char const *file)
{
if (g_pFileSystem->FileExists( file ))
{
Msg("Manifest file: %s\n", file);
g_szManifestFiles.AddToTail(file);
}
}
void ZipDirectory(const char *dir, const char *relative, IZip *package, int *filecount)
{
ManifestMsg(" MANIFEST: Mounting directory \"%s\"\n", dir);
FileFindHandle_t handle = NULL;
const char *file = g_pFullFileSystem->FindFirst(dir, &handle);
// Prevents us from packaging the folder itself
//if (file)
// file = g_pFullFileSystem->FindNext(handle);
while (file)
{
// Don't use hidden files/folders
if (file[0] != '.')
{
char subdir[MAX_PATH];
Q_strncpy(subdir, dir, strlen(dir) - 1); // Remove wildcard
Q_ComposeFileName(subdir, file, subdir, sizeof(subdir));
char subrelative[MAX_PATH];
Q_strncpy(subrelative, relative, sizeof(subrelative));
Q_ComposeFileName(subrelative, file, subrelative, sizeof(subrelative));
if (g_pFullFileSystem->FindIsDirectory(handle))
{
// Append wildcard
Q_ComposeFileName(subdir, "*", subdir, sizeof(subdir));
// Mount subdirectory
ZipDirectory(subdir, subrelative, package, filecount);
}
else
{
// Mount file
ManifestMsg(" MANIFEST: File \"%s\" packed into BSP at \"%s\"\n", subdir, subrelative);
*filecount++;
AddFileToPak(package, subrelative, subdir);
}
}
file = g_pFullFileSystem->FindNext(handle);
}
g_pFullFileSystem->FindClose(handle);
}
void ParseManifestFile()
{
if (g_szManifestFiles.Count() == 0)
return;
Msg("Starting pack manifest with %i files\n", g_szManifestFiles.Count());
int totalfilecount = 0;
for (int i = 0; i < g_szManifestFiles.Count(); i++)
{
FileHandle_t manifestfile = g_pFileSystem->Open( g_szManifestFiles[i], "rb" );
if (!manifestfile)
{
Warning("Manifest file \"%s\" cannot be read!\n", g_szManifestFiles[i]);
continue;
}
//FileHandle_t curfile;
bool curfile;
char buf[1024];
char *scan;
int filecount = 0;
bool fullpath = false;
while ( CmdLib_FGets( buf, sizeof( buf ), manifestfile ) )
{
scan = buf;
// Check if it's an actual path or just relative
fullpath = (scan[0] == '#');
if (fullpath)
scan += 1;
else
{
char file[128];
Q_strncpy(file, scan, sizeof(file));
char path[_MAX_PATH];
Q_ExtractFilePath(source, path, sizeof(path));
sprintf(scan, "%s%s", path, file);
}
bool inquotes = (scan[0] == '"');
int namelength;
if (inquotes)
{
scan += 1;
namelength = strcspn( scan, "\"" );
}
else
{
namelength = strcspn( scan, " \t" );
}
char filename[FILENAME_MAX];
Q_strncpy(filename, scan, namelength + 1);
scan += (namelength + inquotes);
scan += strspn(scan, " \t");
// Remove any quotes in the internal path.
// The fact they're actually optional in the second path is irrelevant.
if (scan[0] == '"')
{
scan[0] = '\0';
if (scan[strlen(scan) - 1] == '"')
scan[strlen(scan) - 1] = '\0';
}
curfile = g_pFileSystem->FileExists(filename);
if (curfile)
{
// Assume internal file is a directory if no extension
if (Q_GetFileExtension(scan) == NULL)
Q_ComposeFileName(scan, filename, scan, sizeof(filename));
ManifestMsg(" MANIFEST: File \"%s\" packed into BSP at \"%s\"\n", filename, scan);
filecount++;
AddFileToPak(GetPakFile(), scan, filename);
}
else if (g_pFullFileSystem->IsDirectory(filename))
{
// Append wildcard
if (!Q_strstr(filename, "*"))
Q_ComposeFileName(filename, "*", filename, sizeof(filename));
// Internal path must be a directory
if (scan[0] == NULL || Q_GetFileExtension(scan) == NULL)
ZipDirectory(filename, scan, GetPakFile(), &filecount);
else
Warning("\n MANIFEST WARNING: Directory \"%s\" tried to pack to a file!\nIf you are not trying to package a directory to the BSP, add an extension to \"%s\".\nIf you are trying to package a directory, remove the extension from \"%s\".\n\n", filename, filename, scan);
}
else
{
Warning(" MANIFEST WARNING: File \"%s\" does not exist!\n", filename);
}
}
if (filecount > 0)
ManifestMsg("%i file(s) packed from manifest %s\n", filecount, g_szManifestFiles[i]);
else
ManifestWarning("*** No files zipped from manifest %s!\n ***", g_szManifestFiles[i]);
totalfilecount += filecount;
g_pFileSystem->Close( manifestfile );
}
Msg("%i total file(s) packed from manifests\n", totalfilecount);
}
#endif
//-----------------------------------------------------------------------------
// Assign occluder areas (must happen *after* the world model is processed)
//-----------------------------------------------------------------------------
@@ -473,7 +301,11 @@ void ProcessWorldModel (void)
Warning( ("**** leaked ****\n") );
leaked = true;
LeakFile (tree);
#ifdef MAPBASE
if (!noleaktest)
#else
if (leaktest)
#endif
{
Warning( ("--- MAP LEAKED ---\n") );
exit (0);
@@ -1178,11 +1010,19 @@ int RunVBSP( int argc, char **argv )
Msg ("microvolume = %f\n", microvolume);
i++;
}
#ifdef MAPBASE
else if (!Q_stricmp(argv[i], "-noleaktest"))
{
Msg ("noleaktest = true\n");
noleaktest = true;
}
#else
else if (!Q_stricmp(argv[i], "-leaktest"))
{
Msg ("leaktest = true\n");
leaktest = true;
}
#endif
else if (!Q_stricmp(argv[i], "-verboseentities"))
{
Msg ("verboseentities = true\n");
@@ -1316,19 +1156,10 @@ int RunVBSP( int argc, char **argv )
EnableFullMinidumps( true );
}
#ifdef MAPBASE
else if ( !Q_stricmp( argv[i], "-deletecubemaps" ) )
else if ( !Q_stricmp( argv[i], "-nodefaultcubemap" ) )
{
g_bNoDefaultCubemaps = true;
}
else if ( !Q_stricmp( argv[i], "-manifest" ) )
{
SetManifestFile(argv[i+1]);
i++;
}
else if ( !Q_stricmp( argv[i], "-manifest_verbose" ) )
{
g_bManifestVerbose = true;
}
#endif
else if (argv[i][0] == '-')
{
@@ -1445,13 +1276,6 @@ int RunVBSP( int argc, char **argv )
ThreadSetDefault ();
numthreads = 1; // multiple threads aren't helping...
#ifdef MAPBASE
// Any additional files to pack?
char ManifestFile[512];
_snprintf( ManifestFile, sizeof(ManifestFile), "%s_zipmanifest.txt", source );
SetManifestFile(ManifestFile);
#endif
// Setup the logfile.
char logFile[512];
_snprintf( logFile, sizeof(logFile), "%s.log", source );
@@ -1568,11 +1392,6 @@ int RunVBSP( int argc, char **argv )
AddBufferToPak( GetPakFile(), "stale.txt", "stale", strlen( "stale" ) + 1, false );
}
#ifdef MAPBASE
// Is this a good place for this?
ParseManifestFile();
#endif
LoadMapFile (name);
WorldVertexTransitionFixup();
if( ( g_nDXLevel == 0 ) || ( g_nDXLevel >= 70 ) )