-
Notifications
You must be signed in to change notification settings - Fork 146
VScript in Mapbase
This page is for the experimental VScript branch. These features are not yet available in the main build of Mapbase.
Mapbase supports a custom implementation of VScript based off of the Alien Swarm SDK and reductor's Squirrel integration. VScript is a scripting layer which allows external scripts to be used as an extension of map logic.
Mapbase's VScript is more limited and primitive compared to the VScript in Valve's games, as a lot of the original VScript code is inaccessible. Some common global methods and data types are not (yet) implemented, but since the Alien Swarm SDK includes entity script descriptions, most of the entity implementations are fully functional.
Mapbase's implementation of VScript does not use any leaked code whatsoever.
For more information on VScript itself, click here to see its article on the Valve Developer Community. See Using VScript as a HL2 mapper if you're comming to VScript as a HL2/Source 2013 mapper with no prior VScript experience.
- Known incompatibilities with Valve's VScript
- Tutorials
- Documentation
Some features from Valve's games are not available in Mapbase's implementation of VScript, although some may be available in the future.
- Most of the global functions are not yet available because many of them are game-specific and are not included in the Alien Swarm SDK.
- Notable functions which are in Mapbase's implementation:
AddThinkToEnt
EntIndexToHScript
PrecacheEntityFromTable
SpawnEntityFromTable
- Notable functions which are in Mapbase's implementation:
- Some singletons are not yet available.
- Notable singletons which are in Mapbase's implementation:
Entities
Convars
NetProps
- Notable singletons which are in Mapbase's implementation:
- In the source code, the following
IScriptVM
functions are currently unsupported:ConnectDebugger
,DisconnectDebugger
,AddSearchPath
,Frame
,DumpState
,SetOutputCallback
,SetErrorCallback
A few tutorials are available for using VScript in Mapbase.
A lot of the documentation for VScript on the VDC applies to Mapbase, but Mapbase also extends the VScript support in various ways, mostly to make it able to operate upon NPCs and other Source 2013/Half-Life 2 conventions.
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
.
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.
These are functions that can be accessed globally and without a class.
Signature | Description |
---|---|
handle SpawnEntityFromKeyValues(string className, handle *keyValues) | Spawns an entity with the keyvalues in a CScriptKeyValues handle. |
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. |
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. |
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).
Root class of all server-side entities.
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 |
Signature | Description |
---|---|
bool InputInputName() | Called when the entity receives an input from the I/O system. This already existed in L4D2, but Mapbase adds a parameter value which contains the input's parameter. |
The base class all equippable weapons derive from.
Signature | Description |
---|---|
int Clip1() | Get the weapon's current primary ammo. |
int Clip2() | Get the weapon's current secondary ammo. |
void SetClip1() | Set the weapon's current primary ammo. |
void SetClip2() | Set the weapon's current secondary ammo. |
int GetMaxClip1() | Get the weapon's maximum primary ammo. |
int GetMaxClip2() | Get the weapon's maximum secondary ammo. |
int GetDefaultClip1() | Get the weapon's default primary ammo. |
int GetDefaultClip2() | Get the weapon's default secondary ammo. |
bool HasAnyAmmo() | Check if the weapon currently has ammo or doesn't need ammo. |
bool HasPrimaryAmmo() | Check if the weapon currently has ammo or doesn't need primary ammo. |
bool HasSecondaryAmmo() | Check if the weapon currently has ammo or doesn't need secondary ammo. |
bool UsesPrimaryAmmo() | Check if the weapon uses primary ammo. |
bool UsesSecondaryAmmo() | Check if the weapon uses secondary ammo. |
void GiveDefaultAmmo() | Fill the weapon back up to default ammo. |
bool UsesClipsForAmmo1() | Check if the weapon uses clips for primary ammo. |
bool UsesClipsForAmmo2() | Check if the weapon uses clips for secondary ammo. |
int GetPrimaryAmmoType() | Get the weapon's primary ammo type. |
int GetSecondaryAmmoType() | Get the weapon's secondary ammo type. |
int GetSubType() | Get the weapon's subtype. |
void SetSubType() | Set the weapon's subtype. |
int GetFireRate() | Get the weapon's firing rate. |
string GetWorldModel() | Get the weapon's world model. |
string GetViewModel() | Get the weapon's view model. |
float GetWeight() | Get the weapon's weight. |
bool CanBePickedUpByNPCs() | Check if the weapon can be picked up by NPCs. |
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. |
The player entity.
Signature | Description |
---|---|
handle GetExpresser() | Get a handle for this player's expresser. |
The base class all NPCs derive from.
Signature | Description |
---|---|
handle GetEnemy() | Get the NPC's current enemy. |
void SetEnemy(handle target) | Set the NPC's current enemy. |
Vector GetEnemyLKP() | Get the last known position of the NPC's current enemy. |
handle FindEnemyMemory() | Get information about the NPC's current enemy. |
string GetHintGroup() | Get the name of the NPC's hint group. |
int GetNPCState() | Get the NPC's current state. |
string GetHintGroup() | Get the name of the NPC's hint group. |
handle GetHintNode() | Get the NPC's current AI hint. |
int CapabilitiesGet() | Get the capabilities the NPC currently possesses. |
void CapabilitiesAdd(int capabilities) | Add capabilities to the NPC. |
void CapabilitiesRemove(int capabilities) | Remove capabilities from the NPC. |
void CapabilitiesClear() | Clear capabilities for the NPC. |
string GetActivity() | Get the NPC's current activity. |
int GetActivityID() | Get the NPC's current activity ID. |
void SetActivity(string activity) | Set the NPC's current activity. |
void SetActivityID(int activity) | Set the NPC's current activity ID. |
void ResetActivity() | Reset the NPC's current activity. |
string GetSchedule() | Get the NPC's current schedule. |
int GetScheduleID() | Get the NPC's current schedule ID. |
void SetSchedule(string schedule) | Set the NPC's current schedule. |
void SetScheduleID(int schedule) | Set the NPC's current schedule ID. |
string GetTask() | Get the NPC's current task. |
int GetTaskID() | Get the NPC's current task ID. |
void ClearSchedule(string reason) | Clear the NPC's current schedule for the specified reason. |
bool HasCondition(int condition) | Get whether the NPC has a condition. |
bool HasConditionID(int condition) | Get whether the NPC has a condition ID. |
void SetCondition(int condition) | Set a condition on the NPC. |
void SetConditionID(int condition) | Set a condition on the NPC by ID. |
void ClearCondition(int condition) | Clear a condition on the NPC. |
void ClearConditionID(int condition) | Clear a condition on the NPC by ID. |
bool IsMoving() | Check if the NPC is moving. |
handle GetExpresser() | Get a handle for this NPC's expresser. |
bool IsCommandable() | Check if the NPC is commandable. |
bool IsInPlayerSquad() | Check if the NPC is in the player's squad. |
Signature | Description |
---|---|
variable NPC_TranslateActivity() | Translates a requested NPC activity to another activity. The requested activity is stored as a string in activity and as an integer in activity_id . Either an activity string or an activity ID can be returned. If either -1 or "ACT_INVALID" are returned, the activity will not be translated to anything different. |
variable NPC_TranslateSchedule() | Translates a requested NPC schedule to another schedule. The requested schedule is stored as a string in schedule and as an integer in schedule_id . Either a schedule name string or a schedule ID can be returned. If either -1 or "SCHED_NONE" are returned, the schedule will not be translated to anything different. |
The base class for NPCs which act in complex choreo scenes.
Signature | Description |
---|---|
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. |
Expresser class for complex speech. Typically accessed through GetExpresser()
. Not all NPCs/players have an expresser.
Signature | Description |
---|---|
bool IsSpeaking() | Check if the actor is speaking. |
bool CanSpeak() | Check if the actor can speak. |
bool BlockSpeechUntil(float time) | Block speech for a certain amount of time. This is stored in curtime. |
void ForceNotSpeaking() | If the actor is speaking, force the system to recognize them as not speaking. |
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. |
The base class for goal entities used to control NPC behavior.
Signature | Description |
---|---|
bool IsActive() | Check if the goal entity is active. |
int NumActors() | Get the number of actors using this goal entity. |
A goal entity which makes NPCs act busy.
Signature | Description |
---|---|
void ForceBusy(handle npc, handle hint, bool teleportOnly) | Force a NPC to act busy. |
void ForceBusyComplex(handle npc, handle hint, bool teleportOnly, bool useNearestBusy, float maxTime, int activity, handle seeEntity) | Force a NPC to act busy with additional parameters. |
void StopBusy() | Force a NPC to stop busying. |
The base class for four-wheel physics vehicles.
Signature | Description |
---|---|
int GetVehicleType() | Get a vehicle's type. |
handle GetPhysics() | Get a vehicle's physics. |
The base class for drive-able vehicles. (this descends from CPropVehicle
!)
Signature | Description |
---|---|
bool IsOverturned() | Check if the vehicle is overturned. |
bool IsVehicleBodyInWater() | Check if the vehicle's body is submerged in water. |
void StartEngine() | Start the engine. |
void StopEngine() | Stop the engine. |
bool IsEngineOn() | Check if the engine is on. |
handle GetDriver() | Get a vehicle's driver, which could be either a player or a npc_vehicledriver. |
All entities which could be used as filters.
Signature | Description |
---|---|
bool PassesFilter(handle caller, handle entity) | Check if the given caller and entity pass the filter. |
bool PassesDamageFilter(handle caller, handle info) | Check if the given caller and damage info pass the damage filter. |
bool PassesFinalDamageFilter(handle caller, handle info) | Used by filter_damage_redirect to distinguish between standalone filter calls and actually damaging an entity. Returns true if there's no unique behavior. |
bool BloodAllowed(handle caller, handle info) | Check if the given caller and damage info allow for the production of blood. |
bool DamageMod(handle caller, handle info) | Mods the damage info with the given caller. |
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. |
single
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 |
Global state system. Can be accessed through a global Globals
instance.
Signature | Description |
---|---|
int GetIndex(string globalName) | Gets the index of the specified global name. Returns -1 if it does not exist. |
int AddGlobal(string globalName) | Adds a new global with a specific map name and state. Returns its index. |
int GetState(string globalName) | Gets the state of the specified global. |
void SetState(string globalName, int state) | Sets the state of the specified global. |
int GetCounter(string globalName) | Gets the counter of the specified global. |
void SetCounter(string globalName, int counter) | Sets the counter of the specified global. |
void AddToCounter(string globalName, int counter) | Adds to the counter of the specified global. |
All-purpose Mapbase system primarily used for map-specific files. Can be accessed through a global Mapbase
instance.
Signature | Description |
---|---|
void AddManifestFile(string fileName) | Loads a manifest file. |
void LoadSoundscriptFile(string fileName) | Loads a custom soundscript file. |
void LoadTalkerFile(string fileName) | Loads a custom talker file. |
void LoadActbusyFile(string fileName) | Loads a custom actbusy file. |
These are classes that were already exposed to VScript, but have new features or changes included with Mapbase.
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. |
Damage information handler.
Signature | Description |
---|---|
handle GetInflictor() | Gets the inflictor. |
void SetInflictor(handle target) | Sets the inflictor. |
handle GetWeapon() | Gets the weapon. |
void SetWeapon(handle target) | Sets the weapon. |
handle GetAttacker() | Gets the attacker. |
void SetAttacker(handle target) | Sets the attacker. |
float GetDamage() | Gets the damage. |
void SetDamage(handle damage) | Sets the damage. |
float GetMaxDamage() | Gets the max damage. |
void SetMaxDamage(float damage) | Sets the max damage. |
void ScaleDamage(float scale) | Scales the damage. |
void AddDamage(float damage) | Adds to the damage. |
void SubtractDamage(float damage) | Removes from the damage. |
float GetDamageBonus() | Gets the damage bonus. |
void SetDamageBonus(float damage) | Sets the damage bonus. |
float GetBaseDamage() | Gets the base damage. |
bool BaseDamageIsValid() | Checks if the base damage is valid. |
Vector GetDamageForce() | Gets the damage force. |
void SetDamageForce(Vector force) | Sets the damage force. |
void ScaleDamageForce(float scale) | Scales the damage force. |
Vector GetDamagePosition() | Gets the damage position. |
void SetDamagePosition(Vector position) | Sets the damage position. |
Vector GetReportedPosition() | Gets the reported damage position. |
void SetReportedPosition(Vector position) | Sets the reported damage position. |
int GetDamageType() | Gets the damage type. |
void SetDamageType(int type) | Sets the damage type. |
void AddDamageType(int type) | Adds to the damage type. |
int GetDamageCustom() | Gets the damage custom. |
void SetDamageCustom(int custom) | Sets the damage custom. |
int GetDamageStats() | Gets the damage stats. |
void SetDamageStats(int stats) | Sets the damage stats. |
bool IsForceFriendlyFire() | Gets force friendly fire. |
void SetForceFriendlyFire(bool toggle) | Sets force friendly fire. |
int GetAmmoType() | Gets the ammo type. |
void SetAmmoType(int type) | Sets the ammo type. |
string GetAmmoName() | Gets the ammo type name. |
int GetPlayerPenetrationCount() | Gets the player penetration count. |
void SetPlayerPenetrationCount(int count) | Sets the player penetration count. |
bool GetDamagedOtherPlayers() | Gets whether other players have been damaged. |
void SetDamagedOtherPlayers(bool toggle) | Sets whether other players have been damaged. |
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. |
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. |
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. |
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. |
-
Something Index
- Something special
- Something else