Updated VScript in Mapbase (markdown)

Blixibon 2020-06-01 09:45:32 -05:00
parent af2aede9b8
commit ff0ede4b3f

@ -70,7 +70,6 @@ Some features from Valve's games are not available in Mapbase's implementation o
* `Entities`
* `Convars`
* `NetProps`
* It is currently not possible to use in-game documentation methods, such as `script_help`.
* In the source code, the following `IScriptVM` functions are currently unsupported: `ConnectDebugger`, `DisconnectDebugger`, `AddSearchPath`, `Frame`, `DumpState`, `SetOutputCallback`, `SetErrorCallback`
# Tutorials
@ -101,6 +100,8 @@ These are functions that can be accessed globally and without a class.
| *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* printcl(string *text*)| Version of printl() which takes a color before the message. |
| *handle* CreateDamageInfo(handle *inflictor*, handle *attacker*, Vector *force*, Vector *damagePos*, float *damage*, int *type*)| Creates damage info. |
| *void* DestroyDamageInfo(handle *info*)| Destroys damage info. |
## New VScript Classes
@ -477,6 +478,36 @@ Damage information handler.
| *bool* GetDamagedOtherPlayers()| Gets whether other players have been damaged. |
| *void* SetDamagedOtherPlayers(bool *toggle*)| Sets whether other players have been damaged. |
***
### CGameTrace
Handle for accessing trace_t info.
| Signature | Description |
|:------------- | :-----|
| *bool* DidHitWorld()| Returns whether the trace hit the world entity or not. |
| *bool* DidHitNonWorldEntity()| Returns whether the trace hit something other than the world entity. |
| *int* GetEntityIndex()| Returns the index of whatever entity this trace hit. |
| *bool* DidHit()| Returns whether the trace hit anything. |
| *float* FractionLeftSolid()| If this trace started within a solid, this is the point in the trace's fraction at which it left that solid. |
| *int* HitGroup()| Returns the specific hit group this trace hit if it hit an entity. |
| *int* PhysicsBone()| Returns the physics bone this trace hit if it hit an entity. |
| *handle* Entity()| Returns the entity this trace has hit. |
| *int* HitBox()| Returns the hitbox of the entity this trace has hit. If it hit the world entity, this returns the static prop index. |
| *bool* IsDispSurface()| Returns whether this trace hit a displacement. |
| *bool* IsDispSurfaceWalkable()| Returns whether DISPSURF_FLAG_WALKABLE is ticked on the displacement this trace hit. |
| *bool* IsDispSurfaceBuildable()| Returns whether DISPSURF_FLAG_BUILDABLE is ticked on the displacement this trace hit. |
| *bool* IsDispSurfaceProp1()| Returns whether DISPSURF_FLAG_SURFPROP1 is ticked on the displacement this trace hit. |
| *bool* IsDispSurfaceProp2()| Returns whether DISPSURF_FLAG_SURFPROP2 is ticked on the displacement this trace hit. |
| *Vector* StartPos()| Gets the trace's start position. |
| *Vector* EndPos()| Gets the trace's end position. |
| *float* Fraction()| Gets the fraction of the trace completed. For example, if the trace stopped exactly halfway to the end position, this would be 0.5. |
| *int* Contents()| Gets the contents of the surface the trace has hit. |
| *int* DispFlags()| Gets the displacement flags of the surface the trace has hit. |
| *bool* AllSolid()| Returns whether the trace is completely within a solid. |
| *bool* StartSolid()| Returns whether the trace started within a solid. |
| *void* Destroy()| Deletes this instance. Important for preventing memory leaks. |
***
***