mirror of
https://github.com/celisej567/source-sdk-2013.git
synced 2026-09-23 20:09:45 +03:00
Mapbase v3.0
- Overhauled matcher system and added expanded wildcard support, meaning "text", "te?t", "blah_test", etc. are now supported instead of only trailing * - Added support for regular expression matching - Added the missing matrixinvert.h file, which prevented programmers from compiling vbsp - Fixed env_global_light brightness - Added info_player_view_proxy, an entity which mimics a player's view (created for script_intro) - New UnZoomWithRate and SetZoomRate inputs on env_zoom - New "Don't change target's angles" flag on logic_measure_movement - Fixed logic_measure_movement not using ignore origin flags correctly - Fixed filter_damage_mod secondary filter not recognizing mode correctly - Fixed DisableGeigerCounter causing NPCs to ignore player, and possibly fixed other adverse effects in similar code - Added SetEntityName input for setting an entity's targetname - Added "SetTarget" support to point_posecontroller - Added "sk_alyx_health" convar for adjustable npc_alyx health, restored/fixed "sk_barney_health" for adjustable npc_barney health - Added ignore flags and several direction-related inputs to math_vector - Added pose parameter stuff to logic_modelinfo - Fixed ChangeWeapon not changing during combat - Fixed holster/unholster on NPCs without holster/unholster animations - Fixed func_tank and other "player in the way" code ignoring notarget - Added SetPoseParameter input to animating entities - Introduced an experimental chapter system which allows for custom chapter title/restriction management - Added SetChapterTitle input to worldspawn for dynamic title changing - Fixed func_tankairboatgun damage credit, added ability to use its damage keyvalues - Fixed mapbase_rpc_enabled not actually affecting RPC - Moved some newly found Combine soldier grenade code to ai_grenade for other grenade users - Fixed some problems with the new shared activities - Restored an old Mapbase entity as "prop_interactable", an entity which contains all of the functionality of a func_button/func_door in a prop entity - Added env_microphone pitch scale for scaling the pitch of transmitted sounds - Added experimental, long-overdue code for scenes to be able to access !target#'s and other scene-related names through AI_INPUT - Added "mat_specular_disable_on_missing", which "disables" specular reflections when the cubemap texture is missing - Fixed $envmapmasktransform and $bumptransform on VertexLitGeneric and related shaders - Areaportal leaks now stop compilation in leaktest - Replaced "-nodefaultcubemap" with "-defaultcubemap" as the shader changes allow maps to compile without default cubemaps by default with little effect
This commit is contained in:
@@ -2466,7 +2466,7 @@ void CLogicCase::InputValue( inputdata_t &inputdata )
|
||||
for (int i = 0; i < MAX_LOGIC_CASES; i++)
|
||||
{
|
||||
#ifdef MAPBASE
|
||||
if ((m_nCase[i] != NULL_STRING) && Matcher_Compare(STRING(m_nCase[i]), pszValue))
|
||||
if ((m_nCase[i] != NULL_STRING) && Matcher_Match(STRING(m_nCase[i]), pszValue))
|
||||
{
|
||||
m_OnCase[i].FireOutput( inputdata.pActivator, this );
|
||||
|
||||
@@ -3787,7 +3787,7 @@ void CLogicConvar::InputTest( inputdata_t &inputdata )
|
||||
const char *pCVarString = GetConVarString(inputdata);
|
||||
if (pCVarString)
|
||||
{
|
||||
if (Matcher_Compare( STRING( m_iszCompareValue ), pCVarString ))
|
||||
if (Matcher_Match( STRING( m_iszCompareValue ), pCVarString ))
|
||||
{
|
||||
m_OnTrue.FireOutput(inputdata.pActivator, this);
|
||||
}
|
||||
@@ -4611,6 +4611,11 @@ int CMathBits::DrawDebugTextOverlays( void )
|
||||
return text_offset;
|
||||
}
|
||||
|
||||
// These spawnflags control math_vector dimensions.
|
||||
#define SF_MATH_VECTOR_DISABLE_X ( 1 << 0 )
|
||||
#define SF_MATH_VECTOR_DISABLE_Y ( 1 << 1 )
|
||||
#define SF_MATH_VECTOR_DISABLE_Z ( 1 << 2 )
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Vector calculations.
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -4639,8 +4644,16 @@ private:
|
||||
void InputEnable( inputdata_t &inputdata );
|
||||
void InputDisable( inputdata_t &inputdata );
|
||||
|
||||
void PointAt( Vector &origin, Vector &target, Vector &out );
|
||||
void InputPointAtLocation( inputdata_t &inputdata );
|
||||
void InputPointAtEntity( inputdata_t &inputdata );
|
||||
|
||||
void InputNormalize( inputdata_t &inputdata );
|
||||
void InputNormalizeAngles( inputdata_t &inputdata );
|
||||
void InputVectorAngles( inputdata_t &inputdata );
|
||||
void InputAngleVectorForward( inputdata_t &inputdata );
|
||||
void InputAngleVectorRight( inputdata_t &inputdata );
|
||||
void InputAngleVectorUp( inputdata_t &inputdata );
|
||||
|
||||
void SetCoordinate(float value, char coord, CBaseEntity *pActivator);
|
||||
void GetCoordinate(char coord, CBaseEntity *pActivator);
|
||||
@@ -4693,8 +4706,15 @@ BEGIN_DATADESC( CMathVector )
|
||||
DEFINE_INPUTFUNC( FIELD_VOID, "Enable", InputEnable ),
|
||||
DEFINE_INPUTFUNC( FIELD_VOID, "Disable", InputDisable ),
|
||||
|
||||
DEFINE_INPUTFUNC( FIELD_VECTOR, "PointAtLocation", InputPointAtLocation ),
|
||||
DEFINE_INPUTFUNC( FIELD_EHANDLE, "PointAtEntity", InputPointAtEntity ),
|
||||
|
||||
DEFINE_INPUTFUNC(FIELD_VOID, "Normalize", InputNormalize),
|
||||
DEFINE_INPUTFUNC(FIELD_VOID, "NormalizeAngles", InputNormalizeAngles),
|
||||
DEFINE_INPUTFUNC(FIELD_VOID, "VectorAngles", InputVectorAngles),
|
||||
DEFINE_INPUTFUNC(FIELD_VOID, "AngleVectorForward", InputAngleVectorForward),
|
||||
DEFINE_INPUTFUNC(FIELD_VOID, "AngleVectorRight", InputAngleVectorRight),
|
||||
DEFINE_INPUTFUNC(FIELD_VOID, "AngleVectorUp", InputAngleVectorUp),
|
||||
|
||||
DEFINE_INPUTFUNC(FIELD_FLOAT, "SetX", InputSetX),
|
||||
DEFINE_INPUTFUNC(FIELD_FLOAT, "SetY", InputSetY),
|
||||
@@ -4918,6 +4938,68 @@ void CMathVector::InputDisable( inputdata_t &inputdata )
|
||||
m_bDisabled = true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
void CMathVector::PointAt( Vector &origin, Vector &target, Vector &out )
|
||||
{
|
||||
out = origin - target;
|
||||
VectorNormalize( out );
|
||||
|
||||
QAngle ang;
|
||||
VectorAngles( out, ang );
|
||||
|
||||
out[0] = ang[0];
|
||||
out[1] = ang[1];
|
||||
out[2] = ang[2];
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
void CMathVector::InputPointAtLocation( inputdata_t &inputdata )
|
||||
{
|
||||
if( m_bDisabled )
|
||||
{
|
||||
DevMsg("Math Vector %s ignoring POINTATLOCATION because it is disabled\n", GetDebugName() );
|
||||
return;
|
||||
}
|
||||
|
||||
Vector cur;
|
||||
m_OutValue.Get(cur);
|
||||
|
||||
Vector location;
|
||||
inputdata.value.Vector3D( location );
|
||||
|
||||
PointAt( cur, location, cur );
|
||||
|
||||
UpdateOutValue( inputdata.pActivator, cur );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
void CMathVector::InputPointAtEntity( inputdata_t &inputdata )
|
||||
{
|
||||
if( m_bDisabled )
|
||||
{
|
||||
DevMsg("Math Vector %s ignoring POINTATENTITY because it is disabled\n", GetDebugName() );
|
||||
return;
|
||||
}
|
||||
|
||||
if (!inputdata.value.Entity())
|
||||
{
|
||||
Warning("%s received no entity to point at\n", GetDebugName());
|
||||
return;
|
||||
}
|
||||
|
||||
Vector cur;
|
||||
m_OutValue.Get(cur);
|
||||
|
||||
Vector location = inputdata.value.Entity()->GetAbsOrigin();
|
||||
|
||||
PointAt( cur, location, cur );
|
||||
|
||||
UpdateOutValue( inputdata.pActivator, cur );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
void CMathVector::InputNormalize( inputdata_t &inputdata )
|
||||
@@ -4952,6 +5034,71 @@ void CMathVector::InputNormalizeAngles( inputdata_t &inputdata )
|
||||
UpdateOutValue( inputdata.pActivator, cur );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
void CMathVector::InputVectorAngles( inputdata_t &inputdata )
|
||||
{
|
||||
if( m_bDisabled )
|
||||
{
|
||||
DevMsg("Math Vector %s ignoring VECTORANGLES because it is disabled\n", GetDebugName() );
|
||||
return;
|
||||
}
|
||||
|
||||
Vector cur;
|
||||
QAngle ang;
|
||||
m_OutValue.Get(cur);
|
||||
VectorAngles(cur, ang);
|
||||
UpdateOutValue( inputdata.pActivator, Vector(ang.x, ang.y, ang.z) );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
void CMathVector::InputAngleVectorForward( inputdata_t &inputdata )
|
||||
{
|
||||
if( m_bDisabled )
|
||||
{
|
||||
DevMsg("Math Vector %s ignoring ANGLEVECTORFORWARD because it is disabled\n", GetDebugName() );
|
||||
return;
|
||||
}
|
||||
|
||||
Vector cur;
|
||||
m_OutValue.Get(cur);
|
||||
AngleVectors(QAngle(cur.x, cur.y, cur.z), &cur);
|
||||
UpdateOutValue( inputdata.pActivator, cur );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
void CMathVector::InputAngleVectorRight( inputdata_t &inputdata )
|
||||
{
|
||||
if( m_bDisabled )
|
||||
{
|
||||
DevMsg("Math Vector %s ignoring ANGLEVECTORRIGHT because it is disabled\n", GetDebugName() );
|
||||
return;
|
||||
}
|
||||
|
||||
Vector cur;
|
||||
m_OutValue.Get(cur);
|
||||
AngleVectors(QAngle(cur.x, cur.y, cur.z), NULL, &cur, NULL);
|
||||
UpdateOutValue( inputdata.pActivator, cur );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
void CMathVector::InputAngleVectorUp( inputdata_t &inputdata )
|
||||
{
|
||||
if( m_bDisabled )
|
||||
{
|
||||
DevMsg("Math Vector %s ignoring ANGLEVECTORUP because it is disabled\n", GetDebugName() );
|
||||
return;
|
||||
}
|
||||
|
||||
Vector cur;
|
||||
m_OutValue.Get(cur);
|
||||
AngleVectors(QAngle(cur.x, cur.y, cur.z), NULL, NULL, &cur);
|
||||
UpdateOutValue( inputdata.pActivator, cur );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
void CMathVector::SetCoordinate(float value, char coord, CBaseEntity *pActivator)
|
||||
@@ -5041,6 +5188,13 @@ void CMathVector::SubtractCoordinate(float value, char coord, CBaseEntity *pActi
|
||||
//-----------------------------------------------------------------------------
|
||||
void CMathVector::UpdateOutValue(CBaseEntity *pActivator, Vector &vecNewValue)
|
||||
{
|
||||
if (HasSpawnFlags( SF_MATH_VECTOR_DISABLE_X ))
|
||||
vecNewValue.x = 0;
|
||||
if (HasSpawnFlags( SF_MATH_VECTOR_DISABLE_Y ))
|
||||
vecNewValue.y = 0;
|
||||
if (HasSpawnFlags( SF_MATH_VECTOR_DISABLE_Z ))
|
||||
vecNewValue.z = 0;
|
||||
|
||||
m_OutValue.Set(vecNewValue, pActivator, this);
|
||||
|
||||
m_OutX.Set(vecNewValue.x, pActivator, this);
|
||||
@@ -5422,6 +5576,7 @@ class CLogicModelInfo : public CLogicalEntity
|
||||
private:
|
||||
|
||||
CBaseAnimating *GetTarget(inputdata_t &inputdata);
|
||||
int GetPoseParameterIndex(CBaseAnimating *pTarget);
|
||||
|
||||
// Inputs
|
||||
//void InputSetTarget( inputdata_t &inputdata ) { BaseClass::InputSetTarget(inputdata); m_hTarget = NULL; }
|
||||
@@ -5429,11 +5584,22 @@ private:
|
||||
void InputLookupSequence( inputdata_t &inputdata );
|
||||
void InputLookupActivity( inputdata_t &inputdata );
|
||||
|
||||
void InputSetPoseParameterName( inputdata_t &inputdata );
|
||||
void InputSetPoseParameterValue( inputdata_t &inputdata );
|
||||
void InputGetPoseParameter( inputdata_t &inputdata );
|
||||
|
||||
// Outputs
|
||||
COutputInt m_OutNumSkins;
|
||||
COutputInt m_OnHasSequence;
|
||||
COutputEvent m_OnLacksSequence;
|
||||
|
||||
COutputFloat m_OutPoseParameterValue;
|
||||
|
||||
// KeyValues
|
||||
|
||||
string_t m_iszPoseParameterName;
|
||||
int m_iPoseParameterIndex = -1;
|
||||
|
||||
DECLARE_DATADESC();
|
||||
};
|
||||
|
||||
@@ -5442,15 +5608,22 @@ LINK_ENTITY_TO_CLASS(logic_modelinfo, CLogicModelInfo);
|
||||
|
||||
BEGIN_DATADESC( CLogicModelInfo )
|
||||
|
||||
DEFINE_KEYFIELD( m_iszPoseParameterName, FIELD_STRING, "PoseParameterName" ),
|
||||
DEFINE_FIELD( m_iPoseParameterIndex, FIELD_INTEGER ),
|
||||
|
||||
// Inputs
|
||||
DEFINE_INPUTFUNC( FIELD_VOID, "GetNumSkins", InputGetNumSkins ),
|
||||
DEFINE_INPUTFUNC( FIELD_STRING, "LookupSequence", InputLookupSequence ),
|
||||
DEFINE_INPUTFUNC( FIELD_STRING, "LookupActivity", InputLookupActivity ),
|
||||
DEFINE_INPUTFUNC( FIELD_STRING, "SetPoseParameterName", InputSetPoseParameterName ),
|
||||
DEFINE_INPUTFUNC( FIELD_FLOAT, "SetPoseParameterValue", InputSetPoseParameterValue ),
|
||||
DEFINE_INPUTFUNC( FIELD_VOID, "GetPoseParameter", InputGetPoseParameter ),
|
||||
|
||||
// Outputs
|
||||
DEFINE_OUTPUT(m_OutNumSkins, "OutNumSkins"),
|
||||
DEFINE_OUTPUT(m_OnHasSequence, "OnHasSequence"),
|
||||
DEFINE_OUTPUT(m_OnLacksSequence, "OnLacksSequence"),
|
||||
DEFINE_OUTPUT(m_OutPoseParameterValue, "OutPoseParameterValue"),
|
||||
|
||||
END_DATADESC()
|
||||
|
||||
@@ -5464,6 +5637,15 @@ inline CBaseAnimating *CLogicModelInfo::GetTarget(inputdata_t &inputdata)
|
||||
return pEntity->GetBaseAnimating();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
inline int CLogicModelInfo::GetPoseParameterIndex(CBaseAnimating *pTarget)
|
||||
{
|
||||
if (m_iPoseParameterIndex == -1)
|
||||
m_iPoseParameterIndex = pTarget->LookupPoseParameter(STRING(m_iszPoseParameterName));
|
||||
return m_iPoseParameterIndex;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
void CLogicModelInfo::InputGetNumSkins( inputdata_t &inputdata )
|
||||
@@ -5519,6 +5701,55 @@ void CLogicModelInfo::InputLookupActivity( inputdata_t &inputdata )
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
void CLogicModelInfo::InputSetPoseParameterName( inputdata_t &inputdata )
|
||||
{
|
||||
m_iszPoseParameterName = inputdata.value.StringID();
|
||||
m_iPoseParameterIndex = -1;
|
||||
|
||||
CBaseAnimating *pAnimating = GetTarget(inputdata);
|
||||
if (pAnimating && pAnimating->GetModelPtr())
|
||||
{
|
||||
if (GetPoseParameterIndex(pAnimating) == -1)
|
||||
Warning("%s: Pose parameter \"%s\" does not exist on %s\n", GetDebugName(), inputdata.value.String(), STRING(pAnimating->GetModelName()));
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
void CLogicModelInfo::InputSetPoseParameterValue( inputdata_t &inputdata )
|
||||
{
|
||||
CBaseAnimating *pAnimating = GetTarget(inputdata);
|
||||
if (pAnimating && pAnimating->GetModelPtr())
|
||||
{
|
||||
int index = GetPoseParameterIndex(pAnimating);
|
||||
if (index != -1)
|
||||
{
|
||||
pAnimating->SetPoseParameter( index, inputdata.value.Float() );
|
||||
}
|
||||
else
|
||||
Warning("%s: Pose parameter \"%s\" does not exist on %s\n", GetDebugName(), STRING(m_iszPoseParameterName), STRING(pAnimating->GetModelName()));
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
void CLogicModelInfo::InputGetPoseParameter( inputdata_t &inputdata )
|
||||
{
|
||||
CBaseAnimating *pAnimating = GetTarget(inputdata);
|
||||
if (pAnimating && pAnimating->GetModelPtr())
|
||||
{
|
||||
int index = GetPoseParameterIndex(pAnimating);
|
||||
if (index != -1)
|
||||
{
|
||||
m_OutPoseParameterValue.Set( pAnimating->GetPoseParameter( index ), pAnimating, this );
|
||||
}
|
||||
else
|
||||
Warning("%s: Pose parameter \"%s\" does not exist on %s\n", GetDebugName(), inputdata.value.String(), STRING(pAnimating->GetModelName()));
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Checks and calculates an entity's position.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user