Skip to content

Commit fd600b5

Browse files
authored
Mapbase v6.2 - Merge pull request #94 from mapbase-source/develop
2 parents 6ba3cd4 + 14d3ee1 commit fd600b5

46 files changed

Lines changed: 2991 additions & 1423 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ interchangeable arms; this may change in the future)
8383
- https://developer.valvesoftware.com/wiki/Npc_clawscanner#Strider_Scout_Issue (npc_clawscanner strider scout fix)
8484
- https://developer.valvesoftware.com/wiki/Ambient_generic:_stop_and_toggle_fix (Fixes for stopping/toggling ambient_generic)
8585
- https://developer.valvesoftware.com/wiki/Func_clip_vphysics ("Start Disabled" keyvalue fix)
86+
- https://developer.valvesoftware.com/wiki/Importing_CSS_Weapons_Into_HL2 (CS:S viewmodel chirality)
8687

8788
//---------------------------------------------------------------------------------------------------------------------------------------------------
8889

@@ -91,16 +92,20 @@ Direct contributions:
9192
- https://github.com/mapbase-source/source-sdk-2013/pull/5 (Custom VScript implementation by ReDucTor; was placed into feature branch before being merged in a subsequent PR)
9293
- https://github.com/mapbase-source/source-sdk-2013/pull/3 ("playvideo" command playback fix from Avantate)
9394
- https://github.com/mapbase-source/source-sdk-2013/pull/21 (Various GCC/Linux fixes from z33ky)
94-
- https://github.com/mapbase-source/source-sdk-2013/pull/47 (VScript utility/consistency changes from samisalreadytaken)
95-
- https://github.com/mapbase-source/source-sdk-2013/pull/59 (New VScript functions and singletons from samisalreadytaken based on API documentation in later Source/Source 2 games)
9695
- https://github.com/mapbase-source/source-sdk-2013/pull/60 (Adjustment by RoyaleNoir to one of Saul's VDC changes)
96+
- https://github.com/mapbase-source/source-sdk-2013/pull/84 (CS:S viewmodel chirality from 1upD)
9797
- Demo autorecord code provided by Klems
9898
- cc_emit crash fix provided by 1upD
9999
- Custom HL2 ammo crate models created by Rara (Textures created by Blixibon; This is asset-based and, aside from the SLAM crate, not reflected in the code)
100100
- Combine lock hardware on door01_left.mdl created by Kralich (This is asset-based and not reflected in the code)
101101
- npc_vehicledriver fixes provided by CrAzY
102102
- npc_combine cover behavior patches provided by iohnnyboy
103103

104+
== Contributions from samisalreadytaken:
105+
=-- https://github.com/mapbase-source/source-sdk-2013/pull/47 (VScript utility/consistency changes)
106+
=-- https://github.com/mapbase-source/source-sdk-2013/pull/59 (New VScript functions and singletons based on API documentation in later Source/Source 2 games)
107+
=-- https://github.com/mapbase-source/source-sdk-2013/pull/80 (More VScript changes, including support for extremely flexible client/server messaging)
108+
104109
//---------------------------------------------------------------------------------------------------------------------------------------------------
105110

106111
Other sources:

