Mapbase v4.3

- Fixed a crash with multiple trigger_look targets
- Fixed an issue where some zombie submodel server ragdolls are not solid to the world
- Fixed a crash with certain instance classes being loaded in a savegame before the class is registered
- Added some of Tony Sergi's missing Source 2007 fixes (contributed by Kris)
- Added "ClientCommand" hook for VScript to allow handling of unknown console commands
- Added "PlayerRunCommand" hook for VScript to control player movement
- Added new button-related script functions for players (GetButtons, DisableButtons, etc.)
- Added CUserCmd accessor in VScript for the "PlayerRunCommand" hook
- Added "GetWaterLevel" function for VScript
- Exposed "Ignite" to VScript for controlling how a fire starts
- Fixed NPCs being unable to unholster weapons
- Fixed Mapbase crashing when Steam isn't running
- Fixed issues with angled/updating sky_camera save/restore
- Added VBSP "-skyboxcubemap" parameter to enable skybox default cubemaps + "-defaultcubemapres" to control their resolution
- Added ability to disable VScript in a map (and fixed a few potential complications from disabling VScript)
- Made clientside VScript only initialize after world is spawned in order to receive serverside script language in time
- Added tons of VScript functions to CBaseAnimating related to bodygroups, sequences, etc.
- Added VScript functions to players for getting user ID and player name, similar to logic_playerinfo
- Added a few L4D2 script functions missing from the ASW SDK
- Added "Localize" singleton with a single "GetTokenAsUTF8" function for getting localization strings
- Disabled r_hunkalloclightmaps by the request of various users (apparently this completely removes the "Engine hunk overflow" error and allows for really high-res lightmaps)
- Fixed npc_antlionguard NPC_TranslateActivity not hooking into base class (allows for VScript manipulation)
- Added various unused antlion guard activities to npc_antlionguard AI, allowing for usage as registered activities
- Added keyvalue to set LOS mask on combine_mine
- Added +USE bounding box limiter to prop_interactable
This commit is contained in:
Blixibon
2020-07-16 15:43:30 +00:00
parent f636089003
commit 63323222fe
76 changed files with 1575 additions and 359 deletions

View File

