Mapbase v4.1

- Exposed CAmmoDef to VScript and changed ammo type functions accordingly
- Added TakeHealth and IsAlive to CBaseEntity
- Added $treeSway
- Added several inputs to control env_wind keyvalues + a new $treeSway scale keyvalue
- Added "Expanded name fixup" keyvalue to point_template which allows name fixup to fix up output parameters
- Fixed the rope on rappelling NPCs causing graphical issues
- Fixed prop_vehicle_prisoner_pod missing "EnterVehicle", "EnterVehicleImmediate", and "ExitVehicle" inputs
- Fixed hostile citizens not damaging player
- Fixed an uncommon npc_metropolice crash from when it's not in a squad
- Made SetTarget input update target handling on NPCs
- Changed ammo type functions to be more organized, added AmmoDef singleton
- Added more precache functions
- Added various misc. entity functions, like GetAllWeapons or AddOutput
- Added more utility functions
This commit is contained in:
Blixibon
2020-06-21 15:10:56 +00:00
parent 5b2547a6ff
commit 418a9dcccc
39 changed files with 923 additions and 67 deletions

View File

@@ -12,6 +12,7 @@
#include "cbase.h"
#include "matchers.h"
#include "takedamageinfo.h"
#include "ammodef.h"
#ifndef CLIENT_DLL
#include "globalstate.h"
@@ -752,6 +753,19 @@ FireBulletsInfo_t *GetFireBulletsInfoFromInfo( HSCRIPT hBulletsInfo )
//=============================================================================
//=============================================================================
static int ScriptPrecacheModel( const char *modelname )
{
return CBaseEntity::PrecacheModel( modelname );
}
static void ScriptPrecacheOther( const char *classname )
{
UTIL_PrecacheOther( classname );
}
//=============================================================================
//=============================================================================
static void ScriptEntitiesInBox( HSCRIPT hTable, int listMax, const Vector &hullMin, const Vector &hullMax, int iMask )
{
CBaseEntity *list[1024];
@@ -785,6 +799,14 @@ static void ScriptEntitiesInSphere( HSCRIPT hTable, int listMax, const Vector &c
}
}
//-----------------------------------------------------------------------------
static void ScriptDecalTrace( HSCRIPT hTrace, const char *decalName )
{
CTraceInfoAccessor *traceInfo = HScriptToClass<CTraceInfoAccessor>(hTrace);
UTIL_DecalTrace( &traceInfo->GetTrace(), decalName );
}
//=============================================================================
//=============================================================================
@@ -813,6 +835,8 @@ void RegisterSharedScriptFunctions()
ScriptRegisterFunction( g_pScriptVM, SpawnEntityFromTable, "Native function for entity spawning." );
#endif
g_pScriptVM->RegisterInstance( GetAmmoDef(), "AmmoDef" );
g_pScriptVM->RegisterInstance( &g_ScriptConvarLookup, "Convars" );
g_pScriptVM->RegisterInstance( &g_ScriptNetPropManager, "NetProps" );
@@ -839,10 +863,23 @@ void RegisterSharedScriptFunctions()
ScriptRegisterFunctionNamed( g_pScriptVM, ScriptTraceLineComplex, "TraceLineComplex", "Complex version of TraceLine which takes 2 points, an ent to ignore, a trace mask, and a collision group. Returns a handle which can access all trace info." );
ScriptRegisterFunctionNamed( g_pScriptVM, ScriptTraceHullComplex, "TraceHullComplex", "Takes 2 points, min/max hull bounds, an ent to ignore, a trace mask, and a collision group to trace to a point using a hull. Returns a handle which can access all trace info." );
//
// Precaching
//
ScriptRegisterFunctionNamed( g_pScriptVM, ScriptPrecacheModel, "PrecacheModel", "Precaches a model for later usage." );
ScriptRegisterFunction( g_pScriptVM, PrecacheMaterial, "Precaches a material for later usage." );
ScriptRegisterFunction( g_pScriptVM, PrecacheParticleSystem, "Precaches a particle system for later usage." );
ScriptRegisterFunctionNamed( g_pScriptVM, ScriptPrecacheOther, "PrecacheOther", "Precaches an entity class for later usage." );
//
// Misc. Utility
//
ScriptRegisterFunctionNamed( g_pScriptVM, ScriptEntitiesInBox, "EntitiesInBox", "Gets all entities which are within a worldspace box." );
ScriptRegisterFunctionNamed( g_pScriptVM, ScriptEntitiesAtPoint, "EntitiesAtPoint", "Gets all entities which are intersecting a point in space." );
ScriptRegisterFunctionNamed( g_pScriptVM, ScriptEntitiesInSphere, "EntitiesInSphere", "Gets all entities which are within a sphere." );
ScriptRegisterFunctionNamed( g_pScriptVM, ScriptDecalTrace, "DecalTrace", "Creates a dynamic decal based on the given trace info. The trace information can be generated by TraceLineComplex() and the decal name must be from decals_subrect.txt." );
ScriptRegisterFunctionNamed( g_pScriptVM, ScriptMatcherMatch, "Matcher_Match", "Compares a string to a query using Mapbase's matcher system, supporting wildcards, RS matchers, etc." );
ScriptRegisterFunction( g_pScriptVM, Matcher_NamesMatch, "Compares a string to a query using Mapbase's matcher system using wildcards only." );
ScriptRegisterFunction( g_pScriptVM, AppearsToBeANumber, "Checks if the given string appears to be a number." );