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

@@ -36,6 +36,9 @@
#include "datacache/imdlcache.h"
#include "util.h"
#include "cdll_int.h"
#ifdef MAPBASE
#include "fmtstr.h"
#endif
#ifdef PORTAL
#include "PortalSimulation.h"
@@ -204,6 +207,46 @@ void CEntityFactoryDictionary::ReportEntitySizes()
}
}
#ifdef MAPBASE
int EntityFactory_AutoComplete( const char *cmdname, CUtlVector< CUtlString > &commands, CUtlRBTree< CUtlString > &symbols, char *substring, int checklen = 0 )
{
CEntityFactoryDictionary *pFactoryDict = (CEntityFactoryDictionary*)EntityFactoryDictionary();
for ( int i = pFactoryDict->m_Factories.First(); i != pFactoryDict->m_Factories.InvalidIndex(); i = pFactoryDict->m_Factories.Next( i ) )
{
const char *name = pFactoryDict->m_Factories.GetElementName( i );
if (Q_strnicmp(name, substring, checklen))
continue;
CUtlString sym = name;
int idx = symbols.Find(sym);
if (idx == symbols.InvalidIndex())
{
symbols.Insert(sym);
}
// Too many
if (symbols.Count() >= COMMAND_COMPLETION_MAXITEMS)
break;
}
// Now fill in the results
for (int i = symbols.FirstInorder(); i != symbols.InvalidIndex(); i = symbols.NextInorder(i))
{
const char *name = symbols[i].String();
char buf[512];
Q_strncpy(buf, name, sizeof(buf));
Q_strlower(buf);
CUtlString command;
command = CFmtStr("%s %s", cmdname, buf);
commands.AddToTail(command);
}
return symbols.Count();
}
#endif
//-----------------------------------------------------------------------------
// class CFlaggedEntitiesEnum
@@ -2507,6 +2550,10 @@ void UTIL_PredictedPosition( CBaseEntity *pTarget, float flTimeDelta, Vector *ve
if ( pAnimating != NULL )
{
vecPredictedVel = pAnimating->GetGroundSpeedVelocity();
#ifdef MAPBASE
if (vecPredictedVel.IsZero())
vecPredictedVel = pAnimating->GetSmoothedVelocity();
#endif
}
else
{
@@ -2524,7 +2571,7 @@ void UTIL_PredictedPosition( CBaseEntity *pTarget, float flTimeDelta, Vector *ve
//-----------------------------------------------------------------------------
// Purpose: Same as above, except you don't have to use the absolute origin and can use your own position to predict from.
//-----------------------------------------------------------------------------
void UTIL_PredictedPosition( CBaseEntity *pTarget, Vector &vecActualPosition, float flTimeDelta, Vector *vecPredictedPosition )
void UTIL_PredictedPosition( CBaseEntity *pTarget, const Vector &vecActualPosition, float flTimeDelta, Vector *vecPredictedPosition )
{
if ( ( pTarget == NULL ) || ( vecPredictedPosition == NULL ) )
return;
@@ -2547,7 +2594,11 @@ void UTIL_PredictedPosition( CBaseEntity *pTarget, Vector &vecActualPosition, fl
{
CBaseAnimating *pAnimating = dynamic_cast<CBaseAnimating *>(pTarget);
if ( pAnimating != NULL )
{
vecPredictedVel = pAnimating->GetGroundSpeedVelocity();
if (vecPredictedVel.IsZero())
vecPredictedVel = pAnimating->GetSmoothedVelocity();
}
else
vecPredictedVel = pTarget->GetSmoothedVelocity();
}
@@ -2556,6 +2607,38 @@ void UTIL_PredictedPosition( CBaseEntity *pTarget, Vector &vecActualPosition, fl
// Get the result
(*vecPredictedPosition) = vecActualPosition + ( vecPredictedVel * flTimeDelta );
}
//-----------------------------------------------------------------------------
// Purpose: Predicts angles through angular velocity instead of predicting origin through regular velocity.
//-----------------------------------------------------------------------------
void UTIL_PredictedAngles( CBaseEntity *pTarget, const QAngle &angActualAngles, float flTimeDelta, QAngle *angPredictedAngles )
{
if ( ( pTarget == NULL ) || ( angPredictedAngles == NULL ) )
return;
QAngle angPredictedVel;
CBasePlayer *pPlayer = ToBasePlayer( pTarget );
if ( pPlayer != NULL )
{
if ( pPlayer->IsInAVehicle() )
angPredictedVel = pPlayer->GetVehicleEntity()->GetLocalAngularVelocity();
else
angPredictedVel = pPlayer->GetLocalAngularVelocity();
}
else
{
CBaseCombatCharacter *pCCTarget = pTarget->MyCombatCharacterPointer();
if ( pCCTarget != NULL && pCCTarget->IsInAVehicle() )
angPredictedVel = pCCTarget->GetVehicleEntity()->GetLocalAngularVelocity();
else
{
angPredictedVel = pTarget->GetLocalAngularVelocity();
}
}
// Get the result
(*angPredictedAngles) = angActualAngles + ( angPredictedVel * flTimeDelta );
}
#endif
//-----------------------------------------------------------------------------