source-sdk-2013-mapbase/sp/src/game/server/vscript_server.cpp

782 lines
25 KiB
C++
Raw Normal View History

//========== Copyright <20> 2008, Valve Corporation, All rights reserved. ========
//
// Purpose:
//
//=============================================================================
#include "cbase.h"
#include "vscript_server.h"
#include "icommandline.h"
#include "tier1/utlbuffer.h"
#include "tier1/fmtstr.h"
#include "filesystem.h"
#include "eventqueue.h"
#include "characterset.h"
#include "sceneentity.h" // for exposing scene precache function
#include "gamerules.h"
#include "vscript_server.nut"
#ifdef MAPBASE_VSCRIPT
#include "world.h"
#include "mapbase/vscript_singletons.h"
#endif
extern ScriptClassDesc_t * GetScriptDesc( CBaseEntity * );
// #define VMPROFILE 1
#ifdef VMPROFILE
#define VMPROF_START float debugStartTime = Plat_FloatTime();
#define VMPROF_SHOW( funcname, funcdesc ) DevMsg("***VSCRIPT PROFILE***: %s %s: %6.4f milliseconds\n", (##funcname), (##funcdesc), (Plat_FloatTime() - debugStartTime)*1000.0 );
#else // !VMPROFILE
#define VMPROF_START
#define VMPROF_SHOW
#endif // VMPROFILE
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
class CScriptEntityIterator
{
public:
vscript changes: c_baseentity.h c_baseentity.cpp - Renamed GetLeftVector to GetRightVector - Renamed GetTeamNumber to GetTeam baseentity.h baseentity.cpp - Renamed GetLeftVector to GetRightVector - Renamed Get/SetRender functions (GetAlpha -> GetRenderAlpha) - Fixed CBaseEntity::GetScriptId - Added hook CBaseEntity::UpdateOnRemove - Added CBaseEntity::GetOrCreatePrivateScriptScope - Added CBaseEntity::GetDebugName - Added CBaseEntity::GetGravity - Added CBaseEntity::SetGravity - Added CBaseEntity::GetFriction - Added CBaseEntity::SetFriction - Added CBaseEntity::GetMass - Added CBaseEntity::SetMass - Added CBaseEntity::SetName (SetNameAsCStr) - Added CBaseEntity::SetParent (ScriptSetParent) - Added CBaseEntity::SetThink (ScriptSetThink) - Added CBaseEntity::StopThink (ScriptStopThink) - Added CBaseEntity::SetThinkFunction (ScriptSetThinkFunction) - Added CBaseEntity::StopThinkFunction (ScriptStopThinkFunction) - Added CBaseEntity::ApplyAbsVelocityImpulse - Added CBaseEntity::ApplyLocalAngularVelocityImpulse player.h player.cpp - Renamed GetPlayerUserId to GetUserID - Added CBasePlayer::GetFOV - Added CBasePlayer::GetFOVOwner (ScriptGetFOVOwner) - Added CBasePlayer::SetFOV (ScriptSetFOV) vscript_consts_shared.cpp -Added RAD2DEG, DEG2RAD, MAX_COORD_FLOAT, MAX_TRACE_LENGTH vscript_funcs_shared.cpp - Renamed IsClientScript,IsServerScript to IsClient,IsServer - Added IsDedicatedServer - Added NPrint (Con_NPrintf) - Removed DebugDrawBoxDirection (debugoverlay.BoxDirection) - Removed DebugDrawText (debugoverlay.Text) vscript_server.cpp - Added CDebugOverlayScriptHelper (debugoverlay) - Added CEntities::GetLocalPlayer - Added DispatchParticleEffect (ScriptDispatchParticleEffect) - Removed DebugDrawBox (debugoverlay.Box) - Removed DebugDrawLine (debugoverlay.Line) vscript_squirrel.cpp - Changed stub error messages for consistency and clarity - Changed errorfunc output to Warning instead of Msg - Added Msg, Warning - Added clamp, min, max, RemapVal, RemapValClamped - Added sqstdtime.h - Added clock, time, date
2020-08-30 15:58:34 +03:00
#ifdef MAPBASE_VSCRIPT
HSCRIPT GetLocalPlayer()
{
return ToHScript( UTIL_GetLocalPlayerOrListenServerHost() );
}
#endif
HSCRIPT First() { return Next(NULL); }
HSCRIPT Next( HSCRIPT hStartEntity )
{
return ToHScript( gEntList.NextEnt( ToEnt( hStartEntity ) ) );
}
HSCRIPT CreateByClassname( const char *className )
{
return ToHScript( CreateEntityByName( className ) );
}
HSCRIPT FindByClassname( HSCRIPT hStartEntity, const char *szName )
{
return ToHScript( gEntList.FindEntityByClassname( ToEnt( hStartEntity ), szName ) );
}
HSCRIPT FindByName( HSCRIPT hStartEntity, const char *szName )
{
return ToHScript( gEntList.FindEntityByName( ToEnt( hStartEntity ), szName ) );
}
HSCRIPT FindInSphere( HSCRIPT hStartEntity, const Vector &vecCenter, float flRadius )
{
return ToHScript( gEntList.FindEntityInSphere( ToEnt( hStartEntity ), vecCenter, flRadius ) );
}
HSCRIPT FindByTarget( HSCRIPT hStartEntity, const char *szName )
{
return ToHScript( gEntList.FindEntityByTarget( ToEnt( hStartEntity ), szName ) );
}
HSCRIPT FindByModel( HSCRIPT hStartEntity, const char *szModelName )
{
return ToHScript( gEntList.FindEntityByModel( ToEnt( hStartEntity ), szModelName ) );
}
HSCRIPT FindByNameNearest( const char *szName, const Vector &vecSrc, float flRadius )
{
return ToHScript( gEntList.FindEntityByNameNearest( szName, vecSrc, flRadius ) );
}
HSCRIPT FindByNameWithin( HSCRIPT hStartEntity, const char *szName, const Vector &vecSrc, float flRadius )
{
return ToHScript( gEntList.FindEntityByNameWithin( ToEnt( hStartEntity ), szName, vecSrc, flRadius ) );
}
HSCRIPT FindByClassnameNearest( const char *szName, const Vector &vecSrc, float flRadius )
{
return ToHScript( gEntList.FindEntityByClassnameNearest( szName, vecSrc, flRadius ) );
}
HSCRIPT FindByClassnameWithin( HSCRIPT hStartEntity , const char *szName, const Vector &vecSrc, float flRadius )
{
return ToHScript( gEntList.FindEntityByClassnameWithin( ToEnt( hStartEntity ), szName, vecSrc, flRadius ) );
}
vscript additions and fixes: baseanimating.h baseanimating.cpp - Added CBaseAnimating::SequenceDuration (ScriptSequenceDuration) - Added CBaseAnimating::GetPlaybackRate - Added CBaseAnimating::SetPlaybackRate - Added CBaseAnimating::GetCycle - Added CBaseAnimating::SetCycle triggers.h triggers.cpp - Fixed CTriggerCamera::ScriptSetFov setting player FOV while disabled - Added CBaseTrigger::Enable - Added CBaseTrigger::Disable - Added CBaseTrigger::TouchTest - Added CBaseTrigger::IsTouching (ScriptIsTouching) vscript_server.nut vscript_server.cpp - Added CEntities::FindByClassnameWithinBox - Added ::SendToConsoleServer - Added ::CancelEntityIOEvent - Added ::GetEntityIOEventTimeLeft - Moved ScriptDispatchParticleEffect to shared code eventqueue.h cbase.h cbase.cpp - Set entity I/O con output colour - Added (CEventQueue::CancelEventsByInput) - Added (CEventQueue::RemoveEvent) - Added (CEventQueue::GetTimeLeft) baseentity.h baseentity.cpp - Added CBaseEntity::SetTransmitState - Added CBaseEntity::GetTransmitState - Added CBaseEntity::AcceptInput (ScriptAcceptInput) - Added CBaseEntity::FireOutput (ScriptFireOutput) - Added CBaseEntity::GetMaxOutputDelay - Added CBaseEntity::CancelEventsByInput - Added player_use event on InputUse - Fixed InputKill on players ivscript.h vscript_squirrel.cpp - Added IScriptVM::ArrayAppend - Fixed buffer overflow crash - Increased print buffer to 2048 from 256 - Set vscript print output colour vscript_funcs_shared.cpp - Added CNetMsgScriptHelper (CScriptGameEventListener) - Added ::ListenToGameEvent - Added ::StopListeningToGameEvent - Added ::StopListeningToAllGameEvents - Added ::FireGameEvent - Added ::FireGameEventLocal (CScriptSaveRestoreUtil) - Added ::SaveTable - Added ::RestoreTable - Added ::ClearSavedTable - Added callbacks ::OnSave, ::OnRestore (CScriptReadWriteFile) - Added ::StringToFile - Added ::FileToString - Added GlobalSys::GetCommandLine - Added GlobalSys::CommandLineCheck - Added GlobalSys::CommandLineCheckStr - Added GlobalSys::CommandLineCheckFloat - Added GlobalSys::CommandLineCheckInt - Added ::GetCPUUsage - Added ::NXPrint - Added ::Msg (ScriptMsg) - Removed misplaced condition checks - Fixed ScriptEntitiesInBox, *AtPoint, *InSphere logic_eventlistener.cpp - Removed redundant dev msg gamestringpool.cpp - Fixed string pool dump sort
2020-10-27 02:22:18 +03:00
#ifdef MAPBASE_VSCRIPT
HSCRIPT FindByClassnameWithinBox( HSCRIPT hStartEntity , const char *szName, const Vector &vecMins, const Vector &vecMaxs )
{
return ToHScript( gEntList.FindEntityByClassnameWithin( ToEnt( hStartEntity ), szName, vecMins, vecMaxs ) );
}
vscript additions and fixes: baseentity_shared.cpp baseentity.cpp c_baseentity.h c_baseentity.cpp c_world.h - Fixed critical ScriptSetContextThink bugs - Added C_BaseEntity::SetContextThink (ScriptSetContextThink) - Added C_BaseEntity::SetSize - Added C_BaseEntity::SetModel - Added C_BaseEntity::Destroy baseentity.h baseentity.cpp - Removed duplicate functions ScriptSetSize and ScriptUtilRemove player.cpp - Moved player script instance registration before player_spawn event vscript_server.cpp - Added CEntities::FindByClassNearestFacing vscript_funcs_shared.cpp - Added GetFrameCount - Added IntervalPerTick vscript_singletons.cpp - Better game event descriptors for CScriptGameEventListener - Added ::effects (CEffectsScriptHelper) - Added ::Convars (CScriptConvarAccessor) vscript_shared.cpp - Fixed clientside entity printing in script VM mapbase_con_groups.h mapbase_con_groups.cpp - Improved performance by changing string comparisons to direct array access vscript_bindings_base.h vscript_bindings_base.cpp - Added CScriptKeyValues::SubKeysToTable vscript_bindings_math.cpp - Added ::SimpleSplineRemapVal - Added ::SimpleSplineRemapValClamped - Added ::Bias - Added ::Gain - Added ::SmoothCurve - Added ::SmoothCurve_Tweak - Added ::ExponentialDecay vscript_squirrel.nut - Added ::Lerp - Added ::FLerp - Added ::SimpleSpline vscript_squirrel.cpp - Added Vector::_unm - Added Vector::Set - Added Vector::Add - Added Vector::Subtract - Added Vector::Multiply - Added Vector::Divide - Added Vector::DistTo - Added Vector::DistToSqr - Added Vector::IsEqualTo - Added Vector::WithinAABox - Added Vector::FromKVString - Changed vector print syntax
2021-03-06 02:11:43 +03:00
HSCRIPT FindByClassNearestFacing( const Vector &origin, const Vector &facing, float threshold, const char *classname )
{
return ToHScript( gEntList.FindEntityClassNearestFacing( origin, facing, threshold, const_cast<char*>(classname) ) );
}
vscript additions and fixes: baseanimating.h baseanimating.cpp - Added CBaseAnimating::SequenceDuration (ScriptSequenceDuration) - Added CBaseAnimating::GetPlaybackRate - Added CBaseAnimating::SetPlaybackRate - Added CBaseAnimating::GetCycle - Added CBaseAnimating::SetCycle triggers.h triggers.cpp - Fixed CTriggerCamera::ScriptSetFov setting player FOV while disabled - Added CBaseTrigger::Enable - Added CBaseTrigger::Disable - Added CBaseTrigger::TouchTest - Added CBaseTrigger::IsTouching (ScriptIsTouching) vscript_server.nut vscript_server.cpp - Added CEntities::FindByClassnameWithinBox - Added ::SendToConsoleServer - Added ::CancelEntityIOEvent - Added ::GetEntityIOEventTimeLeft - Moved ScriptDispatchParticleEffect to shared code eventqueue.h cbase.h cbase.cpp - Set entity I/O con output colour - Added (CEventQueue::CancelEventsByInput) - Added (CEventQueue::RemoveEvent) - Added (CEventQueue::GetTimeLeft) baseentity.h baseentity.cpp - Added CBaseEntity::SetTransmitState - Added CBaseEntity::GetTransmitState - Added CBaseEntity::AcceptInput (ScriptAcceptInput) - Added CBaseEntity::FireOutput (ScriptFireOutput) - Added CBaseEntity::GetMaxOutputDelay - Added CBaseEntity::CancelEventsByInput - Added player_use event on InputUse - Fixed InputKill on players ivscript.h vscript_squirrel.cpp - Added IScriptVM::ArrayAppend - Fixed buffer overflow crash - Increased print buffer to 2048 from 256 - Set vscript print output colour vscript_funcs_shared.cpp - Added CNetMsgScriptHelper (CScriptGameEventListener) - Added ::ListenToGameEvent - Added ::StopListeningToGameEvent - Added ::StopListeningToAllGameEvents - Added ::FireGameEvent - Added ::FireGameEventLocal (CScriptSaveRestoreUtil) - Added ::SaveTable - Added ::RestoreTable - Added ::ClearSavedTable - Added callbacks ::OnSave, ::OnRestore (CScriptReadWriteFile) - Added ::StringToFile - Added ::FileToString - Added GlobalSys::GetCommandLine - Added GlobalSys::CommandLineCheck - Added GlobalSys::CommandLineCheckStr - Added GlobalSys::CommandLineCheckFloat - Added GlobalSys::CommandLineCheckInt - Added ::GetCPUUsage - Added ::NXPrint - Added ::Msg (ScriptMsg) - Removed misplaced condition checks - Fixed ScriptEntitiesInBox, *AtPoint, *InSphere logic_eventlistener.cpp - Removed redundant dev msg gamestringpool.cpp - Fixed string pool dump sort
2020-10-27 02:22:18 +03:00
#endif
private:
} g_ScriptEntityIterator;
BEGIN_SCRIPTDESC_ROOT_NAMED( CScriptEntityIterator, "CEntities", SCRIPT_SINGLETON "The global list of entities" )
vscript changes: c_baseentity.h c_baseentity.cpp - Renamed GetLeftVector to GetRightVector - Renamed GetTeamNumber to GetTeam baseentity.h baseentity.cpp - Renamed GetLeftVector to GetRightVector - Renamed Get/SetRender functions (GetAlpha -> GetRenderAlpha) - Fixed CBaseEntity::GetScriptId - Added hook CBaseEntity::UpdateOnRemove - Added CBaseEntity::GetOrCreatePrivateScriptScope - Added CBaseEntity::GetDebugName - Added CBaseEntity::GetGravity - Added CBaseEntity::SetGravity - Added CBaseEntity::GetFriction - Added CBaseEntity::SetFriction - Added CBaseEntity::GetMass - Added CBaseEntity::SetMass - Added CBaseEntity::SetName (SetNameAsCStr) - Added CBaseEntity::SetParent (ScriptSetParent) - Added CBaseEntity::SetThink (ScriptSetThink) - Added CBaseEntity::StopThink (ScriptStopThink) - Added CBaseEntity::SetThinkFunction (ScriptSetThinkFunction) - Added CBaseEntity::StopThinkFunction (ScriptStopThinkFunction) - Added CBaseEntity::ApplyAbsVelocityImpulse - Added CBaseEntity::ApplyLocalAngularVelocityImpulse player.h player.cpp - Renamed GetPlayerUserId to GetUserID - Added CBasePlayer::GetFOV - Added CBasePlayer::GetFOVOwner (ScriptGetFOVOwner) - Added CBasePlayer::SetFOV (ScriptSetFOV) vscript_consts_shared.cpp -Added RAD2DEG, DEG2RAD, MAX_COORD_FLOAT, MAX_TRACE_LENGTH vscript_funcs_shared.cpp - Renamed IsClientScript,IsServerScript to IsClient,IsServer - Added IsDedicatedServer - Added NPrint (Con_NPrintf) - Removed DebugDrawBoxDirection (debugoverlay.BoxDirection) - Removed DebugDrawText (debugoverlay.Text) vscript_server.cpp - Added CDebugOverlayScriptHelper (debugoverlay) - Added CEntities::GetLocalPlayer - Added DispatchParticleEffect (ScriptDispatchParticleEffect) - Removed DebugDrawBox (debugoverlay.Box) - Removed DebugDrawLine (debugoverlay.Line) vscript_squirrel.cpp - Changed stub error messages for consistency and clarity - Changed errorfunc output to Warning instead of Msg - Added Msg, Warning - Added clamp, min, max, RemapVal, RemapValClamped - Added sqstdtime.h - Added clock, time, date
2020-08-30 15:58:34 +03:00
#ifdef MAPBASE_VSCRIPT
DEFINE_SCRIPTFUNC( GetLocalPlayer, "Get local player or listen server host" )
#endif
DEFINE_SCRIPTFUNC( First, "Begin an iteration over the list of entities" )
DEFINE_SCRIPTFUNC( Next, "Continue an iteration over the list of entities, providing reference to a previously found entity" )
DEFINE_SCRIPTFUNC( CreateByClassname, "Creates an entity by classname" )
DEFINE_SCRIPTFUNC( FindByClassname, "Find entities by class name. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search" )
DEFINE_SCRIPTFUNC( FindByName, "Find entities by name. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search" )
DEFINE_SCRIPTFUNC( FindInSphere, "Find entities within a radius. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search" )
DEFINE_SCRIPTFUNC( FindByTarget, "Find entities by targetname. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search" )
DEFINE_SCRIPTFUNC( FindByModel, "Find entities by model name. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search" )
DEFINE_SCRIPTFUNC( FindByNameNearest, "Find entities by name nearest to a point." )
DEFINE_SCRIPTFUNC( FindByNameWithin, "Find entities by name within a radius. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search" )
DEFINE_SCRIPTFUNC( FindByClassnameNearest, "Find entities by class name nearest to a point." )
DEFINE_SCRIPTFUNC( FindByClassnameWithin, "Find entities by class name within a radius. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search" )
vscript additions and fixes: baseanimating.h baseanimating.cpp - Added CBaseAnimating::SequenceDuration (ScriptSequenceDuration) - Added CBaseAnimating::GetPlaybackRate - Added CBaseAnimating::SetPlaybackRate - Added CBaseAnimating::GetCycle - Added CBaseAnimating::SetCycle triggers.h triggers.cpp - Fixed CTriggerCamera::ScriptSetFov setting player FOV while disabled - Added CBaseTrigger::Enable - Added CBaseTrigger::Disable - Added CBaseTrigger::TouchTest - Added CBaseTrigger::IsTouching (ScriptIsTouching) vscript_server.nut vscript_server.cpp - Added CEntities::FindByClassnameWithinBox - Added ::SendToConsoleServer - Added ::CancelEntityIOEvent - Added ::GetEntityIOEventTimeLeft - Moved ScriptDispatchParticleEffect to shared code eventqueue.h cbase.h cbase.cpp - Set entity I/O con output colour - Added (CEventQueue::CancelEventsByInput) - Added (CEventQueue::RemoveEvent) - Added (CEventQueue::GetTimeLeft) baseentity.h baseentity.cpp - Added CBaseEntity::SetTransmitState - Added CBaseEntity::GetTransmitState - Added CBaseEntity::AcceptInput (ScriptAcceptInput) - Added CBaseEntity::FireOutput (ScriptFireOutput) - Added CBaseEntity::GetMaxOutputDelay - Added CBaseEntity::CancelEventsByInput - Added player_use event on InputUse - Fixed InputKill on players ivscript.h vscript_squirrel.cpp - Added IScriptVM::ArrayAppend - Fixed buffer overflow crash - Increased print buffer to 2048 from 256 - Set vscript print output colour vscript_funcs_shared.cpp - Added CNetMsgScriptHelper (CScriptGameEventListener) - Added ::ListenToGameEvent - Added ::StopListeningToGameEvent - Added ::StopListeningToAllGameEvents - Added ::FireGameEvent - Added ::FireGameEventLocal (CScriptSaveRestoreUtil) - Added ::SaveTable - Added ::RestoreTable - Added ::ClearSavedTable - Added callbacks ::OnSave, ::OnRestore (CScriptReadWriteFile) - Added ::StringToFile - Added ::FileToString - Added GlobalSys::GetCommandLine - Added GlobalSys::CommandLineCheck - Added GlobalSys::CommandLineCheckStr - Added GlobalSys::CommandLineCheckFloat - Added GlobalSys::CommandLineCheckInt - Added ::GetCPUUsage - Added ::NXPrint - Added ::Msg (ScriptMsg) - Removed misplaced condition checks - Fixed ScriptEntitiesInBox, *AtPoint, *InSphere logic_eventlistener.cpp - Removed redundant dev msg gamestringpool.cpp - Fixed string pool dump sort
2020-10-27 02:22:18 +03:00
#ifdef MAPBASE_VSCRIPT
DEFINE_SCRIPTFUNC( FindByClassnameWithinBox, "Find entities by class name within an AABB. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search" )
vscript additions and fixes: baseentity_shared.cpp baseentity.cpp c_baseentity.h c_baseentity.cpp c_world.h - Fixed critical ScriptSetContextThink bugs - Added C_BaseEntity::SetContextThink (ScriptSetContextThink) - Added C_BaseEntity::SetSize - Added C_BaseEntity::SetModel - Added C_BaseEntity::Destroy baseentity.h baseentity.cpp - Removed duplicate functions ScriptSetSize and ScriptUtilRemove player.cpp - Moved player script instance registration before player_spawn event vscript_server.cpp - Added CEntities::FindByClassNearestFacing vscript_funcs_shared.cpp - Added GetFrameCount - Added IntervalPerTick vscript_singletons.cpp - Better game event descriptors for CScriptGameEventListener - Added ::effects (CEffectsScriptHelper) - Added ::Convars (CScriptConvarAccessor) vscript_shared.cpp - Fixed clientside entity printing in script VM mapbase_con_groups.h mapbase_con_groups.cpp - Improved performance by changing string comparisons to direct array access vscript_bindings_base.h vscript_bindings_base.cpp - Added CScriptKeyValues::SubKeysToTable vscript_bindings_math.cpp - Added ::SimpleSplineRemapVal - Added ::SimpleSplineRemapValClamped - Added ::Bias - Added ::Gain - Added ::SmoothCurve - Added ::SmoothCurve_Tweak - Added ::ExponentialDecay vscript_squirrel.nut - Added ::Lerp - Added ::FLerp - Added ::SimpleSpline vscript_squirrel.cpp - Added Vector::_unm - Added Vector::Set - Added Vector::Add - Added Vector::Subtract - Added Vector::Multiply - Added Vector::Divide - Added Vector::DistTo - Added Vector::DistToSqr - Added Vector::IsEqualTo - Added Vector::WithinAABox - Added Vector::FromKVString - Changed vector print syntax
2021-03-06 02:11:43 +03:00
DEFINE_SCRIPTFUNC( FindByClassNearestFacing, "Find the nearest entity along the facing direction from the given origin within the angular threshold with the given classname." )
vscript additions and fixes: baseanimating.h baseanimating.cpp - Added CBaseAnimating::SequenceDuration (ScriptSequenceDuration) - Added CBaseAnimating::GetPlaybackRate - Added CBaseAnimating::SetPlaybackRate - Added CBaseAnimating::GetCycle - Added CBaseAnimating::SetCycle triggers.h triggers.cpp - Fixed CTriggerCamera::ScriptSetFov setting player FOV while disabled - Added CBaseTrigger::Enable - Added CBaseTrigger::Disable - Added CBaseTrigger::TouchTest - Added CBaseTrigger::IsTouching (ScriptIsTouching) vscript_server.nut vscript_server.cpp - Added CEntities::FindByClassnameWithinBox - Added ::SendToConsoleServer - Added ::CancelEntityIOEvent - Added ::GetEntityIOEventTimeLeft - Moved ScriptDispatchParticleEffect to shared code eventqueue.h cbase.h cbase.cpp - Set entity I/O con output colour - Added (CEventQueue::CancelEventsByInput) - Added (CEventQueue::RemoveEvent) - Added (CEventQueue::GetTimeLeft) baseentity.h baseentity.cpp - Added CBaseEntity::SetTransmitState - Added CBaseEntity::GetTransmitState - Added CBaseEntity::AcceptInput (ScriptAcceptInput) - Added CBaseEntity::FireOutput (ScriptFireOutput) - Added CBaseEntity::GetMaxOutputDelay - Added CBaseEntity::CancelEventsByInput - Added player_use event on InputUse - Fixed InputKill on players ivscript.h vscript_squirrel.cpp - Added IScriptVM::ArrayAppend - Fixed buffer overflow crash - Increased print buffer to 2048 from 256 - Set vscript print output colour vscript_funcs_shared.cpp - Added CNetMsgScriptHelper (CScriptGameEventListener) - Added ::ListenToGameEvent - Added ::StopListeningToGameEvent - Added ::StopListeningToAllGameEvents - Added ::FireGameEvent - Added ::FireGameEventLocal (CScriptSaveRestoreUtil) - Added ::SaveTable - Added ::RestoreTable - Added ::ClearSavedTable - Added callbacks ::OnSave, ::OnRestore (CScriptReadWriteFile) - Added ::StringToFile - Added ::FileToString - Added GlobalSys::GetCommandLine - Added GlobalSys::CommandLineCheck - Added GlobalSys::CommandLineCheckStr - Added GlobalSys::CommandLineCheckFloat - Added GlobalSys::CommandLineCheckInt - Added ::GetCPUUsage - Added ::NXPrint - Added ::Msg (ScriptMsg) - Removed misplaced condition checks - Fixed ScriptEntitiesInBox, *AtPoint, *InSphere logic_eventlistener.cpp - Removed redundant dev msg gamestringpool.cpp - Fixed string pool dump sort
2020-10-27 02:22:18 +03:00
#endif
END_SCRIPTDESC();
Mapbase v6.0 - Fixed path_track paths saving as pointers instead of handles - Fixed player animations not falling to base class correctly - Fixed logic_externaldata creating garbage in trailing spaces - Added "SetHandModelSkin" input - Added unique colors for various types of console message, adjustable via convars - Added the ability to use map-specific weapon scripts - Added a way to display (placeholder) text entirely from Faceposer scenes - Added "autobreak" keyvalue to game_text, which automatically breaks long text into different lines - Added the ability to change a game_text's font (very limited) - Added LightToggle input to point_spotlight - Added Enable/DisableSprites on npc_manhack - Added ai_goal_police behavior from metrocops to Combine soldiers and citizens - Added func_precipitation particle rain systems from the Alien Swarm SDK - Added new func_precipitation spawnflags for controlling behavior in particle types - Added "mapbase_version" cvar which shows the version of Mapbase a mod might be running on - Fixed an oversight with NPC crouch activities which was causing npc_metropolice to stop firing in standoffs - Added toggleable patches to npc_combine AI which make soldiers less likely to stand around without shooting or rush to melee when not needed - Added key for custom logo font on env_credits scripts - Added SetSpeed and SetPushDir inputs for trigger_push - Added a bunch of I/O/KV to func_fish_pool to allow for more control over the fish - Added OnLostEnemy/Player support for npc_combine_camera - Added enhanced save/restore for the Response System, toggleable via convar - Added a convar which allows users to disable weapon autoswitching when picking up ammo - Split VScript base script into its own file - Added VScript descriptions for NPC squads and the manager class which handles them - Moved several classes, functions, etc. to the VScript library itself for future usage in other projects, like VBSP - Added VScript to VBSP with basic map file interfacing - Made some VScript documentation more clear due to deprecation of online documentation - Added VScript "hook" registration, creating a standardized system which shows up in script_help documentation - Added VScript-driven custom weapons - Added clientside VScript scopes - Added a bunch of weapon-related VScript functions - Split a bunch of cluttered VScript stuff into different files - Added VScript functions for "following" entities/bonemerging - Added VScript functions for grenades - Added a few more VScript trigger functions - Added OnDeath hook for VScript - Fixed documentation for aliased functions in VScript - Fixed $bumpmask not working on SDK_LightmappedGeneric - Made vertex blend swapping in Hammer use a constant instead of a combo (makes it easier to compile the shader, especially for $bumpmask's sake) - Fixed brush phong, etc. causing SDK_WorldVertexTransition to stop working - Added limited support for $envmapmask in the bumpmapping shader - Fixed more issues with parallax corrected cubemaps and instances - Made instance variable recursion consistent with VMFII
2020-11-26 05:26:55 +03:00
#ifndef MAPBASE_VSCRIPT // Mapbase adds this to the base library so that CScriptKeyValues can be accessed anywhere, like VBSP.
// ----------------------------------------------------------------------------
// KeyValues access - CBaseEntity::ScriptGetKeyFromModel returns root KeyValues
// ----------------------------------------------------------------------------
BEGIN_SCRIPTDESC_ROOT( CScriptKeyValues, "Wrapper class over KeyValues instance" )
DEFINE_SCRIPT_CONSTRUCTOR()
DEFINE_SCRIPTFUNC_NAMED( ScriptFindKey, "FindKey", "Given a KeyValues object and a key name, find a KeyValues object associated with the key name" );
DEFINE_SCRIPTFUNC_NAMED( ScriptGetFirstSubKey, "GetFirstSubKey", "Given a KeyValues object, return the first sub key object" );
DEFINE_SCRIPTFUNC_NAMED( ScriptGetNextKey, "GetNextKey", "Given a KeyValues object, return the next key object in a sub key group" );
DEFINE_SCRIPTFUNC_NAMED( ScriptGetKeyValueInt, "GetKeyInt", "Given a KeyValues object and a key name, return associated integer value" );
DEFINE_SCRIPTFUNC_NAMED( ScriptGetKeyValueFloat, "GetKeyFloat", "Given a KeyValues object and a key name, return associated float value" );
DEFINE_SCRIPTFUNC_NAMED( ScriptGetKeyValueBool, "GetKeyBool", "Given a KeyValues object and a key name, return associated bool value" );
DEFINE_SCRIPTFUNC_NAMED( ScriptGetKeyValueString, "GetKeyString", "Given a KeyValues object and a key name, return associated string value" );
DEFINE_SCRIPTFUNC_NAMED( ScriptIsKeyValueEmpty, "IsKeyEmpty", "Given a KeyValues object and a key name, return true if key name has no value" );
DEFINE_SCRIPTFUNC_NAMED( ScriptReleaseKeyValues, "ReleaseKeyValues", "Given a root KeyValues object, release its contents" );
END_SCRIPTDESC();
HSCRIPT CScriptKeyValues::ScriptFindKey( const char *pszName )
{
KeyValues *pKeyValues = m_pKeyValues->FindKey(pszName);
if ( pKeyValues == NULL )
return NULL;
CScriptKeyValues *pScriptKey = new CScriptKeyValues( pKeyValues );
// UNDONE: who calls ReleaseInstance on this??
HSCRIPT hScriptInstance = g_pScriptVM->RegisterInstance( pScriptKey );
return hScriptInstance;
}
HSCRIPT CScriptKeyValues::ScriptGetFirstSubKey( void )
{
KeyValues *pKeyValues = m_pKeyValues->GetFirstSubKey();
if ( pKeyValues == NULL )
return NULL;
CScriptKeyValues *pScriptKey = new CScriptKeyValues( pKeyValues );
// UNDONE: who calls ReleaseInstance on this??
HSCRIPT hScriptInstance = g_pScriptVM->RegisterInstance( pScriptKey );
return hScriptInstance;
}
HSCRIPT CScriptKeyValues::ScriptGetNextKey( void )
{
KeyValues *pKeyValues = m_pKeyValues->GetNextKey();
if ( pKeyValues == NULL )
return NULL;
CScriptKeyValues *pScriptKey = new CScriptKeyValues( pKeyValues );
// UNDONE: who calls ReleaseInstance on this??
HSCRIPT hScriptInstance = g_pScriptVM->RegisterInstance( pScriptKey );
return hScriptInstance;
}
int CScriptKeyValues::ScriptGetKeyValueInt( const char *pszName )
{
int i = m_pKeyValues->GetInt( pszName );
return i;
}
float CScriptKeyValues::ScriptGetKeyValueFloat( const char *pszName )
{
float f = m_pKeyValues->GetFloat( pszName );
return f;
}
const char *CScriptKeyValues::ScriptGetKeyValueString( const char *pszName )
{
const char *psz = m_pKeyValues->GetString( pszName );
return psz;
}
bool CScriptKeyValues::ScriptIsKeyValueEmpty( const char *pszName )
{
bool b = m_pKeyValues->IsEmpty( pszName );
return b;
}
bool CScriptKeyValues::ScriptGetKeyValueBool( const char *pszName )
{
bool b = m_pKeyValues->GetBool( pszName );
return b;
}
void CScriptKeyValues::ScriptReleaseKeyValues( )
{
m_pKeyValues->deleteThis();
m_pKeyValues = NULL;
}
// constructors
CScriptKeyValues::CScriptKeyValues( KeyValues *pKeyValues = NULL )
{
m_pKeyValues = pKeyValues;
}
// destructor
CScriptKeyValues::~CScriptKeyValues( )
{
if (m_pKeyValues)
{
m_pKeyValues->deleteThis();
}
m_pKeyValues = NULL;
}
Mapbase v6.0 - Fixed path_track paths saving as pointers instead of handles - Fixed player animations not falling to base class correctly - Fixed logic_externaldata creating garbage in trailing spaces - Added "SetHandModelSkin" input - Added unique colors for various types of console message, adjustable via convars - Added the ability to use map-specific weapon scripts - Added a way to display (placeholder) text entirely from Faceposer scenes - Added "autobreak" keyvalue to game_text, which automatically breaks long text into different lines - Added the ability to change a game_text's font (very limited) - Added LightToggle input to point_spotlight - Added Enable/DisableSprites on npc_manhack - Added ai_goal_police behavior from metrocops to Combine soldiers and citizens - Added func_precipitation particle rain systems from the Alien Swarm SDK - Added new func_precipitation spawnflags for controlling behavior in particle types - Added "mapbase_version" cvar which shows the version of Mapbase a mod might be running on - Fixed an oversight with NPC crouch activities which was causing npc_metropolice to stop firing in standoffs - Added toggleable patches to npc_combine AI which make soldiers less likely to stand around without shooting or rush to melee when not needed - Added key for custom logo font on env_credits scripts - Added SetSpeed and SetPushDir inputs for trigger_push - Added a bunch of I/O/KV to func_fish_pool to allow for more control over the fish - Added OnLostEnemy/Player support for npc_combine_camera - Added enhanced save/restore for the Response System, toggleable via convar - Added a convar which allows users to disable weapon autoswitching when picking up ammo - Split VScript base script into its own file - Added VScript descriptions for NPC squads and the manager class which handles them - Moved several classes, functions, etc. to the VScript library itself for future usage in other projects, like VBSP - Added VScript to VBSP with basic map file interfacing - Made some VScript documentation more clear due to deprecation of online documentation - Added VScript "hook" registration, creating a standardized system which shows up in script_help documentation - Added VScript-driven custom weapons - Added clientside VScript scopes - Added a bunch of weapon-related VScript functions - Split a bunch of cluttered VScript stuff into different files - Added VScript functions for "following" entities/bonemerging - Added VScript functions for grenades - Added a few more VScript trigger functions - Added OnDeath hook for VScript - Fixed documentation for aliased functions in VScript - Fixed $bumpmask not working on SDK_LightmappedGeneric - Made vertex blend swapping in Hammer use a constant instead of a combo (makes it easier to compile the shader, especially for $bumpmask's sake) - Fixed brush phong, etc. causing SDK_WorldVertexTransition to stop working - Added limited support for $envmapmask in the bumpmapping shader - Fixed more issues with parallax corrected cubemaps and instances - Made instance variable recursion consistent with VMFII
2020-11-26 05:26:55 +03:00
#endif
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
static float Time()
{
return gpGlobals->curtime;
}
static float FrameTime()
{
return gpGlobals->frametime;
}
#ifdef MAPBASE_VSCRIPT
static int MaxPlayers()
{
return gpGlobals->maxClients;
}
Mapbase v6.1 - Added postprocess_controller entity from later versions of Source - Added env_dof_controller entity from later versions of Source - Added SDK_Engine_Post and DepthOfField shaders from the Momentum repo/Alien Swarm SDK - Fixed auto-breaking game_text/choreo text not null terminating - Fixed console groups showing up at the wrong developer levels - Added more mesages to console groups, including a new "NPC AI" console group - Fixed typos and added elaboration in various cvars, console messages, etc. - Fixed npc_metropolice not using frag grenades correctly when allowed to use them - Fixed npc_metropolice not registering stitching squad slots in AI - Fixed SetModel input late precache warning - Fixed env_global_light angles resetting upon loading a save - Fixed an issue with ScriptKeyValuesRead using the wrong name and having a memory leak - Allowed VScript functions which return null strings to actually return null instead of empty strings - Added VScript member variable documentation - Fixed VScript documentation lines sometimes mixing together - Fixed VScript singletons having a ! at the beginning of descriptions - Added Color struct to VScript and allowed color-related inputs to use it - Added more VScript functions for weapons, ammo, ragdolling, and response contexts - Added GameRules singleton for VScript - Exposed AI interaction system to VScript - Recovered some lost documentation from older revisions of the Mapbase wiki - Added a way to get the current game's load type in VScript - Fixed Precache/SpawnEntityFromTable not accounting for a few important field types - Added VScript functions for getting a player's eye vectors - Fixed a crash caused by removing the active weapon of a Combine soldier while it's firing - Changed the way metrocops deploy their manhacks so they could use their manhack death response properly - Fixed "Use Server" keyvalue on game_convar_mod not working - Adjusted CAI_Expresser in VScript
2020-12-17 06:38:23 +03:00
static int GetLoadType()
{
return gpGlobals->eLoadType;
}
#endif
static void SendToConsole( const char *pszCommand )
{
CBasePlayer *pPlayer = UTIL_GetLocalPlayerOrListenServerHost();
if ( !pPlayer )
{
Mapbase v6.0 - Fixed path_track paths saving as pointers instead of handles - Fixed player animations not falling to base class correctly - Fixed logic_externaldata creating garbage in trailing spaces - Added "SetHandModelSkin" input - Added unique colors for various types of console message, adjustable via convars - Added the ability to use map-specific weapon scripts - Added a way to display (placeholder) text entirely from Faceposer scenes - Added "autobreak" keyvalue to game_text, which automatically breaks long text into different lines - Added the ability to change a game_text's font (very limited) - Added LightToggle input to point_spotlight - Added Enable/DisableSprites on npc_manhack - Added ai_goal_police behavior from metrocops to Combine soldiers and citizens - Added func_precipitation particle rain systems from the Alien Swarm SDK - Added new func_precipitation spawnflags for controlling behavior in particle types - Added "mapbase_version" cvar which shows the version of Mapbase a mod might be running on - Fixed an oversight with NPC crouch activities which was causing npc_metropolice to stop firing in standoffs - Added toggleable patches to npc_combine AI which make soldiers less likely to stand around without shooting or rush to melee when not needed - Added key for custom logo font on env_credits scripts - Added SetSpeed and SetPushDir inputs for trigger_push - Added a bunch of I/O/KV to func_fish_pool to allow for more control over the fish - Added OnLostEnemy/Player support for npc_combine_camera - Added enhanced save/restore for the Response System, toggleable via convar - Added a convar which allows users to disable weapon autoswitching when picking up ammo - Split VScript base script into its own file - Added VScript descriptions for NPC squads and the manager class which handles them - Moved several classes, functions, etc. to the VScript library itself for future usage in other projects, like VBSP - Added VScript to VBSP with basic map file interfacing - Made some VScript documentation more clear due to deprecation of online documentation - Added VScript "hook" registration, creating a standardized system which shows up in script_help documentation - Added VScript-driven custom weapons - Added clientside VScript scopes - Added a bunch of weapon-related VScript functions - Split a bunch of cluttered VScript stuff into different files - Added VScript functions for "following" entities/bonemerging - Added VScript functions for grenades - Added a few more VScript trigger functions - Added OnDeath hook for VScript - Fixed documentation for aliased functions in VScript - Fixed $bumpmask not working on SDK_LightmappedGeneric - Made vertex blend swapping in Hammer use a constant instead of a combo (makes it easier to compile the shader, especially for $bumpmask's sake) - Fixed brush phong, etc. causing SDK_WorldVertexTransition to stop working - Added limited support for $envmapmask in the bumpmapping shader - Fixed more issues with parallax corrected cubemaps and instances - Made instance variable recursion consistent with VMFII
2020-11-26 05:26:55 +03:00
#ifdef MAPBASE
CGMsg( 1, CON_GROUP_VSCRIPT, "Cannot execute \"%s\", no player\n", pszCommand );
#else
DevMsg ("Cannot execute \"%s\", no player\n", pszCommand );
Mapbase v6.0 - Fixed path_track paths saving as pointers instead of handles - Fixed player animations not falling to base class correctly - Fixed logic_externaldata creating garbage in trailing spaces - Added "SetHandModelSkin" input - Added unique colors for various types of console message, adjustable via convars - Added the ability to use map-specific weapon scripts - Added a way to display (placeholder) text entirely from Faceposer scenes - Added "autobreak" keyvalue to game_text, which automatically breaks long text into different lines - Added the ability to change a game_text's font (very limited) - Added LightToggle input to point_spotlight - Added Enable/DisableSprites on npc_manhack - Added ai_goal_police behavior from metrocops to Combine soldiers and citizens - Added func_precipitation particle rain systems from the Alien Swarm SDK - Added new func_precipitation spawnflags for controlling behavior in particle types - Added "mapbase_version" cvar which shows the version of Mapbase a mod might be running on - Fixed an oversight with NPC crouch activities which was causing npc_metropolice to stop firing in standoffs - Added toggleable patches to npc_combine AI which make soldiers less likely to stand around without shooting or rush to melee when not needed - Added key for custom logo font on env_credits scripts - Added SetSpeed and SetPushDir inputs for trigger_push - Added a bunch of I/O/KV to func_fish_pool to allow for more control over the fish - Added OnLostEnemy/Player support for npc_combine_camera - Added enhanced save/restore for the Response System, toggleable via convar - Added a convar which allows users to disable weapon autoswitching when picking up ammo - Split VScript base script into its own file - Added VScript descriptions for NPC squads and the manager class which handles them - Moved several classes, functions, etc. to the VScript library itself for future usage in other projects, like VBSP - Added VScript to VBSP with basic map file interfacing - Made some VScript documentation more clear due to deprecation of online documentation - Added VScript "hook" registration, creating a standardized system which shows up in script_help documentation - Added VScript-driven custom weapons - Added clientside VScript scopes - Added a bunch of weapon-related VScript functions - Split a bunch of cluttered VScript stuff into different files - Added VScript functions for "following" entities/bonemerging - Added VScript functions for grenades - Added a few more VScript trigger functions - Added OnDeath hook for VScript - Fixed documentation for aliased functions in VScript - Fixed $bumpmask not working on SDK_LightmappedGeneric - Made vertex blend swapping in Hammer use a constant instead of a combo (makes it easier to compile the shader, especially for $bumpmask's sake) - Fixed brush phong, etc. causing SDK_WorldVertexTransition to stop working - Added limited support for $envmapmask in the bumpmapping shader - Fixed more issues with parallax corrected cubemaps and instances - Made instance variable recursion consistent with VMFII
2020-11-26 05:26:55 +03:00
#endif
return;
}
engine->ClientCommand( pPlayer->edict(), pszCommand );
}
vscript additions and fixes: baseanimating.h baseanimating.cpp - Added CBaseAnimating::SequenceDuration (ScriptSequenceDuration) - Added CBaseAnimating::GetPlaybackRate - Added CBaseAnimating::SetPlaybackRate - Added CBaseAnimating::GetCycle - Added CBaseAnimating::SetCycle triggers.h triggers.cpp - Fixed CTriggerCamera::ScriptSetFov setting player FOV while disabled - Added CBaseTrigger::Enable - Added CBaseTrigger::Disable - Added CBaseTrigger::TouchTest - Added CBaseTrigger::IsTouching (ScriptIsTouching) vscript_server.nut vscript_server.cpp - Added CEntities::FindByClassnameWithinBox - Added ::SendToConsoleServer - Added ::CancelEntityIOEvent - Added ::GetEntityIOEventTimeLeft - Moved ScriptDispatchParticleEffect to shared code eventqueue.h cbase.h cbase.cpp - Set entity I/O con output colour - Added (CEventQueue::CancelEventsByInput) - Added (CEventQueue::RemoveEvent) - Added (CEventQueue::GetTimeLeft) baseentity.h baseentity.cpp - Added CBaseEntity::SetTransmitState - Added CBaseEntity::GetTransmitState - Added CBaseEntity::AcceptInput (ScriptAcceptInput) - Added CBaseEntity::FireOutput (ScriptFireOutput) - Added CBaseEntity::GetMaxOutputDelay - Added CBaseEntity::CancelEventsByInput - Added player_use event on InputUse - Fixed InputKill on players ivscript.h vscript_squirrel.cpp - Added IScriptVM::ArrayAppend - Fixed buffer overflow crash - Increased print buffer to 2048 from 256 - Set vscript print output colour vscript_funcs_shared.cpp - Added CNetMsgScriptHelper (CScriptGameEventListener) - Added ::ListenToGameEvent - Added ::StopListeningToGameEvent - Added ::StopListeningToAllGameEvents - Added ::FireGameEvent - Added ::FireGameEventLocal (CScriptSaveRestoreUtil) - Added ::SaveTable - Added ::RestoreTable - Added ::ClearSavedTable - Added callbacks ::OnSave, ::OnRestore (CScriptReadWriteFile) - Added ::StringToFile - Added ::FileToString - Added GlobalSys::GetCommandLine - Added GlobalSys::CommandLineCheck - Added GlobalSys::CommandLineCheckStr - Added GlobalSys::CommandLineCheckFloat - Added GlobalSys::CommandLineCheckInt - Added ::GetCPUUsage - Added ::NXPrint - Added ::Msg (ScriptMsg) - Removed misplaced condition checks - Fixed ScriptEntitiesInBox, *AtPoint, *InSphere logic_eventlistener.cpp - Removed redundant dev msg gamestringpool.cpp - Fixed string pool dump sort
2020-10-27 02:22:18 +03:00
static void SendToConsoleServer( const char *pszCommand )
{
// TODO: whitelist for multiplayer
engine->ServerCommand( UTIL_VarArgs("%s\n", pszCommand) );
}
static const char *GetMapName()
{
return STRING( gpGlobals->mapname );
}
static const char *DoUniqueString( const char *pszBase )
{
static char szBuf[512];
g_pScriptVM->GenerateUniqueKey( pszBase, szBuf, ARRAYSIZE(szBuf) );
return szBuf;
}
vscript additions and fixes: baseanimating.h baseanimating.cpp - Added CBaseAnimating::SequenceDuration (ScriptSequenceDuration) - Added CBaseAnimating::GetPlaybackRate - Added CBaseAnimating::SetPlaybackRate - Added CBaseAnimating::GetCycle - Added CBaseAnimating::SetCycle triggers.h triggers.cpp - Fixed CTriggerCamera::ScriptSetFov setting player FOV while disabled - Added CBaseTrigger::Enable - Added CBaseTrigger::Disable - Added CBaseTrigger::TouchTest - Added CBaseTrigger::IsTouching (ScriptIsTouching) vscript_server.nut vscript_server.cpp - Added CEntities::FindByClassnameWithinBox - Added ::SendToConsoleServer - Added ::CancelEntityIOEvent - Added ::GetEntityIOEventTimeLeft - Moved ScriptDispatchParticleEffect to shared code eventqueue.h cbase.h cbase.cpp - Set entity I/O con output colour - Added (CEventQueue::CancelEventsByInput) - Added (CEventQueue::RemoveEvent) - Added (CEventQueue::GetTimeLeft) baseentity.h baseentity.cpp - Added CBaseEntity::SetTransmitState - Added CBaseEntity::GetTransmitState - Added CBaseEntity::AcceptInput (ScriptAcceptInput) - Added CBaseEntity::FireOutput (ScriptFireOutput) - Added CBaseEntity::GetMaxOutputDelay - Added CBaseEntity::CancelEventsByInput - Added player_use event on InputUse - Fixed InputKill on players ivscript.h vscript_squirrel.cpp - Added IScriptVM::ArrayAppend - Fixed buffer overflow crash - Increased print buffer to 2048 from 256 - Set vscript print output colour vscript_funcs_shared.cpp - Added CNetMsgScriptHelper (CScriptGameEventListener) - Added ::ListenToGameEvent - Added ::StopListeningToGameEvent - Added ::StopListeningToAllGameEvents - Added ::FireGameEvent - Added ::FireGameEventLocal (CScriptSaveRestoreUtil) - Added ::SaveTable - Added ::RestoreTable - Added ::ClearSavedTable - Added callbacks ::OnSave, ::OnRestore (CScriptReadWriteFile) - Added ::StringToFile - Added ::FileToString - Added GlobalSys::GetCommandLine - Added GlobalSys::CommandLineCheck - Added GlobalSys::CommandLineCheckStr - Added GlobalSys::CommandLineCheckFloat - Added GlobalSys::CommandLineCheckInt - Added ::GetCPUUsage - Added ::NXPrint - Added ::Msg (ScriptMsg) - Removed misplaced condition checks - Fixed ScriptEntitiesInBox, *AtPoint, *InSphere logic_eventlistener.cpp - Removed redundant dev msg gamestringpool.cpp - Fixed string pool dump sort
2020-10-27 02:22:18 +03:00
#ifdef MAPBASE_VSCRIPT
static int DoEntFire( const char *pszTarget, const char *pszAction, const char *pszValue, float delay, HSCRIPT hActivator, HSCRIPT hCaller )
#else
static void DoEntFire( const char *pszTarget, const char *pszAction, const char *pszValue, float delay, HSCRIPT hActivator, HSCRIPT hCaller )
vscript additions and fixes: baseanimating.h baseanimating.cpp - Added CBaseAnimating::SequenceDuration (ScriptSequenceDuration) - Added CBaseAnimating::GetPlaybackRate - Added CBaseAnimating::SetPlaybackRate - Added CBaseAnimating::GetCycle - Added CBaseAnimating::SetCycle triggers.h triggers.cpp - Fixed CTriggerCamera::ScriptSetFov setting player FOV while disabled - Added CBaseTrigger::Enable - Added CBaseTrigger::Disable - Added CBaseTrigger::TouchTest - Added CBaseTrigger::IsTouching (ScriptIsTouching) vscript_server.nut vscript_server.cpp - Added CEntities::FindByClassnameWithinBox - Added ::SendToConsoleServer - Added ::CancelEntityIOEvent - Added ::GetEntityIOEventTimeLeft - Moved ScriptDispatchParticleEffect to shared code eventqueue.h cbase.h cbase.cpp - Set entity I/O con output colour - Added (CEventQueue::CancelEventsByInput) - Added (CEventQueue::RemoveEvent) - Added (CEventQueue::GetTimeLeft) baseentity.h baseentity.cpp - Added CBaseEntity::SetTransmitState - Added CBaseEntity::GetTransmitState - Added CBaseEntity::AcceptInput (ScriptAcceptInput) - Added CBaseEntity::FireOutput (ScriptFireOutput) - Added CBaseEntity::GetMaxOutputDelay - Added CBaseEntity::CancelEventsByInput - Added player_use event on InputUse - Fixed InputKill on players ivscript.h vscript_squirrel.cpp - Added IScriptVM::ArrayAppend - Fixed buffer overflow crash - Increased print buffer to 2048 from 256 - Set vscript print output colour vscript_funcs_shared.cpp - Added CNetMsgScriptHelper (CScriptGameEventListener) - Added ::ListenToGameEvent - Added ::StopListeningToGameEvent - Added ::StopListeningToAllGameEvents - Added ::FireGameEvent - Added ::FireGameEventLocal (CScriptSaveRestoreUtil) - Added ::SaveTable - Added ::RestoreTable - Added ::ClearSavedTable - Added callbacks ::OnSave, ::OnRestore (CScriptReadWriteFile) - Added ::StringToFile - Added ::FileToString - Added GlobalSys::GetCommandLine - Added GlobalSys::CommandLineCheck - Added GlobalSys::CommandLineCheckStr - Added GlobalSys::CommandLineCheckFloat - Added GlobalSys::CommandLineCheckInt - Added ::GetCPUUsage - Added ::NXPrint - Added ::Msg (ScriptMsg) - Removed misplaced condition checks - Fixed ScriptEntitiesInBox, *AtPoint, *InSphere logic_eventlistener.cpp - Removed redundant dev msg gamestringpool.cpp - Fixed string pool dump sort
2020-10-27 02:22:18 +03:00
#endif
{
const char *target = "", *action = "Use";
variant_t value;
target = STRING( AllocPooledString( pszTarget ) );
// Don't allow them to run anything on a point_servercommand unless they're the host player. Otherwise they can ent_fire
// and run any command on the server. Admittedly, they can only do the ent_fire if sv_cheats is on, but
// people complained about users resetting the rcon password if the server briefly turned on cheats like this:
// give point_servercommand
// ent_fire point_servercommand command "rcon_password mynewpassword"
if ( gpGlobals->maxClients > 1 && V_stricmp( target, "point_servercommand" ) == 0 )
{
vscript additions and fixes: baseentity_shared.cpp baseentity.cpp c_baseentity.h c_baseentity.cpp c_world.h - Fixed critical ScriptSetContextThink bugs - Added C_BaseEntity::SetContextThink (ScriptSetContextThink) - Added C_BaseEntity::SetSize - Added C_BaseEntity::SetModel - Added C_BaseEntity::Destroy baseentity.h baseentity.cpp - Removed duplicate functions ScriptSetSize and ScriptUtilRemove player.cpp - Moved player script instance registration before player_spawn event vscript_server.cpp - Added CEntities::FindByClassNearestFacing vscript_funcs_shared.cpp - Added GetFrameCount - Added IntervalPerTick vscript_singletons.cpp - Better game event descriptors for CScriptGameEventListener - Added ::effects (CEffectsScriptHelper) - Added ::Convars (CScriptConvarAccessor) vscript_shared.cpp - Fixed clientside entity printing in script VM mapbase_con_groups.h mapbase_con_groups.cpp - Improved performance by changing string comparisons to direct array access vscript_bindings_base.h vscript_bindings_base.cpp - Added CScriptKeyValues::SubKeysToTable vscript_bindings_math.cpp - Added ::SimpleSplineRemapVal - Added ::SimpleSplineRemapValClamped - Added ::Bias - Added ::Gain - Added ::SmoothCurve - Added ::SmoothCurve_Tweak - Added ::ExponentialDecay vscript_squirrel.nut - Added ::Lerp - Added ::FLerp - Added ::SimpleSpline vscript_squirrel.cpp - Added Vector::_unm - Added Vector::Set - Added Vector::Add - Added Vector::Subtract - Added Vector::Multiply - Added Vector::Divide - Added Vector::DistTo - Added Vector::DistToSqr - Added Vector::IsEqualTo - Added Vector::WithinAABox - Added Vector::FromKVString - Changed vector print syntax
2021-03-06 02:11:43 +03:00
#ifdef MAPBASE_VSCRIPT
vscript additions and fixes: baseanimating.h baseanimating.cpp - Added CBaseAnimating::SequenceDuration (ScriptSequenceDuration) - Added CBaseAnimating::GetPlaybackRate - Added CBaseAnimating::SetPlaybackRate - Added CBaseAnimating::GetCycle - Added CBaseAnimating::SetCycle triggers.h triggers.cpp - Fixed CTriggerCamera::ScriptSetFov setting player FOV while disabled - Added CBaseTrigger::Enable - Added CBaseTrigger::Disable - Added CBaseTrigger::TouchTest - Added CBaseTrigger::IsTouching (ScriptIsTouching) vscript_server.nut vscript_server.cpp - Added CEntities::FindByClassnameWithinBox - Added ::SendToConsoleServer - Added ::CancelEntityIOEvent - Added ::GetEntityIOEventTimeLeft - Moved ScriptDispatchParticleEffect to shared code eventqueue.h cbase.h cbase.cpp - Set entity I/O con output colour - Added (CEventQueue::CancelEventsByInput) - Added (CEventQueue::RemoveEvent) - Added (CEventQueue::GetTimeLeft) baseentity.h baseentity.cpp - Added CBaseEntity::SetTransmitState - Added CBaseEntity::GetTransmitState - Added CBaseEntity::AcceptInput (ScriptAcceptInput) - Added CBaseEntity::FireOutput (ScriptFireOutput) - Added CBaseEntity::GetMaxOutputDelay - Added CBaseEntity::CancelEventsByInput - Added player_use event on InputUse - Fixed InputKill on players ivscript.h vscript_squirrel.cpp - Added IScriptVM::ArrayAppend - Fixed buffer overflow crash - Increased print buffer to 2048 from 256 - Set vscript print output colour vscript_funcs_shared.cpp - Added CNetMsgScriptHelper (CScriptGameEventListener) - Added ::ListenToGameEvent - Added ::StopListeningToGameEvent - Added ::StopListeningToAllGameEvents - Added ::FireGameEvent - Added ::FireGameEventLocal (CScriptSaveRestoreUtil) - Added ::SaveTable - Added ::RestoreTable - Added ::ClearSavedTable - Added callbacks ::OnSave, ::OnRestore (CScriptReadWriteFile) - Added ::StringToFile - Added ::FileToString - Added GlobalSys::GetCommandLine - Added GlobalSys::CommandLineCheck - Added GlobalSys::CommandLineCheckStr - Added GlobalSys::CommandLineCheckFloat - Added GlobalSys::CommandLineCheckInt - Added ::GetCPUUsage - Added ::NXPrint - Added ::Msg (ScriptMsg) - Removed misplaced condition checks - Fixed ScriptEntitiesInBox, *AtPoint, *InSphere logic_eventlistener.cpp - Removed redundant dev msg gamestringpool.cpp - Fixed string pool dump sort
2020-10-27 02:22:18 +03:00
return 0;
vscript additions and fixes: baseentity_shared.cpp baseentity.cpp c_baseentity.h c_baseentity.cpp c_world.h - Fixed critical ScriptSetContextThink bugs - Added C_BaseEntity::SetContextThink (ScriptSetContextThink) - Added C_BaseEntity::SetSize - Added C_BaseEntity::SetModel - Added C_BaseEntity::Destroy baseentity.h baseentity.cpp - Removed duplicate functions ScriptSetSize and ScriptUtilRemove player.cpp - Moved player script instance registration before player_spawn event vscript_server.cpp - Added CEntities::FindByClassNearestFacing vscript_funcs_shared.cpp - Added GetFrameCount - Added IntervalPerTick vscript_singletons.cpp - Better game event descriptors for CScriptGameEventListener - Added ::effects (CEffectsScriptHelper) - Added ::Convars (CScriptConvarAccessor) vscript_shared.cpp - Fixed clientside entity printing in script VM mapbase_con_groups.h mapbase_con_groups.cpp - Improved performance by changing string comparisons to direct array access vscript_bindings_base.h vscript_bindings_base.cpp - Added CScriptKeyValues::SubKeysToTable vscript_bindings_math.cpp - Added ::SimpleSplineRemapVal - Added ::SimpleSplineRemapValClamped - Added ::Bias - Added ::Gain - Added ::SmoothCurve - Added ::SmoothCurve_Tweak - Added ::ExponentialDecay vscript_squirrel.nut - Added ::Lerp - Added ::FLerp - Added ::SimpleSpline vscript_squirrel.cpp - Added Vector::_unm - Added Vector::Set - Added Vector::Add - Added Vector::Subtract - Added Vector::Multiply - Added Vector::Divide - Added Vector::DistTo - Added Vector::DistToSqr - Added Vector::IsEqualTo - Added Vector::WithinAABox - Added Vector::FromKVString - Changed vector print syntax
2021-03-06 02:11:43 +03:00
#else
return;
#endif
}
if ( *pszAction )
{
action = STRING( AllocPooledString( pszAction ) );
}
if ( *pszValue )
{
value.SetString( AllocPooledString( pszValue ) );
}
if ( delay < 0 )
{
delay = 0;
}
vscript additions and fixes: baseanimating.h baseanimating.cpp - Added CBaseAnimating::SequenceDuration (ScriptSequenceDuration) - Added CBaseAnimating::GetPlaybackRate - Added CBaseAnimating::SetPlaybackRate - Added CBaseAnimating::GetCycle - Added CBaseAnimating::SetCycle triggers.h triggers.cpp - Fixed CTriggerCamera::ScriptSetFov setting player FOV while disabled - Added CBaseTrigger::Enable - Added CBaseTrigger::Disable - Added CBaseTrigger::TouchTest - Added CBaseTrigger::IsTouching (ScriptIsTouching) vscript_server.nut vscript_server.cpp - Added CEntities::FindByClassnameWithinBox - Added ::SendToConsoleServer - Added ::CancelEntityIOEvent - Added ::GetEntityIOEventTimeLeft - Moved ScriptDispatchParticleEffect to shared code eventqueue.h cbase.h cbase.cpp - Set entity I/O con output colour - Added (CEventQueue::CancelEventsByInput) - Added (CEventQueue::RemoveEvent) - Added (CEventQueue::GetTimeLeft) baseentity.h baseentity.cpp - Added CBaseEntity::SetTransmitState - Added CBaseEntity::GetTransmitState - Added CBaseEntity::AcceptInput (ScriptAcceptInput) - Added CBaseEntity::FireOutput (ScriptFireOutput) - Added CBaseEntity::GetMaxOutputDelay - Added CBaseEntity::CancelEventsByInput - Added player_use event on InputUse - Fixed InputKill on players ivscript.h vscript_squirrel.cpp - Added IScriptVM::ArrayAppend - Fixed buffer overflow crash - Increased print buffer to 2048 from 256 - Set vscript print output colour vscript_funcs_shared.cpp - Added CNetMsgScriptHelper (CScriptGameEventListener) - Added ::ListenToGameEvent - Added ::StopListeningToGameEvent - Added ::StopListeningToAllGameEvents - Added ::FireGameEvent - Added ::FireGameEventLocal (CScriptSaveRestoreUtil) - Added ::SaveTable - Added ::RestoreTable - Added ::ClearSavedTable - Added callbacks ::OnSave, ::OnRestore (CScriptReadWriteFile) - Added ::StringToFile - Added ::FileToString - Added GlobalSys::GetCommandLine - Added GlobalSys::CommandLineCheck - Added GlobalSys::CommandLineCheckStr - Added GlobalSys::CommandLineCheckFloat - Added GlobalSys::CommandLineCheckInt - Added ::GetCPUUsage - Added ::NXPrint - Added ::Msg (ScriptMsg) - Removed misplaced condition checks - Fixed ScriptEntitiesInBox, *AtPoint, *InSphere logic_eventlistener.cpp - Removed redundant dev msg gamestringpool.cpp - Fixed string pool dump sort
2020-10-27 02:22:18 +03:00
#ifdef MAPBASE_VSCRIPT
return
#endif
g_EventQueue.AddEvent( target, action, value, delay, ToEnt(hActivator), ToEnt(hCaller) );
}
bool DoIncludeScript( const char *pszScript, HSCRIPT hScope )
{
if ( !VScriptRunScript( pszScript, hScope, true ) )
{
g_pScriptVM->RaiseException( CFmtStr( "Failed to include script \"%s\"", ( pszScript ) ? pszScript : "unknown" ) );
return false;
}
return true;
}
HSCRIPT CreateProp( const char *pszEntityName, const Vector &vOrigin, const char *pszModelName, int iAnim )
{
CBaseAnimating *pBaseEntity = (CBaseAnimating *)CreateEntityByName( pszEntityName );
pBaseEntity->SetAbsOrigin( vOrigin );
pBaseEntity->SetModel( pszModelName );
pBaseEntity->SetPlaybackRate( 1.0f );
int iSequence = pBaseEntity->SelectWeightedSequence( (Activity)iAnim );
if ( iSequence != -1 )
{
pBaseEntity->SetSequence( iSequence );
}
return ToHScript( pBaseEntity );
}
//--------------------------------------------------------------------------------------------------
// Use an entity's script instance to add an entity IO event (used for firing events on unnamed entities from vscript)
//--------------------------------------------------------------------------------------------------
vscript additions and fixes: baseanimating.h baseanimating.cpp - Added CBaseAnimating::SequenceDuration (ScriptSequenceDuration) - Added CBaseAnimating::GetPlaybackRate - Added CBaseAnimating::SetPlaybackRate - Added CBaseAnimating::GetCycle - Added CBaseAnimating::SetCycle triggers.h triggers.cpp - Fixed CTriggerCamera::ScriptSetFov setting player FOV while disabled - Added CBaseTrigger::Enable - Added CBaseTrigger::Disable - Added CBaseTrigger::TouchTest - Added CBaseTrigger::IsTouching (ScriptIsTouching) vscript_server.nut vscript_server.cpp - Added CEntities::FindByClassnameWithinBox - Added ::SendToConsoleServer - Added ::CancelEntityIOEvent - Added ::GetEntityIOEventTimeLeft - Moved ScriptDispatchParticleEffect to shared code eventqueue.h cbase.h cbase.cpp - Set entity I/O con output colour - Added (CEventQueue::CancelEventsByInput) - Added (CEventQueue::RemoveEvent) - Added (CEventQueue::GetTimeLeft) baseentity.h baseentity.cpp - Added CBaseEntity::SetTransmitState - Added CBaseEntity::GetTransmitState - Added CBaseEntity::AcceptInput (ScriptAcceptInput) - Added CBaseEntity::FireOutput (ScriptFireOutput) - Added CBaseEntity::GetMaxOutputDelay - Added CBaseEntity::CancelEventsByInput - Added player_use event on InputUse - Fixed InputKill on players ivscript.h vscript_squirrel.cpp - Added IScriptVM::ArrayAppend - Fixed buffer overflow crash - Increased print buffer to 2048 from 256 - Set vscript print output colour vscript_funcs_shared.cpp - Added CNetMsgScriptHelper (CScriptGameEventListener) - Added ::ListenToGameEvent - Added ::StopListeningToGameEvent - Added ::StopListeningToAllGameEvents - Added ::FireGameEvent - Added ::FireGameEventLocal (CScriptSaveRestoreUtil) - Added ::SaveTable - Added ::RestoreTable - Added ::ClearSavedTable - Added callbacks ::OnSave, ::OnRestore (CScriptReadWriteFile) - Added ::StringToFile - Added ::FileToString - Added GlobalSys::GetCommandLine - Added GlobalSys::CommandLineCheck - Added GlobalSys::CommandLineCheckStr - Added GlobalSys::CommandLineCheckFloat - Added GlobalSys::CommandLineCheckInt - Added ::GetCPUUsage - Added ::NXPrint - Added ::Msg (ScriptMsg) - Removed misplaced condition checks - Fixed ScriptEntitiesInBox, *AtPoint, *InSphere logic_eventlistener.cpp - Removed redundant dev msg gamestringpool.cpp - Fixed string pool dump sort
2020-10-27 02:22:18 +03:00
#ifdef MAPBASE_VSCRIPT
static int DoEntFireByInstanceHandle( HSCRIPT hTarget, const char *pszAction, const char *pszValue, float delay, HSCRIPT hActivator, HSCRIPT hCaller )
#else
static void DoEntFireByInstanceHandle( HSCRIPT hTarget, const char *pszAction, const char *pszValue, float delay, HSCRIPT hActivator, HSCRIPT hCaller )
vscript additions and fixes: baseanimating.h baseanimating.cpp - Added CBaseAnimating::SequenceDuration (ScriptSequenceDuration) - Added CBaseAnimating::GetPlaybackRate - Added CBaseAnimating::SetPlaybackRate - Added CBaseAnimating::GetCycle - Added CBaseAnimating::SetCycle triggers.h triggers.cpp - Fixed CTriggerCamera::ScriptSetFov setting player FOV while disabled - Added CBaseTrigger::Enable - Added CBaseTrigger::Disable - Added CBaseTrigger::TouchTest - Added CBaseTrigger::IsTouching (ScriptIsTouching) vscript_server.nut vscript_server.cpp - Added CEntities::FindByClassnameWithinBox - Added ::SendToConsoleServer - Added ::CancelEntityIOEvent - Added ::GetEntityIOEventTimeLeft - Moved ScriptDispatchParticleEffect to shared code eventqueue.h cbase.h cbase.cpp - Set entity I/O con output colour - Added (CEventQueue::CancelEventsByInput) - Added (CEventQueue::RemoveEvent) - Added (CEventQueue::GetTimeLeft) baseentity.h baseentity.cpp - Added CBaseEntity::SetTransmitState - Added CBaseEntity::GetTransmitState - Added CBaseEntity::AcceptInput (ScriptAcceptInput) - Added CBaseEntity::FireOutput (ScriptFireOutput) - Added CBaseEntity::GetMaxOutputDelay - Added CBaseEntity::CancelEventsByInput - Added player_use event on InputUse - Fixed InputKill on players ivscript.h vscript_squirrel.cpp - Added IScriptVM::ArrayAppend - Fixed buffer overflow crash - Increased print buffer to 2048 from 256 - Set vscript print output colour vscript_funcs_shared.cpp - Added CNetMsgScriptHelper (CScriptGameEventListener) - Added ::ListenToGameEvent - Added ::StopListeningToGameEvent - Added ::StopListeningToAllGameEvents - Added ::FireGameEvent - Added ::FireGameEventLocal (CScriptSaveRestoreUtil) - Added ::SaveTable - Added ::RestoreTable - Added ::ClearSavedTable - Added callbacks ::OnSave, ::OnRestore (CScriptReadWriteFile) - Added ::StringToFile - Added ::FileToString - Added GlobalSys::GetCommandLine - Added GlobalSys::CommandLineCheck - Added GlobalSys::CommandLineCheckStr - Added GlobalSys::CommandLineCheckFloat - Added GlobalSys::CommandLineCheckInt - Added ::GetCPUUsage - Added ::NXPrint - Added ::Msg (ScriptMsg) - Removed misplaced condition checks - Fixed ScriptEntitiesInBox, *AtPoint, *InSphere logic_eventlistener.cpp - Removed redundant dev msg gamestringpool.cpp - Fixed string pool dump sort
2020-10-27 02:22:18 +03:00
#endif
{
const char *action = "Use";
variant_t value;
if ( *pszAction )
{
action = STRING( AllocPooledString( pszAction ) );
}
if ( *pszValue )
{
value.SetString( AllocPooledString( pszValue ) );
}
if ( delay < 0 )
{
delay = 0;
}
CBaseEntity* pTarget = ToEnt(hTarget);
if ( !pTarget )
{
Mapbase v6.0 - Fixed path_track paths saving as pointers instead of handles - Fixed player animations not falling to base class correctly - Fixed logic_externaldata creating garbage in trailing spaces - Added "SetHandModelSkin" input - Added unique colors for various types of console message, adjustable via convars - Added the ability to use map-specific weapon scripts - Added a way to display (placeholder) text entirely from Faceposer scenes - Added "autobreak" keyvalue to game_text, which automatically breaks long text into different lines - Added the ability to change a game_text's font (very limited) - Added LightToggle input to point_spotlight - Added Enable/DisableSprites on npc_manhack - Added ai_goal_police behavior from metrocops to Combine soldiers and citizens - Added func_precipitation particle rain systems from the Alien Swarm SDK - Added new func_precipitation spawnflags for controlling behavior in particle types - Added "mapbase_version" cvar which shows the version of Mapbase a mod might be running on - Fixed an oversight with NPC crouch activities which was causing npc_metropolice to stop firing in standoffs - Added toggleable patches to npc_combine AI which make soldiers less likely to stand around without shooting or rush to melee when not needed - Added key for custom logo font on env_credits scripts - Added SetSpeed and SetPushDir inputs for trigger_push - Added a bunch of I/O/KV to func_fish_pool to allow for more control over the fish - Added OnLostEnemy/Player support for npc_combine_camera - Added enhanced save/restore for the Response System, toggleable via convar - Added a convar which allows users to disable weapon autoswitching when picking up ammo - Split VScript base script into its own file - Added VScript descriptions for NPC squads and the manager class which handles them - Moved several classes, functions, etc. to the VScript library itself for future usage in other projects, like VBSP - Added VScript to VBSP with basic map file interfacing - Made some VScript documentation more clear due to deprecation of online documentation - Added VScript "hook" registration, creating a standardized system which shows up in script_help documentation - Added VScript-driven custom weapons - Added clientside VScript scopes - Added a bunch of weapon-related VScript functions - Split a bunch of cluttered VScript stuff into different files - Added VScript functions for "following" entities/bonemerging - Added VScript functions for grenades - Added a few more VScript trigger functions - Added OnDeath hook for VScript - Fixed documentation for aliased functions in VScript - Fixed $bumpmask not working on SDK_LightmappedGeneric - Made vertex blend swapping in Hammer use a constant instead of a combo (makes it easier to compile the shader, especially for $bumpmask's sake) - Fixed brush phong, etc. causing SDK_WorldVertexTransition to stop working - Added limited support for $envmapmask in the bumpmapping shader - Fixed more issues with parallax corrected cubemaps and instances - Made instance variable recursion consistent with VMFII
2020-11-26 05:26:55 +03:00
CGWarning( 0, CON_GROUP_VSCRIPT, "VScript error: DoEntFire was passed an invalid entity instance.\n" );
vscript additions and fixes: baseanimating.h baseanimating.cpp - Added CBaseAnimating::SequenceDuration (ScriptSequenceDuration) - Added CBaseAnimating::GetPlaybackRate - Added CBaseAnimating::SetPlaybackRate - Added CBaseAnimating::GetCycle - Added CBaseAnimating::SetCycle triggers.h triggers.cpp - Fixed CTriggerCamera::ScriptSetFov setting player FOV while disabled - Added CBaseTrigger::Enable - Added CBaseTrigger::Disable - Added CBaseTrigger::TouchTest - Added CBaseTrigger::IsTouching (ScriptIsTouching) vscript_server.nut vscript_server.cpp - Added CEntities::FindByClassnameWithinBox - Added ::SendToConsoleServer - Added ::CancelEntityIOEvent - Added ::GetEntityIOEventTimeLeft - Moved ScriptDispatchParticleEffect to shared code eventqueue.h cbase.h cbase.cpp - Set entity I/O con output colour - Added (CEventQueue::CancelEventsByInput) - Added (CEventQueue::RemoveEvent) - Added (CEventQueue::GetTimeLeft) baseentity.h baseentity.cpp - Added CBaseEntity::SetTransmitState - Added CBaseEntity::GetTransmitState - Added CBaseEntity::AcceptInput (ScriptAcceptInput) - Added CBaseEntity::FireOutput (ScriptFireOutput) - Added CBaseEntity::GetMaxOutputDelay - Added CBaseEntity::CancelEventsByInput - Added player_use event on InputUse - Fixed InputKill on players ivscript.h vscript_squirrel.cpp - Added IScriptVM::ArrayAppend - Fixed buffer overflow crash - Increased print buffer to 2048 from 256 - Set vscript print output colour vscript_funcs_shared.cpp - Added CNetMsgScriptHelper (CScriptGameEventListener) - Added ::ListenToGameEvent - Added ::StopListeningToGameEvent - Added ::StopListeningToAllGameEvents - Added ::FireGameEvent - Added ::FireGameEventLocal (CScriptSaveRestoreUtil) - Added ::SaveTable - Added ::RestoreTable - Added ::ClearSavedTable - Added callbacks ::OnSave, ::OnRestore (CScriptReadWriteFile) - Added ::StringToFile - Added ::FileToString - Added GlobalSys::GetCommandLine - Added GlobalSys::CommandLineCheck - Added GlobalSys::CommandLineCheckStr - Added GlobalSys::CommandLineCheckFloat - Added GlobalSys::CommandLineCheckInt - Added ::GetCPUUsage - Added ::NXPrint - Added ::Msg (ScriptMsg) - Removed misplaced condition checks - Fixed ScriptEntitiesInBox, *AtPoint, *InSphere logic_eventlistener.cpp - Removed redundant dev msg gamestringpool.cpp - Fixed string pool dump sort
2020-10-27 02:22:18 +03:00
#ifdef MAPBASE_VSCRIPT
return 0;
#else
return;
vscript additions and fixes: baseanimating.h baseanimating.cpp - Added CBaseAnimating::SequenceDuration (ScriptSequenceDuration) - Added CBaseAnimating::GetPlaybackRate - Added CBaseAnimating::SetPlaybackRate - Added CBaseAnimating::GetCycle - Added CBaseAnimating::SetCycle triggers.h triggers.cpp - Fixed CTriggerCamera::ScriptSetFov setting player FOV while disabled - Added CBaseTrigger::Enable - Added CBaseTrigger::Disable - Added CBaseTrigger::TouchTest - Added CBaseTrigger::IsTouching (ScriptIsTouching) vscript_server.nut vscript_server.cpp - Added CEntities::FindByClassnameWithinBox - Added ::SendToConsoleServer - Added ::CancelEntityIOEvent - Added ::GetEntityIOEventTimeLeft - Moved ScriptDispatchParticleEffect to shared code eventqueue.h cbase.h cbase.cpp - Set entity I/O con output colour - Added (CEventQueue::CancelEventsByInput) - Added (CEventQueue::RemoveEvent) - Added (CEventQueue::GetTimeLeft) baseentity.h baseentity.cpp - Added CBaseEntity::SetTransmitState - Added CBaseEntity::GetTransmitState - Added CBaseEntity::AcceptInput (ScriptAcceptInput) - Added CBaseEntity::FireOutput (ScriptFireOutput) - Added CBaseEntity::GetMaxOutputDelay - Added CBaseEntity::CancelEventsByInput - Added player_use event on InputUse - Fixed InputKill on players ivscript.h vscript_squirrel.cpp - Added IScriptVM::ArrayAppend - Fixed buffer overflow crash - Increased print buffer to 2048 from 256 - Set vscript print output colour vscript_funcs_shared.cpp - Added CNetMsgScriptHelper (CScriptGameEventListener) - Added ::ListenToGameEvent - Added ::StopListeningToGameEvent - Added ::StopListeningToAllGameEvents - Added ::FireGameEvent - Added ::FireGameEventLocal (CScriptSaveRestoreUtil) - Added ::SaveTable - Added ::RestoreTable - Added ::ClearSavedTable - Added callbacks ::OnSave, ::OnRestore (CScriptReadWriteFile) - Added ::StringToFile - Added ::FileToString - Added GlobalSys::GetCommandLine - Added GlobalSys::CommandLineCheck - Added GlobalSys::CommandLineCheckStr - Added GlobalSys::CommandLineCheckFloat - Added GlobalSys::CommandLineCheckInt - Added ::GetCPUUsage - Added ::NXPrint - Added ::Msg (ScriptMsg) - Removed misplaced condition checks - Fixed ScriptEntitiesInBox, *AtPoint, *InSphere logic_eventlistener.cpp - Removed redundant dev msg gamestringpool.cpp - Fixed string pool dump sort
2020-10-27 02:22:18 +03:00
#endif
}
vscript additions and fixes: baseanimating.h baseanimating.cpp - Added CBaseAnimating::SequenceDuration (ScriptSequenceDuration) - Added CBaseAnimating::GetPlaybackRate - Added CBaseAnimating::SetPlaybackRate - Added CBaseAnimating::GetCycle - Added CBaseAnimating::SetCycle triggers.h triggers.cpp - Fixed CTriggerCamera::ScriptSetFov setting player FOV while disabled - Added CBaseTrigger::Enable - Added CBaseTrigger::Disable - Added CBaseTrigger::TouchTest - Added CBaseTrigger::IsTouching (ScriptIsTouching) vscript_server.nut vscript_server.cpp - Added CEntities::FindByClassnameWithinBox - Added ::SendToConsoleServer - Added ::CancelEntityIOEvent - Added ::GetEntityIOEventTimeLeft - Moved ScriptDispatchParticleEffect to shared code eventqueue.h cbase.h cbase.cpp - Set entity I/O con output colour - Added (CEventQueue::CancelEventsByInput) - Added (CEventQueue::RemoveEvent) - Added (CEventQueue::GetTimeLeft) baseentity.h baseentity.cpp - Added CBaseEntity::SetTransmitState - Added CBaseEntity::GetTransmitState - Added CBaseEntity::AcceptInput (ScriptAcceptInput) - Added CBaseEntity::FireOutput (ScriptFireOutput) - Added CBaseEntity::GetMaxOutputDelay - Added CBaseEntity::CancelEventsByInput - Added player_use event on InputUse - Fixed InputKill on players ivscript.h vscript_squirrel.cpp - Added IScriptVM::ArrayAppend - Fixed buffer overflow crash - Increased print buffer to 2048 from 256 - Set vscript print output colour vscript_funcs_shared.cpp - Added CNetMsgScriptHelper (CScriptGameEventListener) - Added ::ListenToGameEvent - Added ::StopListeningToGameEvent - Added ::StopListeningToAllGameEvents - Added ::FireGameEvent - Added ::FireGameEventLocal (CScriptSaveRestoreUtil) - Added ::SaveTable - Added ::RestoreTable - Added ::ClearSavedTable - Added callbacks ::OnSave, ::OnRestore (CScriptReadWriteFile) - Added ::StringToFile - Added ::FileToString - Added GlobalSys::GetCommandLine - Added GlobalSys::CommandLineCheck - Added GlobalSys::CommandLineCheckStr - Added GlobalSys::CommandLineCheckFloat - Added GlobalSys::CommandLineCheckInt - Added ::GetCPUUsage - Added ::NXPrint - Added ::Msg (ScriptMsg) - Removed misplaced condition checks - Fixed ScriptEntitiesInBox, *AtPoint, *InSphere logic_eventlistener.cpp - Removed redundant dev msg gamestringpool.cpp - Fixed string pool dump sort
2020-10-27 02:22:18 +03:00
#ifdef MAPBASE_VSCRIPT
return
#endif
g_EventQueue.AddEvent( pTarget, action, value, delay, ToEnt(hActivator), ToEnt(hCaller) );
}
static float ScriptTraceLine( const Vector &vecStart, const Vector &vecEnd, HSCRIPT entIgnore )
{
// UTIL_TraceLine( vecAbsStart, vecAbsEnd, MASK_BLOCKLOS, pLooker, COLLISION_GROUP_NONE, ptr );
trace_t tr;
CBaseEntity *pLooker = ToEnt(entIgnore);
UTIL_TraceLine( vecStart, vecEnd, MASK_NPCWORLDSTATIC, pLooker, COLLISION_GROUP_NONE, &tr);
if (tr.fractionleftsolid && tr.startsolid)
{
return 1.0 - tr.fractionleftsolid;
}
else
{
return tr.fraction;
}
}
vscript changes: c_baseentity.h c_baseentity.cpp - Renamed GetLeftVector to GetRightVector - Renamed GetTeamNumber to GetTeam baseentity.h baseentity.cpp - Renamed GetLeftVector to GetRightVector - Renamed Get/SetRender functions (GetAlpha -> GetRenderAlpha) - Fixed CBaseEntity::GetScriptId - Added hook CBaseEntity::UpdateOnRemove - Added CBaseEntity::GetOrCreatePrivateScriptScope - Added CBaseEntity::GetDebugName - Added CBaseEntity::GetGravity - Added CBaseEntity::SetGravity - Added CBaseEntity::GetFriction - Added CBaseEntity::SetFriction - Added CBaseEntity::GetMass - Added CBaseEntity::SetMass - Added CBaseEntity::SetName (SetNameAsCStr) - Added CBaseEntity::SetParent (ScriptSetParent) - Added CBaseEntity::SetThink (ScriptSetThink) - Added CBaseEntity::StopThink (ScriptStopThink) - Added CBaseEntity::SetThinkFunction (ScriptSetThinkFunction) - Added CBaseEntity::StopThinkFunction (ScriptStopThinkFunction) - Added CBaseEntity::ApplyAbsVelocityImpulse - Added CBaseEntity::ApplyLocalAngularVelocityImpulse player.h player.cpp - Renamed GetPlayerUserId to GetUserID - Added CBasePlayer::GetFOV - Added CBasePlayer::GetFOVOwner (ScriptGetFOVOwner) - Added CBasePlayer::SetFOV (ScriptSetFOV) vscript_consts_shared.cpp -Added RAD2DEG, DEG2RAD, MAX_COORD_FLOAT, MAX_TRACE_LENGTH vscript_funcs_shared.cpp - Renamed IsClientScript,IsServerScript to IsClient,IsServer - Added IsDedicatedServer - Added NPrint (Con_NPrintf) - Removed DebugDrawBoxDirection (debugoverlay.BoxDirection) - Removed DebugDrawText (debugoverlay.Text) vscript_server.cpp - Added CDebugOverlayScriptHelper (debugoverlay) - Added CEntities::GetLocalPlayer - Added DispatchParticleEffect (ScriptDispatchParticleEffect) - Removed DebugDrawBox (debugoverlay.Box) - Removed DebugDrawLine (debugoverlay.Line) vscript_squirrel.cpp - Changed stub error messages for consistency and clarity - Changed errorfunc output to Warning instead of Msg - Added Msg, Warning - Added clamp, min, max, RemapVal, RemapValClamped - Added sqstdtime.h - Added clock, time, date
2020-08-30 15:58:34 +03:00
#ifdef MAPBASE_VSCRIPT
vscript additions and fixes: baseanimating.h baseanimating.cpp - Added CBaseAnimating::SequenceDuration (ScriptSequenceDuration) - Added CBaseAnimating::GetPlaybackRate - Added CBaseAnimating::SetPlaybackRate - Added CBaseAnimating::GetCycle - Added CBaseAnimating::SetCycle triggers.h triggers.cpp - Fixed CTriggerCamera::ScriptSetFov setting player FOV while disabled - Added CBaseTrigger::Enable - Added CBaseTrigger::Disable - Added CBaseTrigger::TouchTest - Added CBaseTrigger::IsTouching (ScriptIsTouching) vscript_server.nut vscript_server.cpp - Added CEntities::FindByClassnameWithinBox - Added ::SendToConsoleServer - Added ::CancelEntityIOEvent - Added ::GetEntityIOEventTimeLeft - Moved ScriptDispatchParticleEffect to shared code eventqueue.h cbase.h cbase.cpp - Set entity I/O con output colour - Added (CEventQueue::CancelEventsByInput) - Added (CEventQueue::RemoveEvent) - Added (CEventQueue::GetTimeLeft) baseentity.h baseentity.cpp - Added CBaseEntity::SetTransmitState - Added CBaseEntity::GetTransmitState - Added CBaseEntity::AcceptInput (ScriptAcceptInput) - Added CBaseEntity::FireOutput (ScriptFireOutput) - Added CBaseEntity::GetMaxOutputDelay - Added CBaseEntity::CancelEventsByInput - Added player_use event on InputUse - Fixed InputKill on players ivscript.h vscript_squirrel.cpp - Added IScriptVM::ArrayAppend - Fixed buffer overflow crash - Increased print buffer to 2048 from 256 - Set vscript print output colour vscript_funcs_shared.cpp - Added CNetMsgScriptHelper (CScriptGameEventListener) - Added ::ListenToGameEvent - Added ::StopListeningToGameEvent - Added ::StopListeningToAllGameEvents - Added ::FireGameEvent - Added ::FireGameEventLocal (CScriptSaveRestoreUtil) - Added ::SaveTable - Added ::RestoreTable - Added ::ClearSavedTable - Added callbacks ::OnSave, ::OnRestore (CScriptReadWriteFile) - Added ::StringToFile - Added ::FileToString - Added GlobalSys::GetCommandLine - Added GlobalSys::CommandLineCheck - Added GlobalSys::CommandLineCheckStr - Added GlobalSys::CommandLineCheckFloat - Added GlobalSys::CommandLineCheckInt - Added ::GetCPUUsage - Added ::NXPrint - Added ::Msg (ScriptMsg) - Removed misplaced condition checks - Fixed ScriptEntitiesInBox, *AtPoint, *InSphere logic_eventlistener.cpp - Removed redundant dev msg gamestringpool.cpp - Fixed string pool dump sort
2020-10-27 02:22:18 +03:00
static bool CancelEntityIOEvent( int event )
vscript changes: c_baseentity.h c_baseentity.cpp - Renamed GetLeftVector to GetRightVector - Renamed GetTeamNumber to GetTeam baseentity.h baseentity.cpp - Renamed GetLeftVector to GetRightVector - Renamed Get/SetRender functions (GetAlpha -> GetRenderAlpha) - Fixed CBaseEntity::GetScriptId - Added hook CBaseEntity::UpdateOnRemove - Added CBaseEntity::GetOrCreatePrivateScriptScope - Added CBaseEntity::GetDebugName - Added CBaseEntity::GetGravity - Added CBaseEntity::SetGravity - Added CBaseEntity::GetFriction - Added CBaseEntity::SetFriction - Added CBaseEntity::GetMass - Added CBaseEntity::SetMass - Added CBaseEntity::SetName (SetNameAsCStr) - Added CBaseEntity::SetParent (ScriptSetParent) - Added CBaseEntity::SetThink (ScriptSetThink) - Added CBaseEntity::StopThink (ScriptStopThink) - Added CBaseEntity::SetThinkFunction (ScriptSetThinkFunction) - Added CBaseEntity::StopThinkFunction (ScriptStopThinkFunction) - Added CBaseEntity::ApplyAbsVelocityImpulse - Added CBaseEntity::ApplyLocalAngularVelocityImpulse player.h player.cpp - Renamed GetPlayerUserId to GetUserID - Added CBasePlayer::GetFOV - Added CBasePlayer::GetFOVOwner (ScriptGetFOVOwner) - Added CBasePlayer::SetFOV (ScriptSetFOV) vscript_consts_shared.cpp -Added RAD2DEG, DEG2RAD, MAX_COORD_FLOAT, MAX_TRACE_LENGTH vscript_funcs_shared.cpp - Renamed IsClientScript,IsServerScript to IsClient,IsServer - Added IsDedicatedServer - Added NPrint (Con_NPrintf) - Removed DebugDrawBoxDirection (debugoverlay.BoxDirection) - Removed DebugDrawText (debugoverlay.Text) vscript_server.cpp - Added CDebugOverlayScriptHelper (debugoverlay) - Added CEntities::GetLocalPlayer - Added DispatchParticleEffect (ScriptDispatchParticleEffect) - Removed DebugDrawBox (debugoverlay.Box) - Removed DebugDrawLine (debugoverlay.Line) vscript_squirrel.cpp - Changed stub error messages for consistency and clarity - Changed errorfunc output to Warning instead of Msg - Added Msg, Warning - Added clamp, min, max, RemapVal, RemapValClamped - Added sqstdtime.h - Added clock, time, date
2020-08-30 15:58:34 +03:00
{
vscript additions and fixes: baseanimating.h baseanimating.cpp - Added CBaseAnimating::SequenceDuration (ScriptSequenceDuration) - Added CBaseAnimating::GetPlaybackRate - Added CBaseAnimating::SetPlaybackRate - Added CBaseAnimating::GetCycle - Added CBaseAnimating::SetCycle triggers.h triggers.cpp - Fixed CTriggerCamera::ScriptSetFov setting player FOV while disabled - Added CBaseTrigger::Enable - Added CBaseTrigger::Disable - Added CBaseTrigger::TouchTest - Added CBaseTrigger::IsTouching (ScriptIsTouching) vscript_server.nut vscript_server.cpp - Added CEntities::FindByClassnameWithinBox - Added ::SendToConsoleServer - Added ::CancelEntityIOEvent - Added ::GetEntityIOEventTimeLeft - Moved ScriptDispatchParticleEffect to shared code eventqueue.h cbase.h cbase.cpp - Set entity I/O con output colour - Added (CEventQueue::CancelEventsByInput) - Added (CEventQueue::RemoveEvent) - Added (CEventQueue::GetTimeLeft) baseentity.h baseentity.cpp - Added CBaseEntity::SetTransmitState - Added CBaseEntity::GetTransmitState - Added CBaseEntity::AcceptInput (ScriptAcceptInput) - Added CBaseEntity::FireOutput (ScriptFireOutput) - Added CBaseEntity::GetMaxOutputDelay - Added CBaseEntity::CancelEventsByInput - Added player_use event on InputUse - Fixed InputKill on players ivscript.h vscript_squirrel.cpp - Added IScriptVM::ArrayAppend - Fixed buffer overflow crash - Increased print buffer to 2048 from 256 - Set vscript print output colour vscript_funcs_shared.cpp - Added CNetMsgScriptHelper (CScriptGameEventListener) - Added ::ListenToGameEvent - Added ::StopListeningToGameEvent - Added ::StopListeningToAllGameEvents - Added ::FireGameEvent - Added ::FireGameEventLocal (CScriptSaveRestoreUtil) - Added ::SaveTable - Added ::RestoreTable - Added ::ClearSavedTable - Added callbacks ::OnSave, ::OnRestore (CScriptReadWriteFile) - Added ::StringToFile - Added ::FileToString - Added GlobalSys::GetCommandLine - Added GlobalSys::CommandLineCheck - Added GlobalSys::CommandLineCheckStr - Added GlobalSys::CommandLineCheckFloat - Added GlobalSys::CommandLineCheckInt - Added ::GetCPUUsage - Added ::NXPrint - Added ::Msg (ScriptMsg) - Removed misplaced condition checks - Fixed ScriptEntitiesInBox, *AtPoint, *InSphere logic_eventlistener.cpp - Removed redundant dev msg gamestringpool.cpp - Fixed string pool dump sort
2020-10-27 02:22:18 +03:00
return g_EventQueue.RemoveEvent(event);
vscript changes: c_baseentity.h c_baseentity.cpp - Renamed GetLeftVector to GetRightVector - Renamed GetTeamNumber to GetTeam baseentity.h baseentity.cpp - Renamed GetLeftVector to GetRightVector - Renamed Get/SetRender functions (GetAlpha -> GetRenderAlpha) - Fixed CBaseEntity::GetScriptId - Added hook CBaseEntity::UpdateOnRemove - Added CBaseEntity::GetOrCreatePrivateScriptScope - Added CBaseEntity::GetDebugName - Added CBaseEntity::GetGravity - Added CBaseEntity::SetGravity - Added CBaseEntity::GetFriction - Added CBaseEntity::SetFriction - Added CBaseEntity::GetMass - Added CBaseEntity::SetMass - Added CBaseEntity::SetName (SetNameAsCStr) - Added CBaseEntity::SetParent (ScriptSetParent) - Added CBaseEntity::SetThink (ScriptSetThink) - Added CBaseEntity::StopThink (ScriptStopThink) - Added CBaseEntity::SetThinkFunction (ScriptSetThinkFunction) - Added CBaseEntity::StopThinkFunction (ScriptStopThinkFunction) - Added CBaseEntity::ApplyAbsVelocityImpulse - Added CBaseEntity::ApplyLocalAngularVelocityImpulse player.h player.cpp - Renamed GetPlayerUserId to GetUserID - Added CBasePlayer::GetFOV - Added CBasePlayer::GetFOVOwner (ScriptGetFOVOwner) - Added CBasePlayer::SetFOV (ScriptSetFOV) vscript_consts_shared.cpp -Added RAD2DEG, DEG2RAD, MAX_COORD_FLOAT, MAX_TRACE_LENGTH vscript_funcs_shared.cpp - Renamed IsClientScript,IsServerScript to IsClient,IsServer - Added IsDedicatedServer - Added NPrint (Con_NPrintf) - Removed DebugDrawBoxDirection (debugoverlay.BoxDirection) - Removed DebugDrawText (debugoverlay.Text) vscript_server.cpp - Added CDebugOverlayScriptHelper (debugoverlay) - Added CEntities::GetLocalPlayer - Added DispatchParticleEffect (ScriptDispatchParticleEffect) - Removed DebugDrawBox (debugoverlay.Box) - Removed DebugDrawLine (debugoverlay.Line) vscript_squirrel.cpp - Changed stub error messages for consistency and clarity - Changed errorfunc output to Warning instead of Msg - Added Msg, Warning - Added clamp, min, max, RemapVal, RemapValClamped - Added sqstdtime.h - Added clock, time, date
2020-08-30 15:58:34 +03:00
}
vscript additions and fixes: baseanimating.h baseanimating.cpp - Added CBaseAnimating::SequenceDuration (ScriptSequenceDuration) - Added CBaseAnimating::GetPlaybackRate - Added CBaseAnimating::SetPlaybackRate - Added CBaseAnimating::GetCycle - Added CBaseAnimating::SetCycle triggers.h triggers.cpp - Fixed CTriggerCamera::ScriptSetFov setting player FOV while disabled - Added CBaseTrigger::Enable - Added CBaseTrigger::Disable - Added CBaseTrigger::TouchTest - Added CBaseTrigger::IsTouching (ScriptIsTouching) vscript_server.nut vscript_server.cpp - Added CEntities::FindByClassnameWithinBox - Added ::SendToConsoleServer - Added ::CancelEntityIOEvent - Added ::GetEntityIOEventTimeLeft - Moved ScriptDispatchParticleEffect to shared code eventqueue.h cbase.h cbase.cpp - Set entity I/O con output colour - Added (CEventQueue::CancelEventsByInput) - Added (CEventQueue::RemoveEvent) - Added (CEventQueue::GetTimeLeft) baseentity.h baseentity.cpp - Added CBaseEntity::SetTransmitState - Added CBaseEntity::GetTransmitState - Added CBaseEntity::AcceptInput (ScriptAcceptInput) - Added CBaseEntity::FireOutput (ScriptFireOutput) - Added CBaseEntity::GetMaxOutputDelay - Added CBaseEntity::CancelEventsByInput - Added player_use event on InputUse - Fixed InputKill on players ivscript.h vscript_squirrel.cpp - Added IScriptVM::ArrayAppend - Fixed buffer overflow crash - Increased print buffer to 2048 from 256 - Set vscript print output colour vscript_funcs_shared.cpp - Added CNetMsgScriptHelper (CScriptGameEventListener) - Added ::ListenToGameEvent - Added ::StopListeningToGameEvent - Added ::StopListeningToAllGameEvents - Added ::FireGameEvent - Added ::FireGameEventLocal (CScriptSaveRestoreUtil) - Added ::SaveTable - Added ::RestoreTable - Added ::ClearSavedTable - Added callbacks ::OnSave, ::OnRestore (CScriptReadWriteFile) - Added ::StringToFile - Added ::FileToString - Added GlobalSys::GetCommandLine - Added GlobalSys::CommandLineCheck - Added GlobalSys::CommandLineCheckStr - Added GlobalSys::CommandLineCheckFloat - Added GlobalSys::CommandLineCheckInt - Added ::GetCPUUsage - Added ::NXPrint - Added ::Msg (ScriptMsg) - Removed misplaced condition checks - Fixed ScriptEntitiesInBox, *AtPoint, *InSphere logic_eventlistener.cpp - Removed redundant dev msg gamestringpool.cpp - Fixed string pool dump sort
2020-10-27 02:22:18 +03:00
static float GetEntityIOEventTimeLeft( int event )
{
return g_EventQueue.GetTimeLeft(event);
}
#endif // MAPBASE_VSCRIPT
vscript changes: c_baseentity.h c_baseentity.cpp - Renamed GetLeftVector to GetRightVector - Renamed GetTeamNumber to GetTeam baseentity.h baseentity.cpp - Renamed GetLeftVector to GetRightVector - Renamed Get/SetRender functions (GetAlpha -> GetRenderAlpha) - Fixed CBaseEntity::GetScriptId - Added hook CBaseEntity::UpdateOnRemove - Added CBaseEntity::GetOrCreatePrivateScriptScope - Added CBaseEntity::GetDebugName - Added CBaseEntity::GetGravity - Added CBaseEntity::SetGravity - Added CBaseEntity::GetFriction - Added CBaseEntity::SetFriction - Added CBaseEntity::GetMass - Added CBaseEntity::SetMass - Added CBaseEntity::SetName (SetNameAsCStr) - Added CBaseEntity::SetParent (ScriptSetParent) - Added CBaseEntity::SetThink (ScriptSetThink) - Added CBaseEntity::StopThink (ScriptStopThink) - Added CBaseEntity::SetThinkFunction (ScriptSetThinkFunction) - Added CBaseEntity::StopThinkFunction (ScriptStopThinkFunction) - Added CBaseEntity::ApplyAbsVelocityImpulse - Added CBaseEntity::ApplyLocalAngularVelocityImpulse player.h player.cpp - Renamed GetPlayerUserId to GetUserID - Added CBasePlayer::GetFOV - Added CBasePlayer::GetFOVOwner (ScriptGetFOVOwner) - Added CBasePlayer::SetFOV (ScriptSetFOV) vscript_consts_shared.cpp -Added RAD2DEG, DEG2RAD, MAX_COORD_FLOAT, MAX_TRACE_LENGTH vscript_funcs_shared.cpp - Renamed IsClientScript,IsServerScript to IsClient,IsServer - Added IsDedicatedServer - Added NPrint (Con_NPrintf) - Removed DebugDrawBoxDirection (debugoverlay.BoxDirection) - Removed DebugDrawText (debugoverlay.Text) vscript_server.cpp - Added CDebugOverlayScriptHelper (debugoverlay) - Added CEntities::GetLocalPlayer - Added DispatchParticleEffect (ScriptDispatchParticleEffect) - Removed DebugDrawBox (debugoverlay.Box) - Removed DebugDrawLine (debugoverlay.Line) vscript_squirrel.cpp - Changed stub error messages for consistency and clarity - Changed errorfunc output to Warning instead of Msg - Added Msg, Warning - Added clamp, min, max, RemapVal, RemapValClamped - Added sqstdtime.h - Added clock, time, date
2020-08-30 15:58:34 +03:00
bool VScriptServerInit()
{
VMPROF_START
if( scriptmanager != NULL )
{
ScriptLanguage_t scriptLanguage = SL_DEFAULT;
char const *pszScriptLanguage;
#ifdef MAPBASE_VSCRIPT
if (GetWorldEntity()->GetScriptLanguage() != SL_NONE)
{
// Allow world entity to override script language
scriptLanguage = GetWorldEntity()->GetScriptLanguage();
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
2020-07-16 18:43:30 +03:00
// Less than SL_NONE means the script language should literally be none
if (scriptLanguage < SL_NONE)
scriptLanguage = SL_NONE;
}
else
#endif
if ( CommandLine()->CheckParm( "-scriptlang", &pszScriptLanguage ) )
{
if( !Q_stricmp(pszScriptLanguage, "gamemonkey") )
{
scriptLanguage = SL_GAMEMONKEY;
}
else if( !Q_stricmp(pszScriptLanguage, "squirrel") )
{
scriptLanguage = SL_SQUIRREL;
}
else if( !Q_stricmp(pszScriptLanguage, "python") )
{
scriptLanguage = SL_PYTHON;
}
#ifdef MAPBASE_VSCRIPT
else if( !Q_stricmp(pszScriptLanguage, "lua") )
{
scriptLanguage = SL_LUA;
}
#endif
else
{
Mapbase v6.0 - Fixed path_track paths saving as pointers instead of handles - Fixed player animations not falling to base class correctly - Fixed logic_externaldata creating garbage in trailing spaces - Added "SetHandModelSkin" input - Added unique colors for various types of console message, adjustable via convars - Added the ability to use map-specific weapon scripts - Added a way to display (placeholder) text entirely from Faceposer scenes - Added "autobreak" keyvalue to game_text, which automatically breaks long text into different lines - Added the ability to change a game_text's font (very limited) - Added LightToggle input to point_spotlight - Added Enable/DisableSprites on npc_manhack - Added ai_goal_police behavior from metrocops to Combine soldiers and citizens - Added func_precipitation particle rain systems from the Alien Swarm SDK - Added new func_precipitation spawnflags for controlling behavior in particle types - Added "mapbase_version" cvar which shows the version of Mapbase a mod might be running on - Fixed an oversight with NPC crouch activities which was causing npc_metropolice to stop firing in standoffs - Added toggleable patches to npc_combine AI which make soldiers less likely to stand around without shooting or rush to melee when not needed - Added key for custom logo font on env_credits scripts - Added SetSpeed and SetPushDir inputs for trigger_push - Added a bunch of I/O/KV to func_fish_pool to allow for more control over the fish - Added OnLostEnemy/Player support for npc_combine_camera - Added enhanced save/restore for the Response System, toggleable via convar - Added a convar which allows users to disable weapon autoswitching when picking up ammo - Split VScript base script into its own file - Added VScript descriptions for NPC squads and the manager class which handles them - Moved several classes, functions, etc. to the VScript library itself for future usage in other projects, like VBSP - Added VScript to VBSP with basic map file interfacing - Made some VScript documentation more clear due to deprecation of online documentation - Added VScript "hook" registration, creating a standardized system which shows up in script_help documentation - Added VScript-driven custom weapons - Added clientside VScript scopes - Added a bunch of weapon-related VScript functions - Split a bunch of cluttered VScript stuff into different files - Added VScript functions for "following" entities/bonemerging - Added VScript functions for grenades - Added a few more VScript trigger functions - Added OnDeath hook for VScript - Fixed documentation for aliased functions in VScript - Fixed $bumpmask not working on SDK_LightmappedGeneric - Made vertex blend swapping in Hammer use a constant instead of a combo (makes it easier to compile the shader, especially for $bumpmask's sake) - Fixed brush phong, etc. causing SDK_WorldVertexTransition to stop working - Added limited support for $envmapmask in the bumpmapping shader - Fixed more issues with parallax corrected cubemaps and instances - Made instance variable recursion consistent with VMFII
2020-11-26 05:26:55 +03:00
CGWarning( 1, CON_GROUP_VSCRIPT, "-server_script does not recognize a language named '%s'. virtual machine did NOT start.\n", pszScriptLanguage );
scriptLanguage = SL_NONE;
}
}
if( scriptLanguage != SL_NONE )
{
if ( g_pScriptVM == NULL )
g_pScriptVM = scriptmanager->CreateVM( scriptLanguage );
if( g_pScriptVM )
{
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
2020-07-16 18:43:30 +03:00
#ifdef MAPBASE_VSCRIPT
Mapbase v6.0 - Fixed path_track paths saving as pointers instead of handles - Fixed player animations not falling to base class correctly - Fixed logic_externaldata creating garbage in trailing spaces - Added "SetHandModelSkin" input - Added unique colors for various types of console message, adjustable via convars - Added the ability to use map-specific weapon scripts - Added a way to display (placeholder) text entirely from Faceposer scenes - Added "autobreak" keyvalue to game_text, which automatically breaks long text into different lines - Added the ability to change a game_text's font (very limited) - Added LightToggle input to point_spotlight - Added Enable/DisableSprites on npc_manhack - Added ai_goal_police behavior from metrocops to Combine soldiers and citizens - Added func_precipitation particle rain systems from the Alien Swarm SDK - Added new func_precipitation spawnflags for controlling behavior in particle types - Added "mapbase_version" cvar which shows the version of Mapbase a mod might be running on - Fixed an oversight with NPC crouch activities which was causing npc_metropolice to stop firing in standoffs - Added toggleable patches to npc_combine AI which make soldiers less likely to stand around without shooting or rush to melee when not needed - Added key for custom logo font on env_credits scripts - Added SetSpeed and SetPushDir inputs for trigger_push - Added a bunch of I/O/KV to func_fish_pool to allow for more control over the fish - Added OnLostEnemy/Player support for npc_combine_camera - Added enhanced save/restore for the Response System, toggleable via convar - Added a convar which allows users to disable weapon autoswitching when picking up ammo - Split VScript base script into its own file - Added VScript descriptions for NPC squads and the manager class which handles them - Moved several classes, functions, etc. to the VScript library itself for future usage in other projects, like VBSP - Added VScript to VBSP with basic map file interfacing - Made some VScript documentation more clear due to deprecation of online documentation - Added VScript "hook" registration, creating a standardized system which shows up in script_help documentation - Added VScript-driven custom weapons - Added clientside VScript scopes - Added a bunch of weapon-related VScript functions - Split a bunch of cluttered VScript stuff into different files - Added VScript functions for "following" entities/bonemerging - Added VScript functions for grenades - Added a few more VScript trigger functions - Added OnDeath hook for VScript - Fixed documentation for aliased functions in VScript - Fixed $bumpmask not working on SDK_LightmappedGeneric - Made vertex blend swapping in Hammer use a constant instead of a combo (makes it easier to compile the shader, especially for $bumpmask's sake) - Fixed brush phong, etc. causing SDK_WorldVertexTransition to stop working - Added limited support for $envmapmask in the bumpmapping shader - Fixed more issues with parallax corrected cubemaps and instances - Made instance variable recursion consistent with VMFII
2020-11-26 05:26:55 +03:00
CGMsg( 0, CON_GROUP_VSCRIPT, "VSCRIPT SERVER: Started VScript virtual machine using script language '%s'\n", g_pScriptVM->GetLanguageName() );
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
2020-07-16 18:43:30 +03:00
#else
Log( "VSCRIPT: Started VScript virtual machine using script language '%s'\n", g_pScriptVM->GetLanguageName() );
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
2020-07-16 18:43:30 +03:00
#endif
vscript changes: c_baseentity.h c_baseentity.cpp - Renamed GetLeftVector to GetRightVector - Renamed GetTeamNumber to GetTeam baseentity.h baseentity.cpp - Renamed GetLeftVector to GetRightVector - Renamed Get/SetRender functions (GetAlpha -> GetRenderAlpha) - Fixed CBaseEntity::GetScriptId - Added hook CBaseEntity::UpdateOnRemove - Added CBaseEntity::GetOrCreatePrivateScriptScope - Added CBaseEntity::GetDebugName - Added CBaseEntity::GetGravity - Added CBaseEntity::SetGravity - Added CBaseEntity::GetFriction - Added CBaseEntity::SetFriction - Added CBaseEntity::GetMass - Added CBaseEntity::SetMass - Added CBaseEntity::SetName (SetNameAsCStr) - Added CBaseEntity::SetParent (ScriptSetParent) - Added CBaseEntity::SetThink (ScriptSetThink) - Added CBaseEntity::StopThink (ScriptStopThink) - Added CBaseEntity::SetThinkFunction (ScriptSetThinkFunction) - Added CBaseEntity::StopThinkFunction (ScriptStopThinkFunction) - Added CBaseEntity::ApplyAbsVelocityImpulse - Added CBaseEntity::ApplyLocalAngularVelocityImpulse player.h player.cpp - Renamed GetPlayerUserId to GetUserID - Added CBasePlayer::GetFOV - Added CBasePlayer::GetFOVOwner (ScriptGetFOVOwner) - Added CBasePlayer::SetFOV (ScriptSetFOV) vscript_consts_shared.cpp -Added RAD2DEG, DEG2RAD, MAX_COORD_FLOAT, MAX_TRACE_LENGTH vscript_funcs_shared.cpp - Renamed IsClientScript,IsServerScript to IsClient,IsServer - Added IsDedicatedServer - Added NPrint (Con_NPrintf) - Removed DebugDrawBoxDirection (debugoverlay.BoxDirection) - Removed DebugDrawText (debugoverlay.Text) vscript_server.cpp - Added CDebugOverlayScriptHelper (debugoverlay) - Added CEntities::GetLocalPlayer - Added DispatchParticleEffect (ScriptDispatchParticleEffect) - Removed DebugDrawBox (debugoverlay.Box) - Removed DebugDrawLine (debugoverlay.Line) vscript_squirrel.cpp - Changed stub error messages for consistency and clarity - Changed errorfunc output to Warning instead of Msg - Added Msg, Warning - Added clamp, min, max, RemapVal, RemapValClamped - Added sqstdtime.h - Added clock, time, date
2020-08-30 15:58:34 +03:00
vscript additions and fixes: baseanimating.h baseanimating.cpp - Added CBaseAnimating::SequenceDuration (ScriptSequenceDuration) - Added CBaseAnimating::GetPlaybackRate - Added CBaseAnimating::SetPlaybackRate - Added CBaseAnimating::GetCycle - Added CBaseAnimating::SetCycle triggers.h triggers.cpp - Fixed CTriggerCamera::ScriptSetFov setting player FOV while disabled - Added CBaseTrigger::Enable - Added CBaseTrigger::Disable - Added CBaseTrigger::TouchTest - Added CBaseTrigger::IsTouching (ScriptIsTouching) vscript_server.nut vscript_server.cpp - Added CEntities::FindByClassnameWithinBox - Added ::SendToConsoleServer - Added ::CancelEntityIOEvent - Added ::GetEntityIOEventTimeLeft - Moved ScriptDispatchParticleEffect to shared code eventqueue.h cbase.h cbase.cpp - Set entity I/O con output colour - Added (CEventQueue::CancelEventsByInput) - Added (CEventQueue::RemoveEvent) - Added (CEventQueue::GetTimeLeft) baseentity.h baseentity.cpp - Added CBaseEntity::SetTransmitState - Added CBaseEntity::GetTransmitState - Added CBaseEntity::AcceptInput (ScriptAcceptInput) - Added CBaseEntity::FireOutput (ScriptFireOutput) - Added CBaseEntity::GetMaxOutputDelay - Added CBaseEntity::CancelEventsByInput - Added player_use event on InputUse - Fixed InputKill on players ivscript.h vscript_squirrel.cpp - Added IScriptVM::ArrayAppend - Fixed buffer overflow crash - Increased print buffer to 2048 from 256 - Set vscript print output colour vscript_funcs_shared.cpp - Added CNetMsgScriptHelper (CScriptGameEventListener) - Added ::ListenToGameEvent - Added ::StopListeningToGameEvent - Added ::StopListeningToAllGameEvents - Added ::FireGameEvent - Added ::FireGameEventLocal (CScriptSaveRestoreUtil) - Added ::SaveTable - Added ::RestoreTable - Added ::ClearSavedTable - Added callbacks ::OnSave, ::OnRestore (CScriptReadWriteFile) - Added ::StringToFile - Added ::FileToString - Added GlobalSys::GetCommandLine - Added GlobalSys::CommandLineCheck - Added GlobalSys::CommandLineCheckStr - Added GlobalSys::CommandLineCheckFloat - Added GlobalSys::CommandLineCheckInt - Added ::GetCPUUsage - Added ::NXPrint - Added ::Msg (ScriptMsg) - Removed misplaced condition checks - Fixed ScriptEntitiesInBox, *AtPoint, *InSphere logic_eventlistener.cpp - Removed redundant dev msg gamestringpool.cpp - Fixed string pool dump sort
2020-10-27 02:22:18 +03:00
#ifdef MAPBASE_VSCRIPT
// MULTIPLAYER
// ScriptRegisterFunctionNamed( g_pScriptVM, UTIL_PlayerByIndex, "GetPlayerByIndex", "PlayerInstanceFromIndex" );
// ScriptRegisterFunctionNamed( g_pScriptVM, UTIL_PlayerByUserId, "GetPlayerByUserId", "GetPlayerFromUserID" );
// ScriptRegisterFunctionNamed( g_pScriptVM, UTIL_PlayerByName, "GetPlayerByName", "" );
// ScriptRegisterFunctionNamed( g_pScriptVM, ScriptGetPlayerByNetworkID, "GetPlayerByNetworkID", "" );
ScriptRegisterFunctionNamed( g_pScriptVM, UTIL_ShowMessageAll, "ShowMessage", "Print a hud message on all clients" );
#else
ScriptRegisterFunctionNamed( g_pScriptVM, UTIL_ShowMessageAll, "ShowMessage", "Print a hud message on all clients" );
vscript additions and fixes: baseanimating.h baseanimating.cpp - Added CBaseAnimating::SequenceDuration (ScriptSequenceDuration) - Added CBaseAnimating::GetPlaybackRate - Added CBaseAnimating::SetPlaybackRate - Added CBaseAnimating::GetCycle - Added CBaseAnimating::SetCycle triggers.h triggers.cpp - Fixed CTriggerCamera::ScriptSetFov setting player FOV while disabled - Added CBaseTrigger::Enable - Added CBaseTrigger::Disable - Added CBaseTrigger::TouchTest - Added CBaseTrigger::IsTouching (ScriptIsTouching) vscript_server.nut vscript_server.cpp - Added CEntities::FindByClassnameWithinBox - Added ::SendToConsoleServer - Added ::CancelEntityIOEvent - Added ::GetEntityIOEventTimeLeft - Moved ScriptDispatchParticleEffect to shared code eventqueue.h cbase.h cbase.cpp - Set entity I/O con output colour - Added (CEventQueue::CancelEventsByInput) - Added (CEventQueue::RemoveEvent) - Added (CEventQueue::GetTimeLeft) baseentity.h baseentity.cpp - Added CBaseEntity::SetTransmitState - Added CBaseEntity::GetTransmitState - Added CBaseEntity::AcceptInput (ScriptAcceptInput) - Added CBaseEntity::FireOutput (ScriptFireOutput) - Added CBaseEntity::GetMaxOutputDelay - Added CBaseEntity::CancelEventsByInput - Added player_use event on InputUse - Fixed InputKill on players ivscript.h vscript_squirrel.cpp - Added IScriptVM::ArrayAppend - Fixed buffer overflow crash - Increased print buffer to 2048 from 256 - Set vscript print output colour vscript_funcs_shared.cpp - Added CNetMsgScriptHelper (CScriptGameEventListener) - Added ::ListenToGameEvent - Added ::StopListeningToGameEvent - Added ::StopListeningToAllGameEvents - Added ::FireGameEvent - Added ::FireGameEventLocal (CScriptSaveRestoreUtil) - Added ::SaveTable - Added ::RestoreTable - Added ::ClearSavedTable - Added callbacks ::OnSave, ::OnRestore (CScriptReadWriteFile) - Added ::StringToFile - Added ::FileToString - Added GlobalSys::GetCommandLine - Added GlobalSys::CommandLineCheck - Added GlobalSys::CommandLineCheckStr - Added GlobalSys::CommandLineCheckFloat - Added GlobalSys::CommandLineCheckInt - Added ::GetCPUUsage - Added ::NXPrint - Added ::Msg (ScriptMsg) - Removed misplaced condition checks - Fixed ScriptEntitiesInBox, *AtPoint, *InSphere logic_eventlistener.cpp - Removed redundant dev msg gamestringpool.cpp - Fixed string pool dump sort
2020-10-27 02:22:18 +03:00
#endif
ScriptRegisterFunction( g_pScriptVM, SendToConsole, "Send a string to the console as a command" );
ScriptRegisterFunction( g_pScriptVM, GetMapName, "Get the name of the map.");
ScriptRegisterFunctionNamed( g_pScriptVM, ScriptTraceLine, "TraceLine", "given 2 points & ent to ignore, return fraction along line that hits world or models" );
ScriptRegisterFunction( g_pScriptVM, Time, "Get the current server time" );
ScriptRegisterFunction( g_pScriptVM, FrameTime, "Get the time spent on the server in the last frame" );
#ifdef MAPBASE_VSCRIPT
vscript additions and fixes: baseanimating.h baseanimating.cpp - Added CBaseAnimating::SequenceDuration (ScriptSequenceDuration) - Added CBaseAnimating::GetPlaybackRate - Added CBaseAnimating::SetPlaybackRate - Added CBaseAnimating::GetCycle - Added CBaseAnimating::SetCycle triggers.h triggers.cpp - Fixed CTriggerCamera::ScriptSetFov setting player FOV while disabled - Added CBaseTrigger::Enable - Added CBaseTrigger::Disable - Added CBaseTrigger::TouchTest - Added CBaseTrigger::IsTouching (ScriptIsTouching) vscript_server.nut vscript_server.cpp - Added CEntities::FindByClassnameWithinBox - Added ::SendToConsoleServer - Added ::CancelEntityIOEvent - Added ::GetEntityIOEventTimeLeft - Moved ScriptDispatchParticleEffect to shared code eventqueue.h cbase.h cbase.cpp - Set entity I/O con output colour - Added (CEventQueue::CancelEventsByInput) - Added (CEventQueue::RemoveEvent) - Added (CEventQueue::GetTimeLeft) baseentity.h baseentity.cpp - Added CBaseEntity::SetTransmitState - Added CBaseEntity::GetTransmitState - Added CBaseEntity::AcceptInput (ScriptAcceptInput) - Added CBaseEntity::FireOutput (ScriptFireOutput) - Added CBaseEntity::GetMaxOutputDelay - Added CBaseEntity::CancelEventsByInput - Added player_use event on InputUse - Fixed InputKill on players ivscript.h vscript_squirrel.cpp - Added IScriptVM::ArrayAppend - Fixed buffer overflow crash - Increased print buffer to 2048 from 256 - Set vscript print output colour vscript_funcs_shared.cpp - Added CNetMsgScriptHelper (CScriptGameEventListener) - Added ::ListenToGameEvent - Added ::StopListeningToGameEvent - Added ::StopListeningToAllGameEvents - Added ::FireGameEvent - Added ::FireGameEventLocal (CScriptSaveRestoreUtil) - Added ::SaveTable - Added ::RestoreTable - Added ::ClearSavedTable - Added callbacks ::OnSave, ::OnRestore (CScriptReadWriteFile) - Added ::StringToFile - Added ::FileToString - Added GlobalSys::GetCommandLine - Added GlobalSys::CommandLineCheck - Added GlobalSys::CommandLineCheckStr - Added GlobalSys::CommandLineCheckFloat - Added GlobalSys::CommandLineCheckInt - Added ::GetCPUUsage - Added ::NXPrint - Added ::Msg (ScriptMsg) - Removed misplaced condition checks - Fixed ScriptEntitiesInBox, *AtPoint, *InSphere logic_eventlistener.cpp - Removed redundant dev msg gamestringpool.cpp - Fixed string pool dump sort
2020-10-27 02:22:18 +03:00
ScriptRegisterFunction( g_pScriptVM, SendToConsoleServer, "Send a string to the server console as a command" );
ScriptRegisterFunction( g_pScriptVM, MaxPlayers, "Get the maximum number of players allowed on this server" );
Mapbase v6.1 - Added postprocess_controller entity from later versions of Source - Added env_dof_controller entity from later versions of Source - Added SDK_Engine_Post and DepthOfField shaders from the Momentum repo/Alien Swarm SDK - Fixed auto-breaking game_text/choreo text not null terminating - Fixed console groups showing up at the wrong developer levels - Added more mesages to console groups, including a new "NPC AI" console group - Fixed typos and added elaboration in various cvars, console messages, etc. - Fixed npc_metropolice not using frag grenades correctly when allowed to use them - Fixed npc_metropolice not registering stitching squad slots in AI - Fixed SetModel input late precache warning - Fixed env_global_light angles resetting upon loading a save - Fixed an issue with ScriptKeyValuesRead using the wrong name and having a memory leak - Allowed VScript functions which return null strings to actually return null instead of empty strings - Added VScript member variable documentation - Fixed VScript documentation lines sometimes mixing together - Fixed VScript singletons having a ! at the beginning of descriptions - Added Color struct to VScript and allowed color-related inputs to use it - Added more VScript functions for weapons, ammo, ragdolling, and response contexts - Added GameRules singleton for VScript - Exposed AI interaction system to VScript - Recovered some lost documentation from older revisions of the Mapbase wiki - Added a way to get the current game's load type in VScript - Fixed Precache/SpawnEntityFromTable not accounting for a few important field types - Added VScript functions for getting a player's eye vectors - Fixed a crash caused by removing the active weapon of a Combine soldier while it's firing - Changed the way metrocops deploy their manhacks so they could use their manhack death response properly - Fixed "Use Server" keyvalue on game_convar_mod not working - Adjusted CAI_Expresser in VScript
2020-12-17 06:38:23 +03:00
ScriptRegisterFunction( g_pScriptVM, GetLoadType, "Get the way the current game was loaded (corresponds to the MapLoad enum)" );
ScriptRegisterFunction( g_pScriptVM, DoEntFire, SCRIPT_ALIAS( "EntFire", "Generate an entity i/o event" ) );
ScriptRegisterFunction( g_pScriptVM, DoEntFireByInstanceHandle, SCRIPT_ALIAS( "EntFireByHandle", "Generate an entity i/o event. First parameter is an entity instance." ) );
vscript changes: c_baseentity.h c_baseentity.cpp - Renamed GetLeftVector to GetRightVector - Renamed GetTeamNumber to GetTeam baseentity.h baseentity.cpp - Renamed GetLeftVector to GetRightVector - Renamed Get/SetRender functions (GetAlpha -> GetRenderAlpha) - Fixed CBaseEntity::GetScriptId - Added hook CBaseEntity::UpdateOnRemove - Added CBaseEntity::GetOrCreatePrivateScriptScope - Added CBaseEntity::GetDebugName - Added CBaseEntity::GetGravity - Added CBaseEntity::SetGravity - Added CBaseEntity::GetFriction - Added CBaseEntity::SetFriction - Added CBaseEntity::GetMass - Added CBaseEntity::SetMass - Added CBaseEntity::SetName (SetNameAsCStr) - Added CBaseEntity::SetParent (ScriptSetParent) - Added CBaseEntity::SetThink (ScriptSetThink) - Added CBaseEntity::StopThink (ScriptStopThink) - Added CBaseEntity::SetThinkFunction (ScriptSetThinkFunction) - Added CBaseEntity::StopThinkFunction (ScriptStopThinkFunction) - Added CBaseEntity::ApplyAbsVelocityImpulse - Added CBaseEntity::ApplyLocalAngularVelocityImpulse player.h player.cpp - Renamed GetPlayerUserId to GetUserID - Added CBasePlayer::GetFOV - Added CBasePlayer::GetFOVOwner (ScriptGetFOVOwner) - Added CBasePlayer::SetFOV (ScriptSetFOV) vscript_consts_shared.cpp -Added RAD2DEG, DEG2RAD, MAX_COORD_FLOAT, MAX_TRACE_LENGTH vscript_funcs_shared.cpp - Renamed IsClientScript,IsServerScript to IsClient,IsServer - Added IsDedicatedServer - Added NPrint (Con_NPrintf) - Removed DebugDrawBoxDirection (debugoverlay.BoxDirection) - Removed DebugDrawText (debugoverlay.Text) vscript_server.cpp - Added CDebugOverlayScriptHelper (debugoverlay) - Added CEntities::GetLocalPlayer - Added DispatchParticleEffect (ScriptDispatchParticleEffect) - Removed DebugDrawBox (debugoverlay.Box) - Removed DebugDrawLine (debugoverlay.Line) vscript_squirrel.cpp - Changed stub error messages for consistency and clarity - Changed errorfunc output to Warning instead of Msg - Added Msg, Warning - Added clamp, min, max, RemapVal, RemapValClamped - Added sqstdtime.h - Added clock, time, date
2020-08-30 15:58:34 +03:00
// ScriptRegisterFunction( g_pScriptVM, IsValidEntity, "Returns true if the entity is valid." );
vscript additions and fixes: baseanimating.h baseanimating.cpp - Added CBaseAnimating::SequenceDuration (ScriptSequenceDuration) - Added CBaseAnimating::GetPlaybackRate - Added CBaseAnimating::SetPlaybackRate - Added CBaseAnimating::GetCycle - Added CBaseAnimating::SetCycle triggers.h triggers.cpp - Fixed CTriggerCamera::ScriptSetFov setting player FOV while disabled - Added CBaseTrigger::Enable - Added CBaseTrigger::Disable - Added CBaseTrigger::TouchTest - Added CBaseTrigger::IsTouching (ScriptIsTouching) vscript_server.nut vscript_server.cpp - Added CEntities::FindByClassnameWithinBox - Added ::SendToConsoleServer - Added ::CancelEntityIOEvent - Added ::GetEntityIOEventTimeLeft - Moved ScriptDispatchParticleEffect to shared code eventqueue.h cbase.h cbase.cpp - Set entity I/O con output colour - Added (CEventQueue::CancelEventsByInput) - Added (CEventQueue::RemoveEvent) - Added (CEventQueue::GetTimeLeft) baseentity.h baseentity.cpp - Added CBaseEntity::SetTransmitState - Added CBaseEntity::GetTransmitState - Added CBaseEntity::AcceptInput (ScriptAcceptInput) - Added CBaseEntity::FireOutput (ScriptFireOutput) - Added CBaseEntity::GetMaxOutputDelay - Added CBaseEntity::CancelEventsByInput - Added player_use event on InputUse - Fixed InputKill on players ivscript.h vscript_squirrel.cpp - Added IScriptVM::ArrayAppend - Fixed buffer overflow crash - Increased print buffer to 2048 from 256 - Set vscript print output colour vscript_funcs_shared.cpp - Added CNetMsgScriptHelper (CScriptGameEventListener) - Added ::ListenToGameEvent - Added ::StopListeningToGameEvent - Added ::StopListeningToAllGameEvents - Added ::FireGameEvent - Added ::FireGameEventLocal (CScriptSaveRestoreUtil) - Added ::SaveTable - Added ::RestoreTable - Added ::ClearSavedTable - Added callbacks ::OnSave, ::OnRestore (CScriptReadWriteFile) - Added ::StringToFile - Added ::FileToString - Added GlobalSys::GetCommandLine - Added GlobalSys::CommandLineCheck - Added GlobalSys::CommandLineCheckStr - Added GlobalSys::CommandLineCheckFloat - Added GlobalSys::CommandLineCheckInt - Added ::GetCPUUsage - Added ::NXPrint - Added ::Msg (ScriptMsg) - Removed misplaced condition checks - Fixed ScriptEntitiesInBox, *AtPoint, *InSphere logic_eventlistener.cpp - Removed redundant dev msg gamestringpool.cpp - Fixed string pool dump sort
2020-10-27 02:22:18 +03:00
ScriptRegisterFunction( g_pScriptVM, CancelEntityIOEvent, "Remove entity I/O event." );
ScriptRegisterFunction( g_pScriptVM, GetEntityIOEventTimeLeft, "Get time left on entity I/O event." );
#else
ScriptRegisterFunction( g_pScriptVM, DoEntFire, SCRIPT_ALIAS( "EntFire", "Generate and entity i/o event" ) );
ScriptRegisterFunctionNamed( g_pScriptVM, DoEntFireByInstanceHandle, "EntFireByHandle", "Generate and entity i/o event. First parameter is an entity instance." );
#endif
ScriptRegisterFunction( g_pScriptVM, DoUniqueString, SCRIPT_ALIAS( "UniqueString", "Generate a string guaranteed to be unique across the life of the script VM, with an optional root string. Useful for adding data to tables when not sure what keys are already in use in that table." ) );
ScriptRegisterFunctionNamed( g_pScriptVM, ScriptCreateSceneEntity, "CreateSceneEntity", "Create a scene entity to play the specified scene." );
vscript changes: c_baseentity.h c_baseentity.cpp - Renamed GetLeftVector to GetRightVector - Renamed GetTeamNumber to GetTeam baseentity.h baseentity.cpp - Renamed GetLeftVector to GetRightVector - Renamed Get/SetRender functions (GetAlpha -> GetRenderAlpha) - Fixed CBaseEntity::GetScriptId - Added hook CBaseEntity::UpdateOnRemove - Added CBaseEntity::GetOrCreatePrivateScriptScope - Added CBaseEntity::GetDebugName - Added CBaseEntity::GetGravity - Added CBaseEntity::SetGravity - Added CBaseEntity::GetFriction - Added CBaseEntity::SetFriction - Added CBaseEntity::GetMass - Added CBaseEntity::SetMass - Added CBaseEntity::SetName (SetNameAsCStr) - Added CBaseEntity::SetParent (ScriptSetParent) - Added CBaseEntity::SetThink (ScriptSetThink) - Added CBaseEntity::StopThink (ScriptStopThink) - Added CBaseEntity::SetThinkFunction (ScriptSetThinkFunction) - Added CBaseEntity::StopThinkFunction (ScriptStopThinkFunction) - Added CBaseEntity::ApplyAbsVelocityImpulse - Added CBaseEntity::ApplyLocalAngularVelocityImpulse player.h player.cpp - Renamed GetPlayerUserId to GetUserID - Added CBasePlayer::GetFOV - Added CBasePlayer::GetFOVOwner (ScriptGetFOVOwner) - Added CBasePlayer::SetFOV (ScriptSetFOV) vscript_consts_shared.cpp -Added RAD2DEG, DEG2RAD, MAX_COORD_FLOAT, MAX_TRACE_LENGTH vscript_funcs_shared.cpp - Renamed IsClientScript,IsServerScript to IsClient,IsServer - Added IsDedicatedServer - Added NPrint (Con_NPrintf) - Removed DebugDrawBoxDirection (debugoverlay.BoxDirection) - Removed DebugDrawText (debugoverlay.Text) vscript_server.cpp - Added CDebugOverlayScriptHelper (debugoverlay) - Added CEntities::GetLocalPlayer - Added DispatchParticleEffect (ScriptDispatchParticleEffect) - Removed DebugDrawBox (debugoverlay.Box) - Removed DebugDrawLine (debugoverlay.Line) vscript_squirrel.cpp - Changed stub error messages for consistency and clarity - Changed errorfunc output to Warning instead of Msg - Added Msg, Warning - Added clamp, min, max, RemapVal, RemapValClamped - Added sqstdtime.h - Added clock, time, date
2020-08-30 15:58:34 +03:00
#ifndef MAPBASE_VSCRIPT
ScriptRegisterFunctionNamed( g_pScriptVM, NDebugOverlay::Box, "DebugDrawBox", "Draw a debug overlay box" );
ScriptRegisterFunctionNamed( g_pScriptVM, NDebugOverlay::Line, "DebugDrawLine", "Draw a debug overlay box" );
vscript changes: c_baseentity.h c_baseentity.cpp - Renamed GetLeftVector to GetRightVector - Renamed GetTeamNumber to GetTeam baseentity.h baseentity.cpp - Renamed GetLeftVector to GetRightVector - Renamed Get/SetRender functions (GetAlpha -> GetRenderAlpha) - Fixed CBaseEntity::GetScriptId - Added hook CBaseEntity::UpdateOnRemove - Added CBaseEntity::GetOrCreatePrivateScriptScope - Added CBaseEntity::GetDebugName - Added CBaseEntity::GetGravity - Added CBaseEntity::SetGravity - Added CBaseEntity::GetFriction - Added CBaseEntity::SetFriction - Added CBaseEntity::GetMass - Added CBaseEntity::SetMass - Added CBaseEntity::SetName (SetNameAsCStr) - Added CBaseEntity::SetParent (ScriptSetParent) - Added CBaseEntity::SetThink (ScriptSetThink) - Added CBaseEntity::StopThink (ScriptStopThink) - Added CBaseEntity::SetThinkFunction (ScriptSetThinkFunction) - Added CBaseEntity::StopThinkFunction (ScriptStopThinkFunction) - Added CBaseEntity::ApplyAbsVelocityImpulse - Added CBaseEntity::ApplyLocalAngularVelocityImpulse player.h player.cpp - Renamed GetPlayerUserId to GetUserID - Added CBasePlayer::GetFOV - Added CBasePlayer::GetFOVOwner (ScriptGetFOVOwner) - Added CBasePlayer::SetFOV (ScriptSetFOV) vscript_consts_shared.cpp -Added RAD2DEG, DEG2RAD, MAX_COORD_FLOAT, MAX_TRACE_LENGTH vscript_funcs_shared.cpp - Renamed IsClientScript,IsServerScript to IsClient,IsServer - Added IsDedicatedServer - Added NPrint (Con_NPrintf) - Removed DebugDrawBoxDirection (debugoverlay.BoxDirection) - Removed DebugDrawText (debugoverlay.Text) vscript_server.cpp - Added CDebugOverlayScriptHelper (debugoverlay) - Added CEntities::GetLocalPlayer - Added DispatchParticleEffect (ScriptDispatchParticleEffect) - Removed DebugDrawBox (debugoverlay.Box) - Removed DebugDrawLine (debugoverlay.Line) vscript_squirrel.cpp - Changed stub error messages for consistency and clarity - Changed errorfunc output to Warning instead of Msg - Added Msg, Warning - Added clamp, min, max, RemapVal, RemapValClamped - Added sqstdtime.h - Added clock, time, date
2020-08-30 15:58:34 +03:00
#endif
ScriptRegisterFunction( g_pScriptVM, DoIncludeScript, "Execute a script (internal)" );
ScriptRegisterFunction( g_pScriptVM, CreateProp, "Create a physics prop" );
vscript additions and fixes: baseanimating.h baseanimating.cpp - Added CBaseAnimating::SequenceDuration (ScriptSequenceDuration) - Added CBaseAnimating::GetPlaybackRate - Added CBaseAnimating::SetPlaybackRate - Added CBaseAnimating::GetCycle - Added CBaseAnimating::SetCycle triggers.h triggers.cpp - Fixed CTriggerCamera::ScriptSetFov setting player FOV while disabled - Added CBaseTrigger::Enable - Added CBaseTrigger::Disable - Added CBaseTrigger::TouchTest - Added CBaseTrigger::IsTouching (ScriptIsTouching) vscript_server.nut vscript_server.cpp - Added CEntities::FindByClassnameWithinBox - Added ::SendToConsoleServer - Added ::CancelEntityIOEvent - Added ::GetEntityIOEventTimeLeft - Moved ScriptDispatchParticleEffect to shared code eventqueue.h cbase.h cbase.cpp - Set entity I/O con output colour - Added (CEventQueue::CancelEventsByInput) - Added (CEventQueue::RemoveEvent) - Added (CEventQueue::GetTimeLeft) baseentity.h baseentity.cpp - Added CBaseEntity::SetTransmitState - Added CBaseEntity::GetTransmitState - Added CBaseEntity::AcceptInput (ScriptAcceptInput) - Added CBaseEntity::FireOutput (ScriptFireOutput) - Added CBaseEntity::GetMaxOutputDelay - Added CBaseEntity::CancelEventsByInput - Added player_use event on InputUse - Fixed InputKill on players ivscript.h vscript_squirrel.cpp - Added IScriptVM::ArrayAppend - Fixed buffer overflow crash - Increased print buffer to 2048 from 256 - Set vscript print output colour vscript_funcs_shared.cpp - Added CNetMsgScriptHelper (CScriptGameEventListener) - Added ::ListenToGameEvent - Added ::StopListeningToGameEvent - Added ::StopListeningToAllGameEvents - Added ::FireGameEvent - Added ::FireGameEventLocal (CScriptSaveRestoreUtil) - Added ::SaveTable - Added ::RestoreTable - Added ::ClearSavedTable - Added callbacks ::OnSave, ::OnRestore (CScriptReadWriteFile) - Added ::StringToFile - Added ::FileToString - Added GlobalSys::GetCommandLine - Added GlobalSys::CommandLineCheck - Added GlobalSys::CommandLineCheckStr - Added GlobalSys::CommandLineCheckFloat - Added GlobalSys::CommandLineCheckInt - Added ::GetCPUUsage - Added ::NXPrint - Added ::Msg (ScriptMsg) - Removed misplaced condition checks - Fixed ScriptEntitiesInBox, *AtPoint, *InSphere logic_eventlistener.cpp - Removed redundant dev msg gamestringpool.cpp - Fixed string pool dump sort
2020-10-27 02:22:18 +03:00
if ( GameRules() )
{
GameRules()->RegisterScriptFunctions();
}
g_pScriptVM->RegisterInstance( &g_ScriptEntityIterator, "Entities" );
#ifdef MAPBASE_VSCRIPT
2020-07-12 04:46:43 +03:00
g_pScriptVM->RegisterAllClasses();
Mapbase v5.0 - Added keyvalue to hl2_gamerules which allows respawning in singleplayer - Added the game instructor system (including env_instructor_hint) from later Valve games using a VDC tutorial which adjusts the version from the Alien Swarm SDK to FPS rules and a Source 2013 environment; Also added new KV and icons for further control from mappers (tutorial mentioned by Maestra Fenix) - Added L4D/TF2 glows + point_glow entity as an all-purpose SDK-based off-shoot of tf_glow - Fixed weapon pickup sound not playing (reported by Sl0th and later Cvoxulary) - Fixed env_projectedtextures not updating on save/load - Added func_fake_worldportal, a spatial point_camera inspired by linked_portal_door based on SDK code alone (WIP, may be changed a lot in future updates) - Added option for point_camera and func_reflective_glass to use different render targets, therefore allowing multiple cameras and mirrors to be active at the same time - Added additional RT camera textures to choose from with a default of 3, but also controllable through a -numcameratextures command line param - Added adjustable convars for main view NearZ and skybox NearZ (suggested by someone recently, also suggested by Klems over a year ago) - Fixed map-specific localization files, cleaned up map-specific file code - Added a new block to gameinfo.txt which allows mods to automatically append their own command line parameters - Fixed math_lightpattern corruption when setting pattern/style while active - Fixed the "Touch" input crashing when given no entity - Added a way to add EFlags via keyvalue (suggested by Niker107) - Fixed ai_script_conditions not working without a NPC actor (reported by MetroHam) - Fixed point_radiation_source causing huge problems when intensity is 0, even though it was already advised against (reported by beefbacon) - Added "Mapbase" header to Mapbase-specific code files - Fixed an issue with updating sky_camera not obtaining area correctly, causing some entities to not draw in the skybox - Added "CopyFogController" and "CopyFogControllerWithScale" inputs to sky_camera, which copy fog parameters directly from a fog controller - Added "SetScale" input to sky_camera for live scale changing - Added convar to control player crouch speed multiplier (suggested by ArtyIF) - Added a ton of fixes for people running the Debug configuration of the codebase (partial credit to stepa2) - Added support for pre-defined enums and constants in VScript, starting with various values from the SDK code (damage types, trace masks, etc.) - Added limited support for Valve's Quaternion class in VScript - Added new instance helper capabilities, destructible game instances, and other misc. changes to VScript library - Replaced most of the VScript "accessor" classes with direct references to the original classes, as they were getting complicated fast and adding new VScript-only functions to the original classes might not be as bad as previously thought - Added base NPC hooks for AI sensing in VScript (allows control over sight and hearing), also exposed CSound for it - Added various functions and hooks for VPhysics integration in VScript - Added VScript-based custom suit devices - Expanded trace info exposed to VScript to allow plane and surface access (suggested by krassell) - Added ability to insert localization strings through VScript - Added various misc. VScript functions with various purposes, including reading/writing EFlags, movetypes, collision groups, etc. - Fixed VBSP not being able to correctly parse parallax corrected cubemaps in maps with instances
2020-08-15 00:21:25 +03:00
g_pScriptVM->RegisterAllEnums();
2020-07-12 04:46:43 +03:00
IGameSystem::RegisterVScriptAllSystems();
Mapbase v5.0 - Added keyvalue to hl2_gamerules which allows respawning in singleplayer - Added the game instructor system (including env_instructor_hint) from later Valve games using a VDC tutorial which adjusts the version from the Alien Swarm SDK to FPS rules and a Source 2013 environment; Also added new KV and icons for further control from mappers (tutorial mentioned by Maestra Fenix) - Added L4D/TF2 glows + point_glow entity as an all-purpose SDK-based off-shoot of tf_glow - Fixed weapon pickup sound not playing (reported by Sl0th and later Cvoxulary) - Fixed env_projectedtextures not updating on save/load - Added func_fake_worldportal, a spatial point_camera inspired by linked_portal_door based on SDK code alone (WIP, may be changed a lot in future updates) - Added option for point_camera and func_reflective_glass to use different render targets, therefore allowing multiple cameras and mirrors to be active at the same time - Added additional RT camera textures to choose from with a default of 3, but also controllable through a -numcameratextures command line param - Added adjustable convars for main view NearZ and skybox NearZ (suggested by someone recently, also suggested by Klems over a year ago) - Fixed map-specific localization files, cleaned up map-specific file code - Added a new block to gameinfo.txt which allows mods to automatically append their own command line parameters - Fixed math_lightpattern corruption when setting pattern/style while active - Fixed the "Touch" input crashing when given no entity - Added a way to add EFlags via keyvalue (suggested by Niker107) - Fixed ai_script_conditions not working without a NPC actor (reported by MetroHam) - Fixed point_radiation_source causing huge problems when intensity is 0, even though it was already advised against (reported by beefbacon) - Added "Mapbase" header to Mapbase-specific code files - Fixed an issue with updating sky_camera not obtaining area correctly, causing some entities to not draw in the skybox - Added "CopyFogController" and "CopyFogControllerWithScale" inputs to sky_camera, which copy fog parameters directly from a fog controller - Added "SetScale" input to sky_camera for live scale changing - Added convar to control player crouch speed multiplier (suggested by ArtyIF) - Added a ton of fixes for people running the Debug configuration of the codebase (partial credit to stepa2) - Added support for pre-defined enums and constants in VScript, starting with various values from the SDK code (damage types, trace masks, etc.) - Added limited support for Valve's Quaternion class in VScript - Added new instance helper capabilities, destructible game instances, and other misc. changes to VScript library - Replaced most of the VScript "accessor" classes with direct references to the original classes, as they were getting complicated fast and adding new VScript-only functions to the original classes might not be as bad as previously thought - Added base NPC hooks for AI sensing in VScript (allows control over sight and hearing), also exposed CSound for it - Added various functions and hooks for VPhysics integration in VScript - Added VScript-based custom suit devices - Expanded trace info exposed to VScript to allow plane and surface access (suggested by krassell) - Added ability to insert localization strings through VScript - Added various misc. VScript functions with various purposes, including reading/writing EFlags, movetypes, collision groups, etc. - Fixed VBSP not being able to correctly parse parallax corrected cubemaps in maps with instances
2020-08-15 00:21:25 +03:00
RegisterSharedScriptConstants();
RegisterSharedScriptFunctions();
#endif
if (scriptLanguage == SL_SQUIRREL)
{
g_pScriptVM->Run( g_Script_vscript_server );
}
VScriptRunScript( "vscript_server", true );
VScriptRunScript( "mapspawn", false );
Mapbase v5.1 - Fixed a major oversight in Source 2013 which was causing some code to think all logic entities were worldspawn - Added WIP background nodraw for point_cameras set to not draw skybox at all - Fixed map-specific talker not flushing on restore - Added optional HUD hint to code-based game instructor hints - Added workaround for suspicious crashes in HL2 NPC rappelling code (reported by 1upD) - Made antlions summoned by npc_antlionguard report as dead when removed with the "Kill" input - Fixed math_mod not saving mod value (reported by Klems) - Added SDK_WindowImposter, which uses the SteamPipe cubemap bug workaround and includes support for parallax corrected cubemaps - Updated thirdpartylegalnotices.txt to mention the Squirrel API - Fixed incorrect type checking for script instances in VScript - Added a bunch of new misc. VScript constants - Added a few new base VScript functions - Added a separate "Clientside Script Language" keyvalue to worldspawn for VScript, allowing client scripts to use a different language from server scripts - Fixed worldspawn crashing the game when running entity scripts (reported by krassell) - Fixed manifests creating a second worldspawn, allowing them to function properly in HL2 - Added tons of remapping-related fixes for instances and manifests, including node IDs and overlay remapping - Added a keyvalue to func_instance which allows vector axis lines to be remapped properly - Added support for manifest root path instances in VBSP - Added missing PrintBrushContents() contents to VBSP - Added -nohiddenmaps parameter - Made manifest cordon somewhat functional
2020-09-23 08:03:47 +03:00
#ifdef MAPBASE_VSCRIPT
// Since the world entity spawns before VScript is initted, RunVScripts() is called before the VM has started, so no scripts are run.
// This gets around that by calling the same function right after the VM is initted.
GetWorldEntity()->RunVScripts();
#endif
VMPROF_SHOW( pszScriptLanguage, "virtual machine startup" );
return true;
}
else
{
Mapbase v6.0 - Fixed path_track paths saving as pointers instead of handles - Fixed player animations not falling to base class correctly - Fixed logic_externaldata creating garbage in trailing spaces - Added "SetHandModelSkin" input - Added unique colors for various types of console message, adjustable via convars - Added the ability to use map-specific weapon scripts - Added a way to display (placeholder) text entirely from Faceposer scenes - Added "autobreak" keyvalue to game_text, which automatically breaks long text into different lines - Added the ability to change a game_text's font (very limited) - Added LightToggle input to point_spotlight - Added Enable/DisableSprites on npc_manhack - Added ai_goal_police behavior from metrocops to Combine soldiers and citizens - Added func_precipitation particle rain systems from the Alien Swarm SDK - Added new func_precipitation spawnflags for controlling behavior in particle types - Added "mapbase_version" cvar which shows the version of Mapbase a mod might be running on - Fixed an oversight with NPC crouch activities which was causing npc_metropolice to stop firing in standoffs - Added toggleable patches to npc_combine AI which make soldiers less likely to stand around without shooting or rush to melee when not needed - Added key for custom logo font on env_credits scripts - Added SetSpeed and SetPushDir inputs for trigger_push - Added a bunch of I/O/KV to func_fish_pool to allow for more control over the fish - Added OnLostEnemy/Player support for npc_combine_camera - Added enhanced save/restore for the Response System, toggleable via convar - Added a convar which allows users to disable weapon autoswitching when picking up ammo - Split VScript base script into its own file - Added VScript descriptions for NPC squads and the manager class which handles them - Moved several classes, functions, etc. to the VScript library itself for future usage in other projects, like VBSP - Added VScript to VBSP with basic map file interfacing - Made some VScript documentation more clear due to deprecation of online documentation - Added VScript "hook" registration, creating a standardized system which shows up in script_help documentation - Added VScript-driven custom weapons - Added clientside VScript scopes - Added a bunch of weapon-related VScript functions - Split a bunch of cluttered VScript stuff into different files - Added VScript functions for "following" entities/bonemerging - Added VScript functions for grenades - Added a few more VScript trigger functions - Added OnDeath hook for VScript - Fixed documentation for aliased functions in VScript - Fixed $bumpmask not working on SDK_LightmappedGeneric - Made vertex blend swapping in Hammer use a constant instead of a combo (makes it easier to compile the shader, especially for $bumpmask's sake) - Fixed brush phong, etc. causing SDK_WorldVertexTransition to stop working - Added limited support for $envmapmask in the bumpmapping shader - Fixed more issues with parallax corrected cubemaps and instances - Made instance variable recursion consistent with VMFII
2020-11-26 05:26:55 +03:00
CGWarning( 1, CON_GROUP_VSCRIPT, "VM Did not start!\n" );
}
}
#ifdef MAPBASE_VSCRIPT
else
{
CGMsg( 0, CON_GROUP_VSCRIPT, "VSCRIPT SERVER: Not starting because language is set to 'none'\n" );
}
#endif
}
else
{
Mapbase v6.0 - Fixed path_track paths saving as pointers instead of handles - Fixed player animations not falling to base class correctly - Fixed logic_externaldata creating garbage in trailing spaces - Added "SetHandModelSkin" input - Added unique colors for various types of console message, adjustable via convars - Added the ability to use map-specific weapon scripts - Added a way to display (placeholder) text entirely from Faceposer scenes - Added "autobreak" keyvalue to game_text, which automatically breaks long text into different lines - Added the ability to change a game_text's font (very limited) - Added LightToggle input to point_spotlight - Added Enable/DisableSprites on npc_manhack - Added ai_goal_police behavior from metrocops to Combine soldiers and citizens - Added func_precipitation particle rain systems from the Alien Swarm SDK - Added new func_precipitation spawnflags for controlling behavior in particle types - Added "mapbase_version" cvar which shows the version of Mapbase a mod might be running on - Fixed an oversight with NPC crouch activities which was causing npc_metropolice to stop firing in standoffs - Added toggleable patches to npc_combine AI which make soldiers less likely to stand around without shooting or rush to melee when not needed - Added key for custom logo font on env_credits scripts - Added SetSpeed and SetPushDir inputs for trigger_push - Added a bunch of I/O/KV to func_fish_pool to allow for more control over the fish - Added OnLostEnemy/Player support for npc_combine_camera - Added enhanced save/restore for the Response System, toggleable via convar - Added a convar which allows users to disable weapon autoswitching when picking up ammo - Split VScript base script into its own file - Added VScript descriptions for NPC squads and the manager class which handles them - Moved several classes, functions, etc. to the VScript library itself for future usage in other projects, like VBSP - Added VScript to VBSP with basic map file interfacing - Made some VScript documentation more clear due to deprecation of online documentation - Added VScript "hook" registration, creating a standardized system which shows up in script_help documentation - Added VScript-driven custom weapons - Added clientside VScript scopes - Added a bunch of weapon-related VScript functions - Split a bunch of cluttered VScript stuff into different files - Added VScript functions for "following" entities/bonemerging - Added VScript functions for grenades - Added a few more VScript trigger functions - Added OnDeath hook for VScript - Fixed documentation for aliased functions in VScript - Fixed $bumpmask not working on SDK_LightmappedGeneric - Made vertex blend swapping in Hammer use a constant instead of a combo (makes it easier to compile the shader, especially for $bumpmask's sake) - Fixed brush phong, etc. causing SDK_WorldVertexTransition to stop working - Added limited support for $envmapmask in the bumpmapping shader - Fixed more issues with parallax corrected cubemaps and instances - Made instance variable recursion consistent with VMFII
2020-11-26 05:26:55 +03:00
CGMsg( 0, CON_GROUP_VSCRIPT, "\nVSCRIPT: Scripting is disabled.\n" );
}
g_pScriptVM = NULL;
return false;
}
void VScriptServerTerm()
{
if( g_pScriptVM != NULL )
{
if( g_pScriptVM )
{
scriptmanager->DestroyVM( g_pScriptVM );
g_pScriptVM = NULL;
}
}
}
bool VScriptServerReplaceClosures( const char *pszScriptName, HSCRIPT hScope, bool bWarnMissing )
{
if ( !g_pScriptVM )
{
return false;
}
HSCRIPT hReplaceClosuresFunc = g_pScriptVM->LookupFunction( "__ReplaceClosures" );
if ( !hReplaceClosuresFunc )
{
return false;
}
HSCRIPT hNewScript = VScriptCompileScript( pszScriptName, bWarnMissing );
if ( !hNewScript )
{
return false;
}
g_pScriptVM->Call( hReplaceClosuresFunc, NULL, true, NULL, hNewScript, hScope );
return true;
}
CON_COMMAND( script_reload_code, "Execute a vscript file, replacing existing functions with the functions in the run script" )
{
if ( !*args[1] )
{
Mapbase v6.0 - Fixed path_track paths saving as pointers instead of handles - Fixed player animations not falling to base class correctly - Fixed logic_externaldata creating garbage in trailing spaces - Added "SetHandModelSkin" input - Added unique colors for various types of console message, adjustable via convars - Added the ability to use map-specific weapon scripts - Added a way to display (placeholder) text entirely from Faceposer scenes - Added "autobreak" keyvalue to game_text, which automatically breaks long text into different lines - Added the ability to change a game_text's font (very limited) - Added LightToggle input to point_spotlight - Added Enable/DisableSprites on npc_manhack - Added ai_goal_police behavior from metrocops to Combine soldiers and citizens - Added func_precipitation particle rain systems from the Alien Swarm SDK - Added new func_precipitation spawnflags for controlling behavior in particle types - Added "mapbase_version" cvar which shows the version of Mapbase a mod might be running on - Fixed an oversight with NPC crouch activities which was causing npc_metropolice to stop firing in standoffs - Added toggleable patches to npc_combine AI which make soldiers less likely to stand around without shooting or rush to melee when not needed - Added key for custom logo font on env_credits scripts - Added SetSpeed and SetPushDir inputs for trigger_push - Added a bunch of I/O/KV to func_fish_pool to allow for more control over the fish - Added OnLostEnemy/Player support for npc_combine_camera - Added enhanced save/restore for the Response System, toggleable via convar - Added a convar which allows users to disable weapon autoswitching when picking up ammo - Split VScript base script into its own file - Added VScript descriptions for NPC squads and the manager class which handles them - Moved several classes, functions, etc. to the VScript library itself for future usage in other projects, like VBSP - Added VScript to VBSP with basic map file interfacing - Made some VScript documentation more clear due to deprecation of online documentation - Added VScript "hook" registration, creating a standardized system which shows up in script_help documentation - Added VScript-driven custom weapons - Added clientside VScript scopes - Added a bunch of weapon-related VScript functions - Split a bunch of cluttered VScript stuff into different files - Added VScript functions for "following" entities/bonemerging - Added VScript functions for grenades - Added a few more VScript trigger functions - Added OnDeath hook for VScript - Fixed documentation for aliased functions in VScript - Fixed $bumpmask not working on SDK_LightmappedGeneric - Made vertex blend swapping in Hammer use a constant instead of a combo (makes it easier to compile the shader, especially for $bumpmask's sake) - Fixed brush phong, etc. causing SDK_WorldVertexTransition to stop working - Added limited support for $envmapmask in the bumpmapping shader - Fixed more issues with parallax corrected cubemaps and instances - Made instance variable recursion consistent with VMFII
2020-11-26 05:26:55 +03:00
CGWarning( 0, CON_GROUP_VSCRIPT, "No script specified\n" );
return;
}
if ( !g_pScriptVM )
{
Mapbase v6.0 - Fixed path_track paths saving as pointers instead of handles - Fixed player animations not falling to base class correctly - Fixed logic_externaldata creating garbage in trailing spaces - Added "SetHandModelSkin" input - Added unique colors for various types of console message, adjustable via convars - Added the ability to use map-specific weapon scripts - Added a way to display (placeholder) text entirely from Faceposer scenes - Added "autobreak" keyvalue to game_text, which automatically breaks long text into different lines - Added the ability to change a game_text's font (very limited) - Added LightToggle input to point_spotlight - Added Enable/DisableSprites on npc_manhack - Added ai_goal_police behavior from metrocops to Combine soldiers and citizens - Added func_precipitation particle rain systems from the Alien Swarm SDK - Added new func_precipitation spawnflags for controlling behavior in particle types - Added "mapbase_version" cvar which shows the version of Mapbase a mod might be running on - Fixed an oversight with NPC crouch activities which was causing npc_metropolice to stop firing in standoffs - Added toggleable patches to npc_combine AI which make soldiers less likely to stand around without shooting or rush to melee when not needed - Added key for custom logo font on env_credits scripts - Added SetSpeed and SetPushDir inputs for trigger_push - Added a bunch of I/O/KV to func_fish_pool to allow for more control over the fish - Added OnLostEnemy/Player support for npc_combine_camera - Added enhanced save/restore for the Response System, toggleable via convar - Added a convar which allows users to disable weapon autoswitching when picking up ammo - Split VScript base script into its own file - Added VScript descriptions for NPC squads and the manager class which handles them - Moved several classes, functions, etc. to the VScript library itself for future usage in other projects, like VBSP - Added VScript to VBSP with basic map file interfacing - Made some VScript documentation more clear due to deprecation of online documentation - Added VScript "hook" registration, creating a standardized system which shows up in script_help documentation - Added VScript-driven custom weapons - Added clientside VScript scopes - Added a bunch of weapon-related VScript functions - Split a bunch of cluttered VScript stuff into different files - Added VScript functions for "following" entities/bonemerging - Added VScript functions for grenades - Added a few more VScript trigger functions - Added OnDeath hook for VScript - Fixed documentation for aliased functions in VScript - Fixed $bumpmask not working on SDK_LightmappedGeneric - Made vertex blend swapping in Hammer use a constant instead of a combo (makes it easier to compile the shader, especially for $bumpmask's sake) - Fixed brush phong, etc. causing SDK_WorldVertexTransition to stop working - Added limited support for $envmapmask in the bumpmapping shader - Fixed more issues with parallax corrected cubemaps and instances - Made instance variable recursion consistent with VMFII
2020-11-26 05:26:55 +03:00
CGWarning( 0, CON_GROUP_VSCRIPT, "Scripting disabled or no server running\n" );
return;
}
VScriptServerReplaceClosures( args[1], NULL, true );
}
CON_COMMAND( script_reload_entity_code, "Execute all of this entity's VScripts, replacing existing functions with the functions in the run scripts" )
{
extern CBaseEntity *GetNextCommandEntity( CBasePlayer *pPlayer, const char *name, CBaseEntity *ent );
const char *pszTarget = "";
if ( *args[1] )
{
pszTarget = args[1];
}
if ( !g_pScriptVM )
{
Mapbase v6.0 - Fixed path_track paths saving as pointers instead of handles - Fixed player animations not falling to base class correctly - Fixed logic_externaldata creating garbage in trailing spaces - Added "SetHandModelSkin" input - Added unique colors for various types of console message, adjustable via convars - Added the ability to use map-specific weapon scripts - Added a way to display (placeholder) text entirely from Faceposer scenes - Added "autobreak" keyvalue to game_text, which automatically breaks long text into different lines - Added the ability to change a game_text's font (very limited) - Added LightToggle input to point_spotlight - Added Enable/DisableSprites on npc_manhack - Added ai_goal_police behavior from metrocops to Combine soldiers and citizens - Added func_precipitation particle rain systems from the Alien Swarm SDK - Added new func_precipitation spawnflags for controlling behavior in particle types - Added "mapbase_version" cvar which shows the version of Mapbase a mod might be running on - Fixed an oversight with NPC crouch activities which was causing npc_metropolice to stop firing in standoffs - Added toggleable patches to npc_combine AI which make soldiers less likely to stand around without shooting or rush to melee when not needed - Added key for custom logo font on env_credits scripts - Added SetSpeed and SetPushDir inputs for trigger_push - Added a bunch of I/O/KV to func_fish_pool to allow for more control over the fish - Added OnLostEnemy/Player support for npc_combine_camera - Added enhanced save/restore for the Response System, toggleable via convar - Added a convar which allows users to disable weapon autoswitching when picking up ammo - Split VScript base script into its own file - Added VScript descriptions for NPC squads and the manager class which handles them - Moved several classes, functions, etc. to the VScript library itself for future usage in other projects, like VBSP - Added VScript to VBSP with basic map file interfacing - Made some VScript documentation more clear due to deprecation of online documentation - Added VScript "hook" registration, creating a standardized system which shows up in script_help documentation - Added VScript-driven custom weapons - Added clientside VScript scopes - Added a bunch of weapon-related VScript functions - Split a bunch of cluttered VScript stuff into different files - Added VScript functions for "following" entities/bonemerging - Added VScript functions for grenades - Added a few more VScript trigger functions - Added OnDeath hook for VScript - Fixed documentation for aliased functions in VScript - Fixed $bumpmask not working on SDK_LightmappedGeneric - Made vertex blend swapping in Hammer use a constant instead of a combo (makes it easier to compile the shader, especially for $bumpmask's sake) - Fixed brush phong, etc. causing SDK_WorldVertexTransition to stop working - Added limited support for $envmapmask in the bumpmapping shader - Fixed more issues with parallax corrected cubemaps and instances - Made instance variable recursion consistent with VMFII
2020-11-26 05:26:55 +03:00
CGWarning( 0, CON_GROUP_VSCRIPT, "Scripting disabled or no server running\n" );
return;
}
CBasePlayer *pPlayer = UTIL_GetCommandClient();
if ( !pPlayer )
return;
CBaseEntity *pEntity = NULL;
while ( (pEntity = GetNextCommandEntity( pPlayer, pszTarget, pEntity )) != NULL )
{
if ( pEntity->m_ScriptScope.IsInitialized() && pEntity->m_iszVScripts != NULL_STRING )
{
char szScriptsList[255];
Q_strcpy( szScriptsList, STRING(pEntity->m_iszVScripts) );
CUtlStringList szScripts;
V_SplitString( szScriptsList, " ", szScripts);
for( int i = 0 ; i < szScripts.Count() ; i++ )
{
VScriptServerReplaceClosures( szScripts[i], pEntity->m_ScriptScope, true );
}
}
}
}
CON_COMMAND( script_reload_think, "Execute an activation script, replacing existing functions with the functions in the run script" )
{
extern CBaseEntity *GetNextCommandEntity( CBasePlayer *pPlayer, const char *name, CBaseEntity *ent );
const char *pszTarget = "";
if ( *args[1] )
{
pszTarget = args[1];
}
if ( !g_pScriptVM )
{
Mapbase v6.0 - Fixed path_track paths saving as pointers instead of handles - Fixed player animations not falling to base class correctly - Fixed logic_externaldata creating garbage in trailing spaces - Added "SetHandModelSkin" input - Added unique colors for various types of console message, adjustable via convars - Added the ability to use map-specific weapon scripts - Added a way to display (placeholder) text entirely from Faceposer scenes - Added "autobreak" keyvalue to game_text, which automatically breaks long text into different lines - Added the ability to change a game_text's font (very limited) - Added LightToggle input to point_spotlight - Added Enable/DisableSprites on npc_manhack - Added ai_goal_police behavior from metrocops to Combine soldiers and citizens - Added func_precipitation particle rain systems from the Alien Swarm SDK - Added new func_precipitation spawnflags for controlling behavior in particle types - Added "mapbase_version" cvar which shows the version of Mapbase a mod might be running on - Fixed an oversight with NPC crouch activities which was causing npc_metropolice to stop firing in standoffs - Added toggleable patches to npc_combine AI which make soldiers less likely to stand around without shooting or rush to melee when not needed - Added key for custom logo font on env_credits scripts - Added SetSpeed and SetPushDir inputs for trigger_push - Added a bunch of I/O/KV to func_fish_pool to allow for more control over the fish - Added OnLostEnemy/Player support for npc_combine_camera - Added enhanced save/restore for the Response System, toggleable via convar - Added a convar which allows users to disable weapon autoswitching when picking up ammo - Split VScript base script into its own file - Added VScript descriptions for NPC squads and the manager class which handles them - Moved several classes, functions, etc. to the VScript library itself for future usage in other projects, like VBSP - Added VScript to VBSP with basic map file interfacing - Made some VScript documentation more clear due to deprecation of online documentation - Added VScript "hook" registration, creating a standardized system which shows up in script_help documentation - Added VScript-driven custom weapons - Added clientside VScript scopes - Added a bunch of weapon-related VScript functions - Split a bunch of cluttered VScript stuff into different files - Added VScript functions for "following" entities/bonemerging - Added VScript functions for grenades - Added a few more VScript trigger functions - Added OnDeath hook for VScript - Fixed documentation for aliased functions in VScript - Fixed $bumpmask not working on SDK_LightmappedGeneric - Made vertex blend swapping in Hammer use a constant instead of a combo (makes it easier to compile the shader, especially for $bumpmask's sake) - Fixed brush phong, etc. causing SDK_WorldVertexTransition to stop working - Added limited support for $envmapmask in the bumpmapping shader - Fixed more issues with parallax corrected cubemaps and instances - Made instance variable recursion consistent with VMFII
2020-11-26 05:26:55 +03:00
CGWarning( 0, CON_GROUP_VSCRIPT, "Scripting disabled or no server running\n" );
return;
}
CBasePlayer *pPlayer = UTIL_GetCommandClient();
if ( !pPlayer )
return;
CBaseEntity *pEntity = NULL;
while ( (pEntity = GetNextCommandEntity( pPlayer, pszTarget, pEntity )) != NULL )
{
if ( pEntity->m_ScriptScope.IsInitialized() && pEntity->m_iszScriptThinkFunction != NULL_STRING )
{
VScriptServerReplaceClosures( STRING(pEntity->m_iszScriptThinkFunction), pEntity->m_ScriptScope, true );
}
}
}
class CVScriptGameSystem : public CAutoGameSystemPerFrame
{
public:
// Inherited from IAutoServerSystem
virtual void LevelInitPreEntity( void )
{
m_bAllowEntityCreationInScripts = true;
VScriptServerInit();
}
virtual void LevelInitPostEntity( void )
{
m_bAllowEntityCreationInScripts = false;
}
virtual void LevelShutdownPostEntity( void )
{
#ifdef MAPBASE_VSCRIPT
g_ScriptNetMsg->LevelShutdownPreVM();
#endif
VScriptServerTerm();
}
virtual void FrameUpdatePostEntityThink()
{
if ( g_pScriptVM )
g_pScriptVM->Frame( gpGlobals->frametime );
}
bool m_bAllowEntityCreationInScripts;
};
CVScriptGameSystem g_VScriptGameSystem;
#ifdef MAPBASE_VSCRIPT
ConVar script_allow_entity_creation_midgame( "script_allow_entity_creation_midgame", "1", FCVAR_NOT_CONNECTED, "Allows VScript files to create entities mid-game, as opposed to only creating entities on startup." );
#endif
bool IsEntityCreationAllowedInScripts( void )
{
#ifdef MAPBASE_VSCRIPT
if (script_allow_entity_creation_midgame.GetBool())
return true;
#endif
return g_VScriptGameSystem.m_bAllowEntityCreationInScripts;
}