sp/src/fgdlib/gamedata.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,11 @@ bool GameData::RemapNameField( const char *pszInValue, char *pszOutValue, TNameF
813813
{
814814
strcpy( pszOutValue, pszInValue );
815815

816+
#ifdef MAPBASE
817+
if ( pszInValue[ 0 ] && pszInValue[ 0 ] != '@' && pszInValue[ 0 ] != '!' )
818+
#else
816819
if ( pszInValue[ 0 ] && pszInValue[ 0 ] != '@' )
820+
#endif
817821
{ // ! at the start of a value means it is global and should not be remaped
818822
switch( NameFixup )
819823
{

sp/src/game/client/c_baseanimating.cpp

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,35 @@ BEGIN_DATADESC( C_ClientRagdoll )
281281

282282
END_DATADESC()
283283

284+
#ifdef MAPBASE_VSCRIPT
285+
BEGIN_ENT_SCRIPTDESC( C_ClientRagdoll, C_BaseAnimating, "Client-side ragdolls" )
286+
287+
DEFINE_SCRIPTFUNC_NAMED( SUB_Remove, "FadeOut", "Fades out the ragdoll and removes it from the client." )
288+
289+
// TODO: Proper shared ragdoll funcs?
290+
DEFINE_SCRIPTFUNC_NAMED( ScriptGetRagdollObject, "GetRagdollObject", "Gets the ragdoll object of the specified index." )
291+
DEFINE_SCRIPTFUNC_NAMED( ScriptGetRagdollObjectCount, "GetRagdollObjectCount", "Gets the number of ragdoll objects on this ragdoll." )
292+
293+
END_SCRIPTDESC();
294+
295+
ScriptHook_t C_BaseAnimating::g_Hook_OnClientRagdoll;
296+
#endif
297+
284298
BEGIN_ENT_SCRIPTDESC( C_BaseAnimating, C_BaseEntity, "Animating models client-side" )
285299
#ifdef MAPBASE_VSCRIPT
286300
DEFINE_SCRIPTFUNC_NAMED( ScriptGetPoseParameter, "GetPoseParameter", "Get the specified pose parameter's value" )
287301
#endif
288302
DEFINE_SCRIPTFUNC_NAMED( ScriptSetPoseParameter, "SetPoseParameter", "Set the specified pose parameter to the specified value" )
289303
DEFINE_SCRIPTFUNC( IsSequenceFinished, "Ask whether the main sequence is done playing" )
290304
#ifdef MAPBASE_VSCRIPT
305+
DEFINE_SCRIPTFUNC_NAMED( ScriptLookupAttachment, "LookupAttachment", "Get the named attachement id" )
306+
DEFINE_SCRIPTFUNC_NAMED( ScriptGetAttachmentOrigin, "GetAttachmentOrigin", "Get the attachement id's origin vector" )
307+
DEFINE_SCRIPTFUNC_NAMED( ScriptGetAttachmentAngles, "GetAttachmentAngles", "Get the attachement id's angles as a p,y,r vector" )
308+
DEFINE_SCRIPTFUNC_NAMED( ScriptGetAttachmentMatrix, "GetAttachmentMatrix", "Get the attachement id's matrix transform" )
309+
310+
DEFINE_SCRIPTFUNC( LookupBone, "Get the named bone id" )
311+
DEFINE_SCRIPTFUNC_NAMED( ScriptGetBoneTransform, "GetBoneTransform", "Get the transform for the specified bone" )
312+
291313
DEFINE_SCRIPTFUNC( SetBodygroup, "Sets a bodygroup")
292314
DEFINE_SCRIPTFUNC( GetBodygroup, "Gets a bodygroup" )
293315
DEFINE_SCRIPTFUNC( GetBodygroupName, "Gets a bodygroup name" )
@@ -302,7 +324,28 @@ BEGIN_ENT_SCRIPTDESC( C_BaseAnimating, C_BaseEntity, "Animating models client-si
302324
DEFINE_SCRIPTFUNC( LookupActivity, "Gets the ID of the specified activity name" )
303325
DEFINE_SCRIPTFUNC( GetSequenceName, "Gets the name of the specified sequence index" )
304326
DEFINE_SCRIPTFUNC( GetSequenceActivityName, "Gets the activity name of the specified sequence index" )
327+
DEFINE_SCRIPTFUNC_NAMED( ScriptGetSequenceMoveDist, "GetSequenceMoveDist", "Gets the move distance of the specified sequence" )
305328
DEFINE_SCRIPTFUNC_NAMED( ScriptGetSequenceActivity, "GetSequenceActivity", "Gets the activity ID of the specified sequence index" )
329+
DEFINE_SCRIPTFUNC_NAMED( ScriptSelectWeightedSequence, "SelectWeightedSequence", "Selects a sequence for the specified activity ID" )
330+
331+
DEFINE_SCRIPTFUNC( GetPlaybackRate, "" )
332+
DEFINE_SCRIPTFUNC( SetPlaybackRate, "" )
333+
DEFINE_SCRIPTFUNC( GetCycle, "" )
334+
DEFINE_SCRIPTFUNC( SetCycle, "" )
335+
DEFINE_SCRIPTFUNC_NAMED( ScriptGetSkin, "GetSkin", "Gets the model's skin" )
336+
DEFINE_SCRIPTFUNC( SetSkin, "Sets the model's skin" )
337+
338+
DEFINE_SCRIPTFUNC( GetForceBone, "Gets the entity's force bone, which is used to determine which bone a ragdoll should apply its force to." )
339+
DEFINE_SCRIPTFUNC( SetForceBone, "Sets the entity's force bone, which is used to determine which bone a ragdoll should apply its force to." )
340+
DEFINE_SCRIPTFUNC( GetRagdollForce, "Gets the entity's ragdoll force, which is used to apply velocity to a ragdoll." )
341+
DEFINE_SCRIPTFUNC( SetRagdollForce, "Sets the entity's ragdoll force, which is used to apply velocity to a ragdoll." )
342+
343+
DEFINE_SCRIPTFUNC_NAMED( ScriptBecomeRagdollOnClient, "BecomeRagdollOnClient", "" )
344+
DEFINE_SCRIPTFUNC( IsRagdoll, "" )
345+
346+
BEGIN_SCRIPTHOOK( C_BaseAnimating::g_Hook_OnClientRagdoll, "OnClientRagdoll", FIELD_VOID, "Called when this entity turns into a client-side ragdoll." )
347+
DEFINE_SCRIPTHOOK_PARAM( "ragdoll", FIELD_HSCRIPT )
348+
END_SCRIPTHOOK()
306349
#endif
307350
END_SCRIPTDESC();
308351

@@ -666,6 +709,24 @@ void C_ClientRagdoll::Release( void )
666709
BaseClass::Release();
667710
}
668711

712+
#ifdef MAPBASE_VSCRIPT
713+
HSCRIPT C_ClientRagdoll::ScriptGetRagdollObject( int iIndex )
714+
{
715+
if (iIndex < 0 || iIndex > m_pRagdoll->RagdollBoneCount())
716+
{
717+
Warning("%s GetRagdollObject: Index %i not valid (%i objects)\n", GetDebugName(), iIndex, m_pRagdoll->RagdollBoneCount());
718+
return NULL;
719+
}
720+
721+
return g_pScriptVM->RegisterInstance( m_pRagdoll->GetElement(iIndex) );
722+
}
723+
724+
int C_ClientRagdoll::ScriptGetRagdollObjectCount()
725+
{
726+
return m_pRagdoll->RagdollBoneCount();
727+
}
728+
#endif
729+
669730
//-----------------------------------------------------------------------------
670731
// Incremented each frame in InvalidateModelBones. Models compare this value to what it
671732
// was last time they setup their bones to determine if they need to re-setup their bones.
@@ -1429,6 +1490,61 @@ float C_BaseAnimating::ClampCycle( float flCycle, bool isLooping )
14291490
}
14301491

14311492
#ifdef MAPBASE_VSCRIPT
1493+
//-----------------------------------------------------------------------------
1494+
// Purpose: Returns the world location and world angles of an attachment to vscript caller
1495+
// Input : attachment name
1496+
// Output : location and angles
1497+
//-----------------------------------------------------------------------------
1498+
const Vector& C_BaseAnimating::ScriptGetAttachmentOrigin( int iAttachment )
1499+
{
1500+
1501+
static Vector absOrigin;
1502+
static QAngle qa;
1503+
1504+
C_BaseAnimating::GetAttachment( iAttachment, absOrigin, qa );
1505+
1506+
return absOrigin;
1507+
}
1508+
1509+
const Vector& C_BaseAnimating::ScriptGetAttachmentAngles( int iAttachment )
1510+
{
1511+
1512+
static Vector absOrigin;
1513+
static Vector absAngles;
1514+
static QAngle qa;
1515+
1516+
C_BaseAnimating::GetAttachment( iAttachment, absOrigin, qa );
1517+
absAngles.x = qa.x;
1518+
absAngles.y = qa.y;
1519+
absAngles.z = qa.z;
1520+
return absAngles;
1521+
}
1522+
1523+
HSCRIPT C_BaseAnimating::ScriptGetAttachmentMatrix( int iAttachment )
1524+
{
1525+
static matrix3x4_t matrix;
1526+
1527+
C_BaseAnimating::GetAttachment( iAttachment, matrix );
1528+
return g_pScriptVM->RegisterInstance( &matrix );
1529+
}
1530+
1531+
void C_BaseAnimating::ScriptGetBoneTransform( int iBone, HSCRIPT hTransform )
1532+
{
1533+
if (hTransform == NULL)
1534+
return;
1535+
1536+
GetBoneTransform( iBone, *HScriptToClass<matrix3x4_t>( hTransform ) );
1537+
}
1538+
1539+
HSCRIPT C_BaseAnimating::ScriptBecomeRagdollOnClient()
1540+
{
1541+
C_BaseAnimating *pRagdoll = BecomeRagdollOnClient();
1542+
if (!pRagdoll)
1543+
return NULL;
1544+
1545+
return pRagdoll->GetScriptInstance();
1546+
}
1547+
14321548
float C_BaseAnimating::ScriptGetPoseParameter( const char* szName )
14331549
{
14341550
CStudioHdr* pHdr = GetModelPtr();
@@ -4736,6 +4852,17 @@ C_BaseAnimating *C_BaseAnimating::BecomeRagdollOnClient()
47364852
const float boneDt = 0.1f;
47374853
GetRagdollInitBoneArrays( boneDelta0, boneDelta1, currentBones, boneDt );
47384854
pRagdoll->InitAsClientRagdoll( boneDelta0, boneDelta1, currentBones, boneDt );
4855+
4856+
#ifdef MAPBASE_VSCRIPT
4857+
// Hook for ragdolling
4858+
if (m_ScriptScope.IsInitialized() && g_Hook_OnClientRagdoll.CanRunInScope( m_ScriptScope ))
4859+
{
4860+
// ragdoll
4861+
ScriptVariant_t args[] = { ScriptVariant_t( pRagdoll->GetScriptInstance() ) };
4862+
g_Hook_OnClientRagdoll.Call( m_ScriptScope, NULL, args );
4863+
}
4864+
#endif
4865+
47394866
return pRagdoll;
47404867
}
47414868

sp/src/game/client/c_baseanimating.h

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,30 @@ class C_BaseAnimating : public C_BaseEntity, private IModelLoadCallback
454454
virtual bool IsViewModel() const;
455455

456456
#ifdef MAPBASE_VSCRIPT
457+
int ScriptLookupAttachment( const char *pAttachmentName ) { return LookupAttachment( pAttachmentName ); }
458+
const Vector& ScriptGetAttachmentOrigin(int iAttachment);
459+
const Vector& ScriptGetAttachmentAngles(int iAttachment);
460+
HSCRIPT ScriptGetAttachmentMatrix(int iAttachment);
461+
462+
void ScriptGetBoneTransform( int iBone, HSCRIPT hTransform );
463+
464+
int ScriptGetSequenceActivity( int iSequence ) { return GetSequenceActivity( iSequence ); }
465+
float ScriptGetSequenceMoveDist( int iSequence ) { return GetSequenceMoveDist( GetModelPtr(), iSequence ); }
466+
int ScriptSelectWeightedSequence( int activity ) { return SelectWeightedSequence( (Activity)activity ); }
467+
468+
// For VScript
469+
int ScriptGetSkin() { return GetSkin(); }
470+
void SetSkin( int iSkin ) { m_nSkin = iSkin; }
471+
472+
int GetForceBone() { return m_nForceBone; }
473+
void SetForceBone( int iBone ) { m_nForceBone = iBone; }
474+
const Vector& GetRagdollForce() { return m_vecForce; }
475+
void SetRagdollForce( const Vector &vecForce ) { m_vecForce = vecForce; }
476+
477+
HSCRIPT ScriptBecomeRagdollOnClient();
478+
479+
static ScriptHook_t g_Hook_OnClientRagdoll;
480+
457481
float ScriptGetPoseParameter(const char* szName);
458482
#endif
459483
void ScriptSetPoseParameter(const char* szName, float fValue);
@@ -475,10 +499,6 @@ class C_BaseAnimating : public C_BaseEntity, private IModelLoadCallback
475499

476500
virtual bool CalcAttachments();
477501

478-
#ifdef MAPBASE_VSCRIPT
479-
int ScriptGetSequenceActivity( int iSequence ) { return GetSequenceActivity( iSequence ); }
480-
#endif
481-
482502
private:
483503
// This method should return true if the bones have changed + SetupBones needs to be called
484504
virtual float LastBoneChangedTime() { return FLT_MAX; }
@@ -667,6 +687,9 @@ class C_ClientRagdoll : public C_BaseAnimating, public IPVSNotify
667687
C_ClientRagdoll( bool bRestoring = true );
668688
DECLARE_CLASS( C_ClientRagdoll, C_BaseAnimating );
669689
DECLARE_DATADESC();
690+
#ifdef MAPBASE_VSCRIPT
691+
DECLARE_ENT_SCRIPTDESC();
692+
#endif
670693

671694
// inherited from IPVSNotify
672695
virtual void OnPVSStatusChanged( bool bInPVS );
@@ -688,6 +711,11 @@ class C_ClientRagdoll : public C_BaseAnimating, public IPVSNotify
688711
void FadeOut( void );
689712
virtual float LastBoneChangedTime();
690713

714+
#ifdef MAPBASE_VSCRIPT
715+
HSCRIPT ScriptGetRagdollObject( int iIndex );
716+
int ScriptGetRagdollObjectCount();
717+
#endif
718+
691719
bool m_bFadeOut;
692720
bool m_bImportant;
693721
float m_flEffectTime;

sp/src/game/client/c_baseentity.cpp

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ BEGIN_RECV_TABLE_NOBASE( C_BaseEntity, DT_AnimTimeMustBeFirst )
429429
END_RECV_TABLE()
430430

431431
BEGIN_ENT_SCRIPTDESC_ROOT( C_BaseEntity, "Root class of all client-side entities" )
432+
DEFINE_SCRIPT_INSTANCE_HELPER( &g_BaseEntityScriptInstanceHelper )
432433
DEFINE_SCRIPTFUNC_NAMED( GetAbsOrigin, "GetOrigin", "" )
433434
DEFINE_SCRIPTFUNC_NAMED( ScriptGetForward, "GetForwardVector", "Get the forward vector of the entity" )
434435
#ifdef MAPBASE_VSCRIPT
@@ -442,6 +443,7 @@ BEGIN_ENT_SCRIPTDESC_ROOT( C_BaseEntity, "Root class of all client-side entities
442443

443444
#ifdef MAPBASE_VSCRIPT
444445
DEFINE_SCRIPTFUNC( ValidateScriptScope, "Ensure that an entity's script scope has been created" )
446+
DEFINE_SCRIPTFUNC( GetOrCreatePrivateScriptScope, "Create and retrieve the script-side data associated with an entity" )
445447
DEFINE_SCRIPTFUNC( GetScriptScope, "Retrieve the script-side data associated with an entity" )
446448

447449
DEFINE_SCRIPTFUNC( GetHealth, "" )
@@ -456,23 +458,92 @@ BEGIN_ENT_SCRIPTDESC_ROOT( C_BaseEntity, "Root class of all client-side entities
456458
DEFINE_SCRIPTFUNC( GetClassname, "" )
457459
DEFINE_SCRIPTFUNC_NAMED( GetEntityName, "GetName", "" )
458460

461+
DEFINE_SCRIPTFUNC_NAMED( SetAbsOrigin, "SetOrigin", "" )
462+
DEFINE_SCRIPTFUNC_NAMED( ScriptSetForward, "SetForwardVector", "Set the orientation of the entity to have this forward vector" )
463+
464+
DEFINE_SCRIPTFUNC( GetLocalOrigin, "GetLocalOrigin" )
465+
DEFINE_SCRIPTFUNC( SetLocalOrigin, "SetLocalOrigin" )
466+
DEFINE_SCRIPTFUNC( GetLocalAngles, "GetLocalAngles" )
467+
DEFINE_SCRIPTFUNC( SetLocalAngles, "SetLocalAngles" )
468+
459469
DEFINE_SCRIPTFUNC_NAMED( WorldSpaceCenter, "GetCenter", "Get vector to center of object - absolute coords" )
460470
DEFINE_SCRIPTFUNC_NAMED( ScriptEyePosition, "EyePosition", "Get vector to eye position - absolute coords" )
461-
DEFINE_SCRIPTFUNC_NAMED( ScriptGetAngles, "GetAngles", "Get entity pitch, yaw, roll as a vector" )
471+
DEFINE_SCRIPTFUNC_NAMED( ScriptEyeAngles, "EyeAngles", "Get eye pitch, yaw, roll as a vector" )
472+
DEFINE_SCRIPTFUNC_NAMED( GetAbsAngles, "GetAngles", "Get entity pitch, yaw, roll as a vector" )
473+
DEFINE_SCRIPTFUNC_NAMED( SetAbsAngles, "SetAngles", "Set entity pitch, yaw, roll" )
462474

463475
DEFINE_SCRIPTFUNC_NAMED( ScriptGetBoundingMins, "GetBoundingMins", "Get a vector containing min bounds, centered on object" )
464476
DEFINE_SCRIPTFUNC_NAMED( ScriptGetBoundingMaxs, "GetBoundingMaxs", "Get a vector containing max bounds, centered on object" )
465477

478+
DEFINE_SCRIPTFUNC_NAMED( ScriptEntityToWorldTransform, "EntityToWorldTransform", "Get the entity's transform" )
479+
480+
DEFINE_SCRIPTFUNC_NAMED( ScriptGetPhysicsObject, "GetPhysicsObject", "Get the entity's physics object if it has one" )
481+
482+
DEFINE_SCRIPTFUNC( GetWaterLevel, "Get current level of water submergence" )
483+
484+
DEFINE_SCRIPTFUNC_NAMED( ScriptSetParent, "SetParent", "" )
466485
DEFINE_SCRIPTFUNC_NAMED( ScriptGetMoveParent, "GetMoveParent", "If in hierarchy, retrieves the entity's parent" )
467486
DEFINE_SCRIPTFUNC_NAMED( ScriptGetRootMoveParent, "GetRootMoveParent", "If in hierarchy, walks up the hierarchy to find the root parent" )
468487
DEFINE_SCRIPTFUNC_NAMED( ScriptFirstMoveChild, "FirstMoveChild", "" )
469488
DEFINE_SCRIPTFUNC_NAMED( ScriptNextMovePeer, "NextMovePeer", "" )
470489

490+
DEFINE_SCRIPTFUNC_NAMED( ScriptFollowEntity, "FollowEntity", "Begin following the specified entity. This makes this entity non-solid, parents it to the target entity, and teleports it to the specified entity's origin. The second parameter is whether or not to use bonemerging while following." )
491+
DEFINE_SCRIPTFUNC( StopFollowingEntity, "Stops following an entity if we're following one." )
492+
DEFINE_SCRIPTFUNC( IsFollowingEntity, "Returns true if this entity is following another entity." )
493+
DEFINE_SCRIPTFUNC_NAMED( ScriptGetFollowedEntity, "GetFollowedEntity", "Get the entity we're following." )
494+
495+
DEFINE_SCRIPTFUNC_NAMED( GetScriptOwnerEntity, "GetOwner", "Gets this entity's owner" )
496+
DEFINE_SCRIPTFUNC_NAMED( SetScriptOwnerEntity, "SetOwner", "Sets this entity's owner" )
497+
498+
DEFINE_SCRIPTFUNC_NAMED( ScriptGetColorVector, "GetRenderColorVector", "Get the render color as a vector" )
499+
DEFINE_SCRIPTFUNC_NAMED( ScriptGetColorR, "GetRenderColorR", "Get the render color's R value" )
500+
DEFINE_SCRIPTFUNC_NAMED( ScriptGetColorG, "GetRenderColorG", "Get the render color's G value" )
501+
DEFINE_SCRIPTFUNC_NAMED( ScriptGetColorB, "GetRenderColorB", "Get the render color's B value" )
502+
DEFINE_SCRIPTFUNC_NAMED( ScriptGetAlpha, "GetRenderAlpha", "Get the render color's alpha value" )
503+
DEFINE_SCRIPTFUNC_NAMED( ScriptSetColorVector, "SetRenderColorVector", "Set the render color as a vector" )
504+
DEFINE_SCRIPTFUNC_NAMED( ScriptSetColor, "SetRenderColor", "Set the render color" )
505+
DEFINE_SCRIPTFUNC_NAMED( ScriptSetColorR, "SetRenderColorR", "Set the render color's R value" )
506+
DEFINE_SCRIPTFUNC_NAMED( ScriptSetColorG, "SetRenderColorG", "Set the render color's G value" )
507+
DEFINE_SCRIPTFUNC_NAMED( ScriptSetColorB, "SetRenderColorB", "Set the render color's B value" )
508+
DEFINE_SCRIPTFUNC_NAMED( ScriptSetAlpha, "SetRenderAlpha", "Set the render color's alpha value" )
509+
510+
DEFINE_SCRIPTFUNC_NAMED( ScriptGetRenderMode, "GetRenderMode", "Get render mode" )
511+
DEFINE_SCRIPTFUNC_NAMED( ScriptSetRenderMode, "SetRenderMode", "Set render mode" )
512+
471513
DEFINE_SCRIPTFUNC( GetEffects, "Get effects" )
514+
DEFINE_SCRIPTFUNC( AddEffects, "Add effect(s)" )
515+
DEFINE_SCRIPTFUNC( RemoveEffects, "Remove effect(s)" )
516+
DEFINE_SCRIPTFUNC( ClearEffects, "Clear effect(s)" )
517+
DEFINE_SCRIPTFUNC( SetEffects, "Set effect(s)" )
472518
DEFINE_SCRIPTFUNC( IsEffectActive, "Check if an effect is active" )
473519

520+
DEFINE_SCRIPTFUNC( GetFlags, "Get flags" )
521+
DEFINE_SCRIPTFUNC( AddFlag, "Add flag" )
522+
DEFINE_SCRIPTFUNC( RemoveFlag, "Remove flag" )
523+
524+
DEFINE_SCRIPTFUNC( GetEFlags, "Get Eflags" )
525+
DEFINE_SCRIPTFUNC( AddEFlags, "Add Eflags" )
526+
DEFINE_SCRIPTFUNC( RemoveEFlags, "Remove Eflags" )
527+
528+
DEFINE_SCRIPTFUNC_NAMED( ScriptGetMoveType, "GetMoveType", "Get the move type" )
529+
DEFINE_SCRIPTFUNC_NAMED( ScriptSetMoveType, "SetMoveType", "Set the move type" )
530+
531+
DEFINE_SCRIPTFUNC( GetCollisionGroup, "Get the collision group" )
532+
DEFINE_SCRIPTFUNC( SetCollisionGroup, "Set the collision group" )
533+
534+
DEFINE_SCRIPTFUNC( GetSolidFlags, "Get solid flags" )
535+
DEFINE_SCRIPTFUNC( AddSolidFlags, "Add solid flags" )
536+
DEFINE_SCRIPTFUNC( RemoveSolidFlags, "Remove solid flags" )
537+
538+
DEFINE_SCRIPTFUNC( IsPlayer, "Returns true if this entity is a player." )
539+
DEFINE_SCRIPTFUNC( IsNPC, "Returns true if this entity is a NPC." )
540+
//DEFINE_SCRIPTFUNC( IsCombatCharacter, "Returns true if this entity is a combat character (player or NPC)." )
541+
DEFINE_SCRIPTFUNC_NAMED( IsBaseCombatWeapon, "IsWeapon", "Returns true if this entity is a weapon." )
542+
DEFINE_SCRIPTFUNC( IsWorld, "Returns true if this entity is the world." )
543+
474544
DEFINE_SCRIPTFUNC_NAMED( GetEntityIndex, "entindex", "" )
475545
#endif
546+
476547
END_SCRIPTDESC();
477548

478549
#ifndef NO_ENTITY_PREDICTION
@@ -6060,6 +6131,9 @@ BEGIN_DATADESC_NO_BASE( C_BaseEntity )
60606131
DEFINE_FIELD( m_angAbsRotation, FIELD_VECTOR ),
60616132
DEFINE_ARRAY( m_rgflCoordinateFrame, FIELD_FLOAT, 12 ), // NOTE: MUST BE IN LOCAL SPACE, NOT POSITION_VECTOR!!! (see CBaseEntity::Restore)
60626133
DEFINE_FIELD( m_fFlags, FIELD_INTEGER ),
6134+
#ifdef MAPBASE_VSCRIPT
6135+
DEFINE_FIELD( m_iszScriptId, FIELD_STRING ),
6136+
#endif
60636137
END_DATADESC()
60646138

60656139
//-----------------------------------------------------------------------------

0 commit comments

Comments
 (0)