diff --git a/VScript-in-Mapbase.md b/VScript-in-Mapbase.md index 24b55d1..f4bceb4 100644 --- a/VScript-in-Mapbase.md +++ b/VScript-in-Mapbase.md @@ -26,32 +26,33 @@ For more information on VScript itself, [click here](https://developer.valvesoft * [Tutorials](VScript-in-Mapbase#Tutorials) * [Documentation](VScript-in-Mapbase#Documentation) * [Global Functions](VScript-in-Mapbase#Global-Functions) - * [New VScript Classes](VScript-in-Mapbase#New-VScript-Classes) - * [CBaseCombatCharacter](VScript-in-Mapbase#CBaseCombatCharacter) + * [Entity Classes](VScript-in-Mapbase#Entity-Classes) + * [CBaseEntity](VScript-in-Mapbase#CBaseEntity) + * [Hooks](VScript-in-Mapbase#CBaseEntity-Hooks) * [CBaseCombatWeapon](VScript-in-Mapbase#CBaseCombatWeapon) + * [CBaseCombatCharacter](VScript-in-Mapbase#CBaseCombatCharacter) + * [CBasePlayer](VScript-in-Mapbase#CBasePlayer) * [CAI_BaseNPC](VScript-in-Mapbase#CAI_BaseNPC) * [Hooks](VScript-in-Mapbase#CAI_BaseNPC-Hooks) * [CAI_BaseActor](VScript-in-Mapbase#CAI_BaseActor) - * [CAI_Network](VScript-in-Mapbase#CAI_Network) - * [CAI_Hint](VScript-in-Mapbase#CAI_Hint) * [CAI_Expresser](VScript-in-Mapbase#CAI_Expresser) - * [AI_EnemyInfo_t](VScript-in-Mapbase#AI_EnemyInfo_t) * [CAI_GoalEntity](VScript-in-Mapbase#CAI_GoalEntity) * [CAI_ActBusyGoal](VScript-in-Mapbase#CAI_ActBusyGoal) * [CPropVehicle](VScript-in-Mapbase#CPropVehicle) * [CPropVehicleDriveable](VScript-in-Mapbase#CPropVehicleDriveable) - * [CFourWheelVehiclePhysics](VScript-in-Mapbase#CFourWheelVehiclePhysics) * [CBaseFilter](VScript-in-Mapbase#CBaseFilter) + * [CLogicExternalData](VScript-in-Mapbase#CLogicExternalData) + * [Singletons *(Game Systems)*](VScript-in-Mapbase#Singletons) + * [CAI_Network](VScript-in-Mapbase#CAI_Network) * [CGlobalState](VScript-in-Mapbase#CGlobalState) * [CMapbaseSystem](VScript-in-Mapbase#CMapbaseSystem) + * [Data Containers](VScript-in-Mapbase#Data-Containers) + * [CScriptKeyValues](VScript-in-Mapbase#CScriptKeyValues) * [CTakeDamageInfo](VScript-in-Mapbase#CTakeDamageInfo) * [CGameTrace](VScript-in-Mapbase#CGameTrace) - * [CLogicExternalData](VScript-in-Mapbase#CLogicExternalData) - * [Modified VScript Classes](VScript-in-Mapbase#Modified-VScript-Classes) - * [CBaseEntity](VScript-in-Mapbase#CBaseEntity) - * [Hooks](VScript-in-Mapbase#CBaseEntity-Hooks) - * [CBasePlayer](VScript-in-Mapbase#CBasePlayer) - * [CScriptKeyValues](VScript-in-Mapbase#CScriptKeyValues) + * [CAI_Hint](VScript-in-Mapbase#CAI_Hint) + * [AI_EnemyInfo_t](VScript-in-Mapbase#AI_EnemyInfo_t) + * [CFourWheelVehiclePhysics](VScript-in-Mapbase#CFourWheelVehiclePhysics) *** @@ -88,7 +89,9 @@ A lot of the documentation for VScript on the VDC applies to Mapbase, but Mapbas In addition to the original VScript inputs, Mapbase introduces a new `RunScriptCodeQuotable` input. This operates the same way as `RunScriptCode`, but double apostrophes ('') are converted to quotation marks ("), allowing code with strings to be run from Hammer and in-game `ent_fire`. -Other changes are documented below. +This article will only list functions and classes introduced as a part of Mapbase's changes. Mapbase's VScript is based off of the Alien Swarm SDK, so it already contains most of the functions available in L4D2 and Portal 2. + +Some of Mapbase's script functions coincide with Source 2's script functions. For example, `CTakeDamageInfo` is available in Mapbase's VScript, but it's also available in Half-Life: Alyx's VScript in almost the exact same way. This is usually a matter of either inspiration or evolutionary convergence, but none of Mapbase's counterparts are actually from Source 2's code and they will still be listed here. ## Global Functions These are functions that can be accessed globally and without a class. @@ -104,39 +107,41 @@ These are functions that can be accessed globally and without a class. | *void* DestroyDamageInfo(handle *info*)| Destroys damage info. | -## New VScript Classes -These are classes Mapbase exposes to VScript. These are listed relative to L4D2 and Portal 2's script functions; some of Mapbase's script functions coincide with Source 2 script functions (e.g. `CTakeDamageInfo` is also exposed to Half-Life: Alyx's VScript in the same way), but they will still be listed here (keep in mind they aren't actually from Source 2's code). +## Entity Classes +These are entity-based classes Mapbase exposes to VScript. These are listed relative to L4D2 and Portal 2's script functions; some of Mapbase's script functions coincide with Source 2 script functions (e.g. `CTakeDamageInfo` is also exposed to Half-Life: Alyx's VScript in the same way), but they will still be listed here (keep in mind they aren't actually from Source 2's code). *** -### CBaseCombatCharacter -The base class shared by players and NPCs. +### CBaseEntity +Root class of all server-side entities. | Signature | Description | |:------------- | :-----| -| *handle* GetActiveWeapon()| Get the character's active weapon entity. | -| *handle* GetWeapon(int *index*)| Get a specific weapon in the character's inventory. | -| *handle* FindWeapon(string *classname*)| Find a specific weapon in the character's inventory by its classname. | -| *Vector* ShootPosition()| Get the character's shoot position. | -| *void* DropAllWeapons(bool *disallowWeaponPickup*)| Make the character drop all of its weapons. | -| *void* EquipWeapon(handle *weapon*)| Make the character equip the specified weapon entity. If they don't already own the weapon, they will acquire it instantly. | -| *int* GetAmmoCount(string *type*)| Get the ammo count of the specified ammo type. | -| *void* SetAmmoCount(string *type*, int *count*)| Set the ammo count of the specified ammo type. | -| *int* GetRelationship(handle *target*)| Get a character's relationship to a specific entity. | -| *int* GetRelationPriority(handle *target*)| Get a character's relationship priority for a specific entity. | -| *void* SetRelationship(handle *target*, int *disposition*, int *priority*)| Set a character's relationship with a specific entity. | -| *handle* GetVehicleEntity()| Get the entity for a character's current vehicle if they're in one. | -| *bool* InViewCone(Vector *target*)| Check if the specified position is in the character's viewcone. | -| *bool* EntInViewCone(handle *target*)| Check if the specified entity is in the character's viewcone. | -| *bool* InAimCone(Vector *target*)| Check if the specified position is in the character's aim cone. | -| *bool* EntInAimCone(handle *target*)| Check if the specified entity is in the character's aim cone. | -| *Vector* BodyAngles()| Get the body's angles. | -| *Vector* BodyDirection2D()| Get the body's 2D direction. | -| *Vector* BodyDirection3D()| Get the body's 3D direction. | -| *Vector* HeadDirection2D()| Get the head's 2D direction. | -| *Vector* HeadDirection3D()| Get the head's 3D direction. | -| *Vector* EyeDirection2D()| Get the eyes' 2D direction. | -| *Vector* EyeDirection3D()| Get the eyes' 3D direction. | +| *bool* IsVisible(Vector *target*)| Check if the specified position can be visible to this entity. | +| *bool* IsEntVisible(handle *target*)| Check if the specified entity can be visible to this entity. | +| *bool* IsVisibleWithMask(Vector *target*, int *traceMask*)| Check if the specified position can be visible to this entity with a specific trace mask. | +| *int* TakeDamage(handle *info*)| Apply damage to this entity with a given info handle | +| *int* Classify()| Get Class_T class ID | +| *string* GetKeyValue(string *key*)| Get a keyvalue | +| *int* GetSpawnFlags()| Get spawnflags | +| *void* AddSpawnFlags()| Add spawnflag(s) | +| *void* RemoveSpawnFlags()| Remove spawnflag(s) | +| *void* ClearSpawnFlags()| Clear spawnflag(s) | +| *bool* HasSpawnFlags()| Check if the entity has specific spawnflag(s) ticked | +| *int* GetEffects()| Get effects | +| *void* AddEffects()| Add effect(s) | +| *void* RemoveEffects()| Remove effect(s) | +| *void* ClearEffects()| Clear effect(s) | +| *void* SetEffects()| Set effect(s) | +| *void* IsEffectActive()| Check if an effect is active | + +*** + +#### CBaseEntity Hooks + +| Signature | Description | +|:------------- | :-----| +| *bool* Input*InputName*()| Called when the entity receives an input from the I/O system. [This already existed in L4D2](https://developer.valvesoftware.com/wiki/List_of_L4D2_Script_Functions#Hooks), but Mapbase adds a `parameter` value which contains the input's parameter. | *** @@ -173,6 +178,46 @@ The base class all equippable weapons derive from. *** +#### CBaseCombatCharacter +The base class shared by players and NPCs. + +| Signature | Description | +|:------------- | :-----| +| *handle* GetActiveWeapon()| Get the character's active weapon entity. | +| *handle* GetWeapon(int *index*)| Get a specific weapon in the character's inventory. | +| *handle* FindWeapon(string *classname*)| Find a specific weapon in the character's inventory by its classname. | +| *Vector* ShootPosition()| Get the character's shoot position. | +| *void* DropAllWeapons(bool *disallowWeaponPickup*)| Make the character drop all of its weapons. | +| *void* EquipWeapon(handle *weapon*)| Make the character equip the specified weapon entity. If they don't already own the weapon, they will acquire it instantly. | +| *int* GetAmmoCount(string *type*)| Get the ammo count of the specified ammo type. | +| *void* SetAmmoCount(string *type*, int *count*)| Set the ammo count of the specified ammo type. | +| *int* GetRelationship(handle *target*)| Get a character's relationship to a specific entity. | +| *int* GetRelationPriority(handle *target*)| Get a character's relationship priority for a specific entity. | +| *void* SetRelationship(handle *target*, int *disposition*, int *priority*)| Set a character's relationship with a specific entity. | +| *handle* GetVehicleEntity()| Get the entity for a character's current vehicle if they're in one. | +| *bool* InViewCone(Vector *target*)| Check if the specified position is in the character's viewcone. | +| *bool* EntInViewCone(handle *target*)| Check if the specified entity is in the character's viewcone. | +| *bool* InAimCone(Vector *target*)| Check if the specified position is in the character's aim cone. | +| *bool* EntInAimCone(handle *target*)| Check if the specified entity is in the character's aim cone. | +| *Vector* BodyAngles()| Get the body's angles. | +| *Vector* BodyDirection2D()| Get the body's 2D direction. | +| *Vector* BodyDirection3D()| Get the body's 3D direction. | +| *Vector* HeadDirection2D()| Get the head's 2D direction. | +| *Vector* HeadDirection3D()| Get the head's 3D direction. | +| *Vector* EyeDirection2D()| Get the eyes' 2D direction. | +| *Vector* EyeDirection3D()| Get the eyes' 3D direction. | + +*** + +### CBasePlayer +The player entity. + +| Signature | Description | +|:------------- | :-----| +| *handle* GetExpresser()| Get a handle for this player's expresser. | + +*** + ### CAI_BaseNPC The base class all NPCs derive from. @@ -232,40 +277,6 @@ The base class for NPCs which act in complex choreo scenes. | *void* AddLookTarget(handle *target*, float *importance*, float *duration*, float *ramp*)| Add a potential look target for this actor. | | *void* AddLookTargetPos(Vector *target*, float *importance*, float *duration*, float *ramp*)| Add a potential look target position for this actor. | -*** -*** - -### CAI_Network -The global list of AI nodes. Can be accessed through a global `AINetwork` instance. - -| Signature | Description | -|:------------- | :-----| -| *int* NumNodes()| Number of nodes in the level | -| *Vector* GetNodePosition(int *nodeID*)| Get position of node using a generic human hull | -| *Vector* GetNodePositionWithHull(int *nodeID*, int *hull*)| Get position of node using the specified hull | -| *float* GetNodeYaw(int *nodeID*)| Get yaw of node | -| *float* NearestNodeToPoint(Vector *position*, bool *checkVisibility*)| Get ID of nearest node | -| *float* NearestNodeToPointForNPC(handle *npc*, Vector *position*, bool *checkVisibility*)| Get ID of nearest node | -| *int* GetNodeType()| Get a node's type | -| *handle* GetNodeHint()| Get a node's hint | - -*** - -### CAI_Hint -An entity which gives contextual pointers for NPCs. - -| Signature | Description | -|:------------- | :-----| -| *int* GetHintType()| Get the hint's type ID. | -| *handle* GetUser()| Get the hint's current user. | -| *string* GetHintGroup()| Get the name of the hint's group. | -| *string* GetHintActivity()| Get the name of the hint activity. | -| *bool* IsDisabled()| Check if the hint is disabled. | -| *bool* IsLocked()| Check if the hint is locked. | -| *int* GetHintType()| Get the hint's node ID. | -| *float* Yaw()| Get the hint's yaw. | -| *Vector* GetDirection()| Get the hint's direction. | - *** ### CAI_Expresser @@ -280,37 +291,7 @@ Expresser class for complex speech. Typically accessed through `GetExpresser()`. | *void* SpeakRawScene(string *scene*, float *delay*)| Speak a raw, instanced VCD scene as though it were played through the Response System. Return whether the scene successfully plays. | | *void* ScriptSpeakAutoGeneratedScene(string *soundname*, float *delay*)| Speak an automatically generated, instanced VCD scene for this sound as though it were played through the Response System. Return whether the scene successfully plays. | -*** -### AI_EnemyInfo_t -Accessor for information about an enemy. Typically accessed through `FindEnemyMemory()`. - -| Signature | Description | -|:------------- | :-----| -| *handle* Enemy()| Get the enemy. | -| *void* SetEnemy(handle *target*)| Set the enemy. | -| *Vector* LastKnownLocation()| Get the enemy's last known location. | -| *void* SetLastKnownLocation(Vector *target*)| Set the enemy's last known location. | -| *Vector* LastSeenLocation()| Get the enemy's last seen location. | -| *void* SetLastSeenLocation(Vector *target*)| Set the enemy's last seen location. | -| *float* TimeLastSeen()| Get the last time the enemy was seen. | -| *void* SetTimeLastSeen(float *time*)| Set the last time the enemy was seen. | -| *float* TimeFirstSeen()| Get the first time the enemy was seen. | -| *void* SetTimeFirstSeen(float *time*)| Set the first time the enemy was seen. | -| *float* TimeLastReacquired()| Get the last time the enemy was reaquired. | -| *void* SetTimeLastReacquired(float *time*)| Set the last time the enemy was reaquired. | -| *float* TimeLastReceivedDamageFrom()| Get the last time damage was received from this enemy. | -| *void* SetTimeLastReceivedDamageFrom(float *time*)| Set the last time damage was received from this enemy. | -| *float* TimeAtFirstHand()| Get the time at which the enemy was seen firsthand. | -| *void* SetTimeAtFirstHand(float *time*)| Set the time at which the enemy was seen firsthand. | -| *bool* DangerMemory()| Get the memory of danger position w/o enemy pointer. | -| *void* SetDangerMemory(bool *value*)| Set the memory of danger position w/o enemy pointer. | -| *bool* EludedMe()| Get whether the enemy is not at the last known location. | -| *void* SetEludedMe(bool *value*)| Set whether the enemy is not at the last known location. | -| *bool* Unforgettable()| Get whether the enemy is unfortgettable. | -| *void* SetUnforgettable(bool *value*)| Set whether the enemy is unfortgettable. | -| *bool* MobbedMe()| Get whether the enemy was part of a mob at some point. | -| *void* SetMobbedMe(bool *value*)| Set whether the enemy was part of a mob at some point. | *** @@ -359,37 +340,6 @@ The base class for drive-able vehicles. *(this descends from `CPropVehicle`!)* *** -### CFourWheelVehiclePhysics -Handler for four-wheel vehicle physics. Can be accessed through `GetPhysics()` on vehicles. - -| Signature | Description | -|:------------- | :-----| -| *void* SetThrottle(*float* value)| Sets the throttle. | -| *void* SetMaxThrottle(*float* value)| Sets the max throttle. | -| *void* SetMaxReverseThrottle(*float* value)| Sets the max reverse throttle. | -| *void* SetSteering(*float* value)| Sets the steering. | -| *void* SetSteeringDegrees(*float* value)| Sets the degrees of steering. | -| *void* SetAction(*float* value)| Sets the action. | -| *void* SetHandbrake(*bool* value)| Sets the handbrake. | -| *void* SetBoost(*float* value)| Sets the boost. | -| *void* SetHasBrakePedal(*bool* value)| Sets whether a handbrake pedal exists. | -| *void* SetDisableEngine(*bool* value)| Sets whether the engine is disabled. | -| *bool* IsEngineDisabled()| Checks whether the engine is disabled. | -| *void* EnableMotion()| Enables vehicle motion. | -| *void* DisableMotion()| Disables vehicle motion. | -| *float* GetSpeed()| Gets the speed. | -| *float* GetMaxSpeed()| Gets the max speed. | -| *float* GetRPM()| Gets the RPM. | -| *float* GetThrottle()| Gets the throttle. | -| *bool* HasBoost()| Checks if the vehicle has the ability to boost. | -| *float* BoostTimeLeft()| Gets how much time is left in any current boost. | -| *bool* IsBoosting()| Checks if the vehicle is boosting. | -| *float* GetHLSpeed()| Gets HL speed. | -| *float* GetSteering()| Gets the steeering. | -| *float* GetSteeringDegrees()| Gets the degrees of steeering. | - -*** - ### CBaseFilter All entities which could be used as filters. @@ -402,6 +352,47 @@ All entities which could be used as filters. | *bool* DamageMod(handle *caller*, handle *info*)| Mods the damage info with the given caller. | *** + + +*** + + +*** +*** + +### CLogicExternalData +An entity which loads keyvalues from an external data file. + +| Signature | Description | +|:------------- | :-----| +| *handle* GetKeyValues()| Gets the external data expressed in CScriptKeyValues. | +| *handle* GetKeyValueBlock()| Gets the current external data block expressed in CScriptKeyValues. | +| *void* SetKeyValues(handle *keyvalues*)| Sets the external data from a CScriptKeyValues object. | +| *void* SetKeyValueBlock(handle *keyvalues*)| Sets the current external data block from a CScriptKeyValues object. | +| *void* LoadFile()| Loads external data from the external file. | +| *void* SaveFile()| Saves the external data to the external file. | + +*** + +## Singletons +single + +*** + +### CAI_Network +The global list of AI nodes. Can be accessed through a global `AINetwork` instance. + +| Signature | Description | +|:------------- | :-----| +| *int* NumNodes()| Number of nodes in the level | +| *Vector* GetNodePosition(int *nodeID*)| Get position of node using a generic human hull | +| *Vector* GetNodePositionWithHull(int *nodeID*, int *hull*)| Get position of node using the specified hull | +| *float* GetNodeYaw(int *nodeID*)| Get yaw of node | +| *float* NearestNodeToPoint(Vector *position*, bool *checkVisibility*)| Get ID of nearest node | +| *float* NearestNodeToPointForNPC(handle *npc*, Vector *position*, bool *checkVisibility*)| Get ID of nearest node | +| *int* GetNodeType()| Get a node's type | +| *handle* GetNodeHint()| Get a node's hint | + *** ### CGlobalState @@ -429,7 +420,31 @@ All-purpose Mapbase system primarily used for map-specific files. Can be accesse | *void* LoadTalkerFile(string *fileName*)| Loads a custom talker file. | | *void* LoadActbusyFile(string *fileName*)| Loads a custom actbusy file. | + +## Data Containers +These are classes that were already exposed to VScript, but have new features or changes included with Mapbase. + *** + +### CScriptKeyValues +Wrapper class over KeyValues instance. + +| Signature | Description | +|:------------- | :-----| +| *string* GetName()| Given a KeyValues object, return its name. | +| *int* GetInt()| Given a KeyValues object, return its own associated integer value. | +| *float* GetFloat()| Given a KeyValues object, return its own associated float value. | +| *string* GetString()| Given a KeyValues object, return its own associated string value. | +| *bool* GetBool()| Given a KeyValues object, return its own associated bool value. | +| *void* SetKeyInt(int *value*)| Given a KeyValues object and a key name, set associated integer value. | +| *void* SetKeyFloat(float *value*)| Given a KeyValues object and a key name, set associated float value. | +| *void* SetKeyBool(bool *value*)| Given a KeyValues object and a key name, set associated bool value. | +| *void* SetKeyString(string *value*)| Given a KeyValues object and a key name, set associated string value. | +| *void* SetName(string *name*)| Given a KeyValues object, set its name. | +| *void* SetFloat(float *value*)| Given a KeyValues object, set its own associated float value. | +| *void* SetBool(bool *value*)| Given a KeyValues object, set its own associated bool value. | +| *void* SetString(string *value*)| Given a KeyValues object, set its own associated string value. | + *** ### CTakeDamageInfo @@ -508,85 +523,82 @@ Handle for accessing trace_t info. | *bool* StartSolid()| Returns whether the trace started within a solid. | | *void* Destroy()| Deletes this instance. Important for preventing memory leaks. | -*** *** -### CLogicExternalData -An entity which loads keyvalues from an external data file. +### CAI_Hint +An entity which gives contextual pointers for NPCs. | Signature | Description | |:------------- | :-----| -| *handle* GetKeyValues()| Gets the external data expressed in CScriptKeyValues. | -| *handle* GetKeyValueBlock()| Gets the current external data block expressed in CScriptKeyValues. | -| *void* SetKeyValues(handle *keyvalues*)| Sets the external data from a CScriptKeyValues object. | -| *void* SetKeyValueBlock(handle *keyvalues*)| Sets the current external data block from a CScriptKeyValues object. | -| *void* LoadFile()| Loads external data from the external file. | -| *void* SaveFile()| Saves the external data to the external file. | +| *int* GetHintType()| Get the hint's type ID. | +| *handle* GetUser()| Get the hint's current user. | +| *string* GetHintGroup()| Get the name of the hint's group. | +| *string* GetHintActivity()| Get the name of the hint activity. | +| *bool* IsDisabled()| Check if the hint is disabled. | +| *bool* IsLocked()| Check if the hint is locked. | +| *int* GetHintType()| Get the hint's node ID. | +| *float* Yaw()| Get the hint's yaw. | +| *Vector* GetDirection()| Get the hint's direction. | *** -## Modified VScript Classes -These are classes that were already exposed to VScript, but have new features or changes included with Mapbase. - -*** - -### CBaseEntity -Root class of all server-side entities. +### AI_EnemyInfo_t +Accessor for information about an enemy. Typically accessed through `FindEnemyMemory()`. | Signature | Description | |:------------- | :-----| -| *bool* IsVisible(Vector *target*)| Check if the specified position can be visible to this entity. | -| *bool* IsEntVisible(handle *target*)| Check if the specified entity can be visible to this entity. | -| *bool* IsVisibleWithMask(Vector *target*, int *traceMask*)| Check if the specified position can be visible to this entity with a specific trace mask. | -| *int* TakeDamage(handle *info*)| Apply damage to this entity with a given info handle | -| *int* Classify()| Get Class_T class ID | -| *string* GetKeyValue(string *key*)| Get a keyvalue | -| *int* GetSpawnFlags()| Get spawnflags | -| *void* AddSpawnFlags()| Add spawnflag(s) | -| *void* RemoveSpawnFlags()| Remove spawnflag(s) | -| *void* ClearSpawnFlags()| Clear spawnflag(s) | -| *bool* HasSpawnFlags()| Check if the entity has specific spawnflag(s) ticked | -| *int* GetEffects()| Get effects | -| *void* AddEffects()| Add effect(s) | -| *void* RemoveEffects()| Remove effect(s) | -| *void* ClearEffects()| Clear effect(s) | -| *void* SetEffects()| Set effect(s) | -| *void* IsEffectActive()| Check if an effect is active | +| *handle* Enemy()| Get the enemy. | +| *void* SetEnemy(handle *target*)| Set the enemy. | +| *Vector* LastKnownLocation()| Get the enemy's last known location. | +| *void* SetLastKnownLocation(Vector *target*)| Set the enemy's last known location. | +| *Vector* LastSeenLocation()| Get the enemy's last seen location. | +| *void* SetLastSeenLocation(Vector *target*)| Set the enemy's last seen location. | +| *float* TimeLastSeen()| Get the last time the enemy was seen. | +| *void* SetTimeLastSeen(float *time*)| Set the last time the enemy was seen. | +| *float* TimeFirstSeen()| Get the first time the enemy was seen. | +| *void* SetTimeFirstSeen(float *time*)| Set the first time the enemy was seen. | +| *float* TimeLastReacquired()| Get the last time the enemy was reaquired. | +| *void* SetTimeLastReacquired(float *time*)| Set the last time the enemy was reaquired. | +| *float* TimeLastReceivedDamageFrom()| Get the last time damage was received from this enemy. | +| *void* SetTimeLastReceivedDamageFrom(float *time*)| Set the last time damage was received from this enemy. | +| *float* TimeAtFirstHand()| Get the time at which the enemy was seen firsthand. | +| *void* SetTimeAtFirstHand(float *time*)| Set the time at which the enemy was seen firsthand. | +| *bool* DangerMemory()| Get the memory of danger position w/o enemy pointer. | +| *void* SetDangerMemory(bool *value*)| Set the memory of danger position w/o enemy pointer. | +| *bool* EludedMe()| Get whether the enemy is not at the last known location. | +| *void* SetEludedMe(bool *value*)| Set whether the enemy is not at the last known location. | +| *bool* Unforgettable()| Get whether the enemy is unfortgettable. | +| *void* SetUnforgettable(bool *value*)| Set whether the enemy is unfortgettable. | +| *bool* MobbedMe()| Get whether the enemy was part of a mob at some point. | +| *void* SetMobbedMe(bool *value*)| Set whether the enemy was part of a mob at some point. | *** -#### CBaseEntity Hooks +### CFourWheelVehiclePhysics +Handler for four-wheel vehicle physics. Can be accessed through `GetPhysics()` on vehicles. | Signature | Description | |:------------- | :-----| -| *bool* Input*InputName*()| Called when the entity receives an input from the I/O system. [This already existed in L4D2](https://developer.valvesoftware.com/wiki/List_of_L4D2_Script_Functions#Hooks), but Mapbase adds a `parameter` value which contains the input's parameter. | - -*** - -### CBasePlayer -The player entity. - -| Signature | Description | -|:------------- | :-----| -| *handle* GetExpresser()| Get a handle for this player's expresser. | - -*** - -### CScriptKeyValues -Wrapper class over KeyValues instance. - -| Signature | Description | -|:------------- | :-----| -| *string* GetName()| Given a KeyValues object, return its name. | -| *int* GetInt()| Given a KeyValues object, return its own associated integer value. | -| *float* GetFloat()| Given a KeyValues object, return its own associated float value. | -| *string* GetString()| Given a KeyValues object, return its own associated string value. | -| *bool* GetBool()| Given a KeyValues object, return its own associated bool value. | -| *void* SetKeyInt(int *value*)| Given a KeyValues object and a key name, set associated integer value. | -| *void* SetKeyFloat(float *value*)| Given a KeyValues object and a key name, set associated float value. | -| *void* SetKeyBool(bool *value*)| Given a KeyValues object and a key name, set associated bool value. | -| *void* SetKeyString(string *value*)| Given a KeyValues object and a key name, set associated string value. | -| *void* SetName(string *name*)| Given a KeyValues object, set its name. | -| *void* SetFloat(float *value*)| Given a KeyValues object, set its own associated float value. | -| *void* SetBool(bool *value*)| Given a KeyValues object, set its own associated bool value. | -| *void* SetString(string *value*)| Given a KeyValues object, set its own associated string value. | +| *void* SetThrottle(*float* value)| Sets the throttle. | +| *void* SetMaxThrottle(*float* value)| Sets the max throttle. | +| *void* SetMaxReverseThrottle(*float* value)| Sets the max reverse throttle. | +| *void* SetSteering(*float* value)| Sets the steering. | +| *void* SetSteeringDegrees(*float* value)| Sets the degrees of steering. | +| *void* SetAction(*float* value)| Sets the action. | +| *void* SetHandbrake(*bool* value)| Sets the handbrake. | +| *void* SetBoost(*float* value)| Sets the boost. | +| *void* SetHasBrakePedal(*bool* value)| Sets whether a handbrake pedal exists. | +| *void* SetDisableEngine(*bool* value)| Sets whether the engine is disabled. | +| *bool* IsEngineDisabled()| Checks whether the engine is disabled. | +| *void* EnableMotion()| Enables vehicle motion. | +| *void* DisableMotion()| Disables vehicle motion. | +| *float* GetSpeed()| Gets the speed. | +| *float* GetMaxSpeed()| Gets the max speed. | +| *float* GetRPM()| Gets the RPM. | +| *float* GetThrottle()| Gets the throttle. | +| *bool* HasBoost()| Checks if the vehicle has the ability to boost. | +| *float* BoostTimeLeft()| Gets how much time is left in any current boost. | +| *bool* IsBoosting()| Checks if the vehicle is boosting. | +| *float* GetHLSpeed()| Gets HL speed. | +| *float* GetSteering()| Gets the steeering. | +| *float* GetSteeringDegrees()| Gets the degrees of steeering. |