mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-02-03 01:00:34 +03:00
Restructured documentation
parent
a232e35305
commit
2cb1951e6e
@ -26,32 +26,33 @@ For more information on VScript itself, [click here](https://developer.valvesoft
|
|||||||
* [Tutorials](VScript-in-Mapbase#Tutorials)
|
* [Tutorials](VScript-in-Mapbase#Tutorials)
|
||||||
* [Documentation](VScript-in-Mapbase#Documentation)
|
* [Documentation](VScript-in-Mapbase#Documentation)
|
||||||
* [Global Functions](VScript-in-Mapbase#Global-Functions)
|
* [Global Functions](VScript-in-Mapbase#Global-Functions)
|
||||||
* [New VScript Classes](VScript-in-Mapbase#New-VScript-Classes)
|
* [Entity Classes](VScript-in-Mapbase#Entity-Classes)
|
||||||
* [CBaseCombatCharacter](VScript-in-Mapbase#CBaseCombatCharacter)
|
* [CBaseEntity](VScript-in-Mapbase#CBaseEntity)
|
||||||
|
* [Hooks](VScript-in-Mapbase#CBaseEntity-Hooks)
|
||||||
* [CBaseCombatWeapon](VScript-in-Mapbase#CBaseCombatWeapon)
|
* [CBaseCombatWeapon](VScript-in-Mapbase#CBaseCombatWeapon)
|
||||||
|
* [CBaseCombatCharacter](VScript-in-Mapbase#CBaseCombatCharacter)
|
||||||
|
* [CBasePlayer](VScript-in-Mapbase#CBasePlayer)
|
||||||
* [CAI_BaseNPC](VScript-in-Mapbase#CAI_BaseNPC)
|
* [CAI_BaseNPC](VScript-in-Mapbase#CAI_BaseNPC)
|
||||||
* [Hooks](VScript-in-Mapbase#CAI_BaseNPC-Hooks)
|
* [Hooks](VScript-in-Mapbase#CAI_BaseNPC-Hooks)
|
||||||
* [CAI_BaseActor](VScript-in-Mapbase#CAI_BaseActor)
|
* [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)
|
* [CAI_Expresser](VScript-in-Mapbase#CAI_Expresser)
|
||||||
* [AI_EnemyInfo_t](VScript-in-Mapbase#AI_EnemyInfo_t)
|
|
||||||
* [CAI_GoalEntity](VScript-in-Mapbase#CAI_GoalEntity)
|
* [CAI_GoalEntity](VScript-in-Mapbase#CAI_GoalEntity)
|
||||||
* [CAI_ActBusyGoal](VScript-in-Mapbase#CAI_ActBusyGoal)
|
* [CAI_ActBusyGoal](VScript-in-Mapbase#CAI_ActBusyGoal)
|
||||||
* [CPropVehicle](VScript-in-Mapbase#CPropVehicle)
|
* [CPropVehicle](VScript-in-Mapbase#CPropVehicle)
|
||||||
* [CPropVehicleDriveable](VScript-in-Mapbase#CPropVehicleDriveable)
|
* [CPropVehicleDriveable](VScript-in-Mapbase#CPropVehicleDriveable)
|
||||||
* [CFourWheelVehiclePhysics](VScript-in-Mapbase#CFourWheelVehiclePhysics)
|
|
||||||
* [CBaseFilter](VScript-in-Mapbase#CBaseFilter)
|
* [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)
|
* [CGlobalState](VScript-in-Mapbase#CGlobalState)
|
||||||
* [CMapbaseSystem](VScript-in-Mapbase#CMapbaseSystem)
|
* [CMapbaseSystem](VScript-in-Mapbase#CMapbaseSystem)
|
||||||
|
* [Data Containers](VScript-in-Mapbase#Data-Containers)
|
||||||
|
* [CScriptKeyValues](VScript-in-Mapbase#CScriptKeyValues)
|
||||||
* [CTakeDamageInfo](VScript-in-Mapbase#CTakeDamageInfo)
|
* [CTakeDamageInfo](VScript-in-Mapbase#CTakeDamageInfo)
|
||||||
* [CGameTrace](VScript-in-Mapbase#CGameTrace)
|
* [CGameTrace](VScript-in-Mapbase#CGameTrace)
|
||||||
* [CLogicExternalData](VScript-in-Mapbase#CLogicExternalData)
|
* [CAI_Hint](VScript-in-Mapbase#CAI_Hint)
|
||||||
* [Modified VScript Classes](VScript-in-Mapbase#Modified-VScript-Classes)
|
* [AI_EnemyInfo_t](VScript-in-Mapbase#AI_EnemyInfo_t)
|
||||||
* [CBaseEntity](VScript-in-Mapbase#CBaseEntity)
|
* [CFourWheelVehiclePhysics](VScript-in-Mapbase#CFourWheelVehiclePhysics)
|
||||||
* [Hooks](VScript-in-Mapbase#CBaseEntity-Hooks)
|
|
||||||
* [CBasePlayer](VScript-in-Mapbase#CBasePlayer)
|
|
||||||
* [CScriptKeyValues](VScript-in-Mapbase#CScriptKeyValues)
|
|
||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
@ -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`.
|
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
|
## Global Functions
|
||||||
These are functions that can be accessed globally and without a class.
|
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. |
|
| *void* DestroyDamageInfo(handle *info*)| Destroys damage info. |
|
||||||
|
|
||||||
|
|
||||||
## New VScript Classes
|
## Entity 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).
|
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
|
### CBaseEntity
|
||||||
The base class shared by players and NPCs.
|
Root class of all server-side entities.
|
||||||
|
|
||||||
| Signature | Description |
|
| Signature | Description |
|
||||||
|:------------- | :-----|
|
|:------------- | :-----|
|
||||||
| *handle* GetActiveWeapon()| Get the character's active weapon entity. |
|
| *bool* IsVisible(Vector *target*)| Check if the specified position can be visible to this entity. |
|
||||||
| *handle* GetWeapon(int *index*)| Get a specific weapon in the character's inventory. |
|
| *bool* IsEntVisible(handle *target*)| Check if the specified entity can be visible to this entity. |
|
||||||
| *handle* FindWeapon(string *classname*)| Find a specific weapon in the character's inventory by its classname. |
|
| *bool* IsVisibleWithMask(Vector *target*, int *traceMask*)| Check if the specified position can be visible to this entity with a specific trace mask. |
|
||||||
| *Vector* ShootPosition()| Get the character's shoot position. |
|
| *int* TakeDamage(handle *info*)| Apply damage to this entity with a given info handle |
|
||||||
| *void* DropAllWeapons(bool *disallowWeaponPickup*)| Make the character drop all of its weapons. |
|
| *int* Classify()| Get Class_T class ID |
|
||||||
| *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. |
|
| *string* GetKeyValue(string *key*)| Get a keyvalue |
|
||||||
| *int* GetAmmoCount(string *type*)| Get the ammo count of the specified ammo type. |
|
| *int* GetSpawnFlags()| Get spawnflags |
|
||||||
| *void* SetAmmoCount(string *type*, int *count*)| Set the ammo count of the specified ammo type. |
|
| *void* AddSpawnFlags()| Add spawnflag(s) |
|
||||||
| *int* GetRelationship(handle *target*)| Get a character's relationship to a specific entity. |
|
| *void* RemoveSpawnFlags()| Remove spawnflag(s) |
|
||||||
| *int* GetRelationPriority(handle *target*)| Get a character's relationship priority for a specific entity. |
|
| *void* ClearSpawnFlags()| Clear spawnflag(s) |
|
||||||
| *void* SetRelationship(handle *target*, int *disposition*, int *priority*)| Set a character's relationship with a specific entity. |
|
| *bool* HasSpawnFlags()| Check if the entity has specific spawnflag(s) ticked |
|
||||||
| *handle* GetVehicleEntity()| Get the entity for a character's current vehicle if they're in one. |
|
| *int* GetEffects()| Get effects |
|
||||||
| *bool* InViewCone(Vector *target*)| Check if the specified position is in the character's viewcone. |
|
| *void* AddEffects()| Add effect(s) |
|
||||||
| *bool* EntInViewCone(handle *target*)| Check if the specified entity is in the character's viewcone. |
|
| *void* RemoveEffects()| Remove effect(s) |
|
||||||
| *bool* InAimCone(Vector *target*)| Check if the specified position is in the character's aim cone. |
|
| *void* ClearEffects()| Clear effect(s) |
|
||||||
| *bool* EntInAimCone(handle *target*)| Check if the specified entity is in the character's aim cone. |
|
| *void* SetEffects()| Set effect(s) |
|
||||||
| *Vector* BodyAngles()| Get the body's angles. |
|
| *void* IsEffectActive()| Check if an effect is active |
|
||||||
| *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. |
|
#### CBaseEntity Hooks
|
||||||
| *Vector* EyeDirection2D()| Get the eyes' 2D direction. |
|
|
||||||
| *Vector* EyeDirection3D()| Get the eyes' 3D direction. |
|
| 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
|
### CAI_BaseNPC
|
||||||
The base class all NPCs derive from.
|
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* 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. |
|
| *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
|
### 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* 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. |
|
| *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
|
### CBaseFilter
|
||||||
All entities which could be used as filters.
|
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. |
|
| *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
|
### 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* LoadTalkerFile(string *fileName*)| Loads a custom talker file. |
|
||||||
| *void* LoadActbusyFile(string *fileName*)| Loads a custom actbusy 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
|
### CTakeDamageInfo
|
||||||
@ -508,85 +523,82 @@ Handle for accessing trace_t info.
|
|||||||
| *bool* StartSolid()| Returns whether the trace started within a solid. |
|
| *bool* StartSolid()| Returns whether the trace started within a solid. |
|
||||||
| *void* Destroy()| Deletes this instance. Important for preventing memory leaks. |
|
| *void* Destroy()| Deletes this instance. Important for preventing memory leaks. |
|
||||||
|
|
||||||
***
|
|
||||||
***
|
***
|
||||||
|
|
||||||
### CLogicExternalData
|
### CAI_Hint
|
||||||
An entity which loads keyvalues from an external data file.
|
An entity which gives contextual pointers for NPCs.
|
||||||
|
|
||||||
| Signature | Description |
|
| Signature | Description |
|
||||||
|:------------- | :-----|
|
|:------------- | :-----|
|
||||||
| *handle* GetKeyValues()| Gets the external data expressed in CScriptKeyValues. |
|
| *int* GetHintType()| Get the hint's type ID. |
|
||||||
| *handle* GetKeyValueBlock()| Gets the current external data block expressed in CScriptKeyValues. |
|
| *handle* GetUser()| Get the hint's current user. |
|
||||||
| *void* SetKeyValues(handle *keyvalues*)| Sets the external data from a CScriptKeyValues object. |
|
| *string* GetHintGroup()| Get the name of the hint's group. |
|
||||||
| *void* SetKeyValueBlock(handle *keyvalues*)| Sets the current external data block from a CScriptKeyValues object. |
|
| *string* GetHintActivity()| Get the name of the hint activity. |
|
||||||
| *void* LoadFile()| Loads external data from the external file. |
|
| *bool* IsDisabled()| Check if the hint is disabled. |
|
||||||
| *void* SaveFile()| Saves the external data to the external file. |
|
| *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
|
### AI_EnemyInfo_t
|
||||||
These are classes that were already exposed to VScript, but have new features or changes included with Mapbase.
|
Accessor for information about an enemy. Typically accessed through `FindEnemyMemory()`.
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### CBaseEntity
|
|
||||||
Root class of all server-side entities.
|
|
||||||
|
|
||||||
| Signature | Description |
|
| Signature | Description |
|
||||||
|:------------- | :-----|
|
|:------------- | :-----|
|
||||||
| *bool* IsVisible(Vector *target*)| Check if the specified position can be visible to this entity. |
|
| *handle* Enemy()| Get the enemy. |
|
||||||
| *bool* IsEntVisible(handle *target*)| Check if the specified entity can be visible to this entity. |
|
| *void* SetEnemy(handle *target*)| Set the enemy. |
|
||||||
| *bool* IsVisibleWithMask(Vector *target*, int *traceMask*)| Check if the specified position can be visible to this entity with a specific trace mask. |
|
| *Vector* LastKnownLocation()| Get the enemy's last known location. |
|
||||||
| *int* TakeDamage(handle *info*)| Apply damage to this entity with a given info handle |
|
| *void* SetLastKnownLocation(Vector *target*)| Set the enemy's last known location. |
|
||||||
| *int* Classify()| Get Class_T class ID |
|
| *Vector* LastSeenLocation()| Get the enemy's last seen location. |
|
||||||
| *string* GetKeyValue(string *key*)| Get a keyvalue |
|
| *void* SetLastSeenLocation(Vector *target*)| Set the enemy's last seen location. |
|
||||||
| *int* GetSpawnFlags()| Get spawnflags |
|
| *float* TimeLastSeen()| Get the last time the enemy was seen. |
|
||||||
| *void* AddSpawnFlags()| Add spawnflag(s) |
|
| *void* SetTimeLastSeen(float *time*)| Set the last time the enemy was seen. |
|
||||||
| *void* RemoveSpawnFlags()| Remove spawnflag(s) |
|
| *float* TimeFirstSeen()| Get the first time the enemy was seen. |
|
||||||
| *void* ClearSpawnFlags()| Clear spawnflag(s) |
|
| *void* SetTimeFirstSeen(float *time*)| Set the first time the enemy was seen. |
|
||||||
| *bool* HasSpawnFlags()| Check if the entity has specific spawnflag(s) ticked |
|
| *float* TimeLastReacquired()| Get the last time the enemy was reaquired. |
|
||||||
| *int* GetEffects()| Get effects |
|
| *void* SetTimeLastReacquired(float *time*)| Set the last time the enemy was reaquired. |
|
||||||
| *void* AddEffects()| Add effect(s) |
|
| *float* TimeLastReceivedDamageFrom()| Get the last time damage was received from this enemy. |
|
||||||
| *void* RemoveEffects()| Remove effect(s) |
|
| *void* SetTimeLastReceivedDamageFrom(float *time*)| Set the last time damage was received from this enemy. |
|
||||||
| *void* ClearEffects()| Clear effect(s) |
|
| *float* TimeAtFirstHand()| Get the time at which the enemy was seen firsthand. |
|
||||||
| *void* SetEffects()| Set effect(s) |
|
| *void* SetTimeAtFirstHand(float *time*)| Set the time at which the enemy was seen firsthand. |
|
||||||
| *void* IsEffectActive()| Check if an effect is active |
|
| *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 |
|
| 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. |
|
| *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. |
|
||||||
### CBasePlayer
|
| *void* SetSteeringDegrees(*float* value)| Sets the degrees of steering. |
|
||||||
The player entity.
|
| *void* SetAction(*float* value)| Sets the action. |
|
||||||
|
| *void* SetHandbrake(*bool* value)| Sets the handbrake. |
|
||||||
| Signature | Description |
|
| *void* SetBoost(*float* value)| Sets the boost. |
|
||||||
|:------------- | :-----|
|
| *void* SetHasBrakePedal(*bool* value)| Sets whether a handbrake pedal exists. |
|
||||||
| *handle* GetExpresser()| Get a handle for this player's expresser. |
|
| *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. |
|
||||||
### CScriptKeyValues
|
| *float* GetSpeed()| Gets the speed. |
|
||||||
Wrapper class over KeyValues instance.
|
| *float* GetMaxSpeed()| Gets the max speed. |
|
||||||
|
| *float* GetRPM()| Gets the RPM. |
|
||||||
| Signature | Description |
|
| *float* GetThrottle()| Gets the throttle. |
|
||||||
|:------------- | :-----|
|
| *bool* HasBoost()| Checks if the vehicle has the ability to boost. |
|
||||||
| *string* GetName()| Given a KeyValues object, return its name. |
|
| *float* BoostTimeLeft()| Gets how much time is left in any current boost. |
|
||||||
| *int* GetInt()| Given a KeyValues object, return its own associated integer value. |
|
| *bool* IsBoosting()| Checks if the vehicle is boosting. |
|
||||||
| *float* GetFloat()| Given a KeyValues object, return its own associated float value. |
|
| *float* GetHLSpeed()| Gets HL speed. |
|
||||||
| *string* GetString()| Given a KeyValues object, return its own associated string value. |
|
| *float* GetSteering()| Gets the steeering. |
|
||||||
| *bool* GetBool()| Given a KeyValues object, return its own associated bool value. |
|
| *float* GetSteeringDegrees()| Gets the degrees of steeering. |
|
||||||
| *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. |
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user