Updated VScript in Mapbase (markdown)

Blixibon 2020-06-21 10:57:09 -05:00
parent 6b1929182e
commit 878e9c364b

@ -102,10 +102,11 @@ These are functions that can be accessed globally and without a class.
| Signature | Description | | Signature | Description |
|:------------- | :-----| |:------------- | :-----|
| *handle* GameOver(string *message*, float *delay*, float *fadeTime*, float *loadTime*, int *r*, int *g*, int *b*)| Ends the game and reloads the last save. | | *handle* GameOver(*string* message, *float* delay, *float* fadeTime, *float* loadTime, *int* r, *int* g, *int* b)| Ends the game and reloads the last save. |
| *bool* MegaPhyscannonActive()| Checks if supercharged gravity gun mode is enabled. | | *bool* MegaPhyscannonActive()| Checks if supercharged gravity gun mode is enabled. |
| *void* printc(string *text*)| Version of print() which takes a color before the message. | | *void* printc(*string* text)| Version of print() which takes a color before the message. |
| *void* printcl(string *text*)| Version of printl() which takes a color before the message. | | *void* printcl(*string* text)| Version of printl() which takes a color before the message. |
| *void* DecalTrace(*CGameTrace* trace, *string* decalName)| 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. |
*** ***
@ -153,6 +154,16 @@ These global functions are related to math or math-related classes.
| *float* Approach(*float* target, *float* value, *float* speed)| Returns a value which approaches the target value from the input value with the specified speed. | | *float* Approach(*float* target, *float* value, *float* speed)| Returns a value which approaches the target value from the input value with the specified speed. |
| *float* PredictedPosition(*CBaseEntity* target, *float* flTimeDelta)| Predicts what an entity's position will be in a given amount of time. | | *float* PredictedPosition(*CBaseEntity* target, *float* flTimeDelta)| Predicts what an entity's position will be in a given amount of time. |
### Precaching
These global functions are related to precaching assets.
| Signature | Description |
|:------------- | :-----|
| *int* PrecacheModel(*string* fileName)| Precaches a model for later usage. |
| *void* PrecacheMaterial(*string* fileName)| Precaches a material for later usage. |
| *void* PrecacheParticleSystem(*string* fileName)| Precaches a particle system for later usage. |
| *void* PrecacheOther(*string* className)| Precaches an entity class for later usage. |
*** ***
## Entity Classes ## Entity Classes
@ -170,7 +181,10 @@ Root class of all server-side entities. This class was already exposed to VScrip
| *bool* IsVisibleWithMask(Vector *target*, int *traceMask*)| Check if the specified position can be visible to this entity with a specific trace mask. | | *bool* IsVisibleWithMask(Vector *target*, int *traceMask*)| Check if the specified position can be visible to this entity with a specific trace mask. |
| *int* TakeDamage(*CTakeDamageInfo* info)| Apply damage to this entity with a given info handle | | *int* TakeDamage(*CTakeDamageInfo* info)| Apply damage to this entity with a given info handle |
| *void* FireBullets(*FireBulletsInfo_t* info)| Fire bullets from entity with a given info handle | | *void* FireBullets(*FireBulletsInfo_t* info)| Fire bullets from entity with a given info handle |
| *int* TakeHealth(*float* health, *int* damageType)| Give this entity health |
| *bool* IsAlive()| Return true if this entity is alive |
| *int* Classify()| Get Class_T class ID | | *int* Classify()| Get Class_T class ID |
| *bool* AddOutput(*string* output, *string* target, *string* input, *string* parameter, *float* delay, *int* maxTimes)| Add an output |
| *string* GetKeyValue(string *key*)| Get a keyvalue | | *string* GetKeyValue(string *key*)| Get a keyvalue |
| *int* GetSpawnFlags()| Get spawnflags | | *int* GetSpawnFlags()| Get spawnflags |
| *void* AddSpawnFlags(int *flags*)| Add spawnflag(s) | | *void* AddSpawnFlags(int *flags*)| Add spawnflag(s) |
@ -241,6 +255,7 @@ The base class shared by players and NPCs.
| *handle* GetActiveWeapon()| Get the character's active weapon entity. | | *handle* GetActiveWeapon()| Get the character's active weapon entity. |
| *handle* GetWeapon(int *index*)| Get a specific weapon in the character's inventory. | | *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. | | *handle* FindWeapon(string *classname*)| Find a specific weapon in the character's inventory by its classname. |
| *void* GetAllWeapons(*handle* table)| Get the character's weapon inventory. |
| *Vector* ShootPosition()| Get the character's shoot position. | | *Vector* ShootPosition()| Get the character's shoot position. |
| *void* DropAllWeapons(bool *disallowWeaponPickup*)| Make the character drop all of its weapons. | | *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. | | *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. |
@ -496,6 +511,25 @@ All-purpose Mapbase system primarily used for map-specific files. Can be accesse
*** ***
### CAmmoDef
The ammo type definition manager. Can be accessed through a global `AmmoDef` instance.
| Signature | Description |
|:------------- | :-----|
| *string* Name(*int* index)| Gets the name of the specified ammo type index. |
| *int* Index(*string* name)| Gets the index of the specified ammo type name. |
| *int* PlrDamage(*int* index)| Gets the damage players deal for the specified ammo type. |
| *int* NPCDamage(*int* index)| Gets the damage NPCs deal for the specified ammo type. |
| *int* MaxCarry(*int* index)| Gets the maximum amount of this ammo type which players should be able to carry. |
| *int* DamageType(*int* index)| Gets the type of damage this ammo type deals. |
| *int* TracerType(*int* index)| Gets the type of tracer this ammo type uses. |
| *float* DamageForce(*int* index)| Gets the amount of force this ammo type deals. |
| *int* MinSplashSize(*int* index)| Gets the minimum size of water splashes caused by impacts from this ammo type. |
| *int* MaxSplashSize(*int* index)| Gets the maximum size of water splashes caused by impacts from this ammo type. |
| *int* Flags(*int* index)| Gets the flags this ammo type uses. |
***
## Data Containers ## Data Containers
These are classes intended to contain and relay specific kinds of data. These are classes intended to contain and relay specific kinds of data.