@@ -32,6 +32,9 @@
#include "gib.h"
#include "CRagdollMagnet.h"
#endif
#ifdef MAPBASE_VSCRIPT
#include "mapbase/vscript_funcs_math.h"
#endif
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
@@ -293,11 +296,36 @@ BEGIN_ENT_SCRIPTDESC( CBaseAnimating, CBaseEntity, "Animating models" )
DEFINE_SCRIPTFUNC_NAMED( ScriptSetPoseParameter, "SetPoseParameter", "Set the specified pose parameter to the specified value" )
DEFINE_SCRIPTFUNC( LookupBone, "Get the named bone id" )
DEFINE_SCRIPTFUNC_NAMED( ScriptGetBoneTransform, "GetBoneTransform", "Get the transform for the specified bone" )
DEFINE_SCRIPTFUNC( Dissolve, "" )
DEFINE_SCRIPTFUNC( Scorch, "Makes the entity darker from scorching" )
DEFINE_SCRIPTFUNC( GetPhysicsBone, "Get physics bone from bone index" )
DEFINE_SCRIPTFUNC( GetNumBones, "Get the number of bones" )
DEFINE_SCRIPTFUNC( GetSequence, "Gets the current sequence" )
DEFINE_SCRIPTFUNC( SetSequence, "Sets the current sequence" )
DEFINE_SCRIPTFUNC( SequenceLoops, "Loops the current sequence" )
DEFINE_SCRIPTFUNC( LookupSequence, "Gets the index of the specified sequence name" )
DEFINE_SCRIPTFUNC( LookupActivity, "Gets the ID of the specified activity name" )
DEFINE_SCRIPTFUNC_NAMED( HasMovement, "SequenceHasMovement", "Checks if the specified sequence has movement" )
DEFINE_SCRIPTFUNC( GetSequenceMoveYaw, "Gets the move yaw of the specified sequence" )
DEFINE_SCRIPTFUNC_NAMED( ScriptGetSequenceMoveDist, "GetSequenceMoveDist", "Gets the move distance of the specified sequence" )
DEFINE_SCRIPTFUNC( GetSequenceName, "Gets the name of the specified sequence index" )
DEFINE_SCRIPTFUNC( GetSequenceActivityName, "Gets the activity name of the specified sequence index" )
DEFINE_SCRIPTFUNC_NAMED( ScriptGetSequenceActivity, "GetSequenceActivity", "Gets the activity ID of the specified sequence index" )
DEFINE_SCRIPTFUNC_NAMED( ScriptSelectWeightedSequence, "SelectWeightedSequence", "Selects a sequence for the specified activity ID" )
DEFINE_SCRIPTFUNC_NAMED( ScriptSelectHeaviestSequence, "SelectHeaviestSequence", "Selects the sequence with the heaviest weight for the specified activity ID" )
DEFINE_SCRIPTFUNC_NAMED( ScriptGetSequenceKeyValues, "GetSequenceKeyValues", "Get a KeyValue class instance on the specified sequence. WARNING: This uses the same KeyValue pointer as GetModelKeyValues!" )
#endif
DEFINE_SCRIPTFUNC( IsSequenceFinished, "Ask whether the main sequence is done playing" )
DEFINE_SCRIPTFUNC( SetBodygroup, "Sets a bodygroup")
#ifdef MAPBASE_VSCRIPT
DEFINE_SCRIPTFUNC( GetBodygroup, "Gets a bodygroup" )
DEFINE_SCRIPTFUNC( GetBodygroupName, "Gets a bodygroup name" )
DEFINE_SCRIPTFUNC( FindBodygroupByName, "Finds a bodygroup by name" )
DEFINE_SCRIPTFUNC( GetBodygroupCount, "Gets the number of models in a bodygroup" )
DEFINE_SCRIPTFUNC( GetNumBodyGroups, "Gets the number of bodygroups" )
DEFINE_SCRIPTFUNC( Dissolve, "" )
DEFINE_SCRIPTFUNC( Ignite, "" )
DEFINE_SCRIPTFUNC( Scorch, "Makes the entity darker from scorching" )
#endif
END_SCRIPTDESC();
CBaseAnimating::CBaseAnimating()
@@ -2193,8 +2221,6 @@ void CBaseAnimating::ScriptSetPoseParameter( const char* szName, float fValue )
SetPoseParameter( pHdr, iPoseParam, fValue );
}
extern matrix3x4_t *ToMatrix3x4( HSCRIPT hMat );
void CBaseAnimating::ScriptGetBoneTransform( int iBone, HSCRIPT hTransform )
{
if (hTransform == NULL)
@@ -2202,6 +2228,30 @@ void CBaseAnimating::ScriptGetBoneTransform( int iBone, HSCRIPT hTransform )
GetBoneTransform( iBone, *ToMatrix3x4( hTransform ) );
}
//-----------------------------------------------------------------------------
// VScript access to sequence's key values
// for iteration and value access, use:
// ScriptFindKey, ScriptGetFirstSubKey, ScriptGetString,
// ScriptGetInt, ScriptGetFloat, ScriptGetNextKey
// NOTE: This is recycled from ScriptGetModelKeyValues() and uses its pointer!!!
//-----------------------------------------------------------------------------
HSCRIPT CBaseAnimating::ScriptGetSequenceKeyValues( int iSequence )
{
KeyValues *pSeqKeyValues = GetSequenceKeyValues( iSequence );
HSCRIPT hScript = NULL;
if ( pSeqKeyValues )
{
// UNDONE: how does destructor get called on this
m_pScriptModelKeyValues = new CScriptKeyValues( pSeqKeyValues );
// UNDONE: who calls ReleaseInstance on this??? Does name need to be unique???
hScript = g_pScriptVM->RegisterInstance( m_pScriptModelKeyValues );
}
return hScript;
}
#endif
//-----------------------------------------------------------------------------