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
This commit is contained in:
samisalreadytaken
2020-10-27 02:22:18 +03:00
parent add157197f
commit 599a93e7bc
17 changed files with 1456 additions and 109 deletions

View File

@@ -7,16 +7,19 @@ static char g_Script_vscript_server[] = R"vscript(
function UniqueString( string = "" )
{
return DoUniqueString( string.tostring() );
return ::DoUniqueString( string.tostring() );
}
local DoEntFire = ::DoEntFire
local DoEntFireByInstanceHandle = ::DoEntFireByInstanceHandle
function EntFire( target, action, value = null, delay = 0.0, activator = null, caller = null )
{
if ( !value )
{
value = "";
}
if ( "self" in this )
{
if ( !caller )
@@ -29,8 +32,8 @@ function EntFire( target, action, value = null, delay = 0.0, activator = null, c
activator = self;
}
}
DoEntFire( target.tostring(), action.tostring(), value.tostring(), delay, activator, caller );
return DoEntFire( target.tostring(), action.tostring(), value.tostring(), delay, activator, caller );
}
function EntFireByHandle( target, action, value = null, delay = 0.0, activator = null, caller = null )
@@ -39,7 +42,7 @@ function EntFireByHandle( target, action, value = null, delay = 0.0, activator =
{
value = "";
}
if ( "self" in this )
{
if ( !caller )
@@ -52,8 +55,8 @@ function EntFireByHandle( target, action, value = null, delay = 0.0, activator =
activator = self;
}
}
DoEntFireByInstanceHandle( target, action.tostring(), value.tostring(), delay, activator, caller );
return DoEntFireByInstanceHandle( target, action.tostring(), value.tostring(), delay, activator, caller );
}
function __ReplaceClosures( script, scope )
@@ -62,11 +65,11 @@ function __ReplaceClosures( script, scope )
{
scope = getroottable();
}
local tempParent = { getroottable = function() { return null; } };
local temp = { runscript = script };
temp.set_delegate(tempParent);
temp.runscript()
foreach( key,val in temp )
{
@@ -78,11 +81,11 @@ function __ReplaceClosures( script, scope )
}
}
__OutputsPattern <- regexp("^On.*Output$");
local __OutputsPattern = regexp("^On.*Output$");
function ConnectOutputs( table )
{
const nCharsToStrip = 6;
local nCharsToStrip = 6;
foreach( key, val in table )
{
if ( typeof( val ) == "function" && __OutputsPattern.match( key ) )
@@ -95,7 +98,7 @@ function ConnectOutputs( table )
function IncludeScript( name, scope = null )
{
if ( scope == null )
if ( !scope )
{
scope = this;
}