From ab851fc58a79f2edcd6946f13506cbb1e1e6b076 Mon Sep 17 00:00:00 2001 From: treacherousfiend Date: Wed, 21 Aug 2024 18:54:54 -0600 Subject: [PATCH 1/2] Update to latest data from VDC -Added default values to some of the Script Debug variables. the ones that don't have them have a value on the VDC of "NONE" -Updated _intsize_ for x64 tf2 -Updated RAND_MAX to show that the value is different on Windows and Linux -Add new functions that have been added since the last update -Add some new input descriptions and function descriptions from the VDC. -Marked some functions that are deprecated or broken as being so, even though its not technically part of the description on the VDC -Add new Krampus custom damage type constants -Mark constants that are broken or missing -Add descriptions to some regular damage types to show what TF2 uses them for (i.e. DMC_ACID is crit damage) -Fix a couple typos in VDC descriptions --- defs.txt | 266 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 175 insertions(+), 91 deletions(-) diff --git a/defs.txt b/defs.txt index 2300801..1b14af1 100644 --- a/defs.txt +++ b/defs.txt @@ -36,19 +36,19 @@ Table of registered script hook callbacks. ScriptDebugDefaultWatchColor ScriptDebugDefaultWatchColor - +[0, 192, 0] ScriptDebugDrawTextEnabled ScriptDebugDrawTextEnabled - +true ScriptDebugDrawWatchesEnabled ScriptDebugDrawWatchesEnabled - +true ScriptDebugInDebugDraw ScriptDebugInDebugDraw - +false ScriptDebugText ScriptDebugText @@ -56,7 +56,7 @@ ScriptDebugText ScriptDebugTextIndent ScriptDebugTextIndent - +0 ScriptDebugTextFilters ScriptDebugTextFilters @@ -68,7 +68,7 @@ ScriptDebugTraces ScriptDebugTraceAllOn ScriptDebugTraceAllOn - +false ScriptDebugWatches ScriptDebugWatches @@ -84,7 +84,7 @@ _floatsize_ _intsize_ _intsize_ -4 +32-bit: 4, 64-bit: 8 _version_ _version_ @@ -96,11 +96,11 @@ _versionnumber_ RAND_MAX RAND_MAX -32767 +Windows: 32768, Linux: 2147483647 PI PI -3.14158 +3.14159 __KeyValueFromFloat bool __KeyValueFromFloat(string key, float value) @@ -118,6 +118,10 @@ __KeyValueFromVector bool __KeyValueFromVector(string key, Vector value) Behaves the same as KeyValueFromVector, use that instead. +AcceptInput +bool AcceptInput(string input, string param, handle activator, handle caller) +caller) Generate a synchronous I/O event. Unlike EntFireByHandle, this is processed immediately. Returns false if input is a null/empty string, or if the input wasn't handled. + AddEFlags void AddEFlags(int flags) Adds the supplied flags to the Entity Flags in the entity. (m_iEFlags datamap). See Constants.FEntityEFlags. @@ -163,7 +167,7 @@ void DisableDraw() Disable drawing and transmitting the entity to clients. (adds EF_NODRAW) DisconnectOutput -void DisconnectOutput(string, string) +void DisconnectOutput(string output, string function) Removes a connected script function from an I/O event. DispatchSpawn @@ -171,7 +175,7 @@ void DispatchSpawn() Alternative dispatch spawn, same as the one in CEntities, for convenience. EmitSound -void EmitSound(string) +void EmitSound(string soundname) Plays a sound from this entity. EnableDraw @@ -212,7 +216,7 @@ Get the local angular velocity - returns a vector of pitch, yaw, and roll GetBaseVelocity Vector GetBaseVelocity() -Returns any constant velocity currently being imparted onto the entity. This includes being pushed by effects like enttrigger_push and players standing on moving geometry like elevators. Should always returns a zero vector if the entity is not affected by any movement effects. +Returns any constant velocity currently being imparted onto the entity. This includes being pushed by effects like trigger_push and players standing on moving geometry like elevators. Should always returns a zero vector if the entity is not affected by any movement effects. GetBoundingMaxs Vector GetBoundingMaxs() @@ -372,7 +376,7 @@ Get the up vector of the entity GetVelocity Vector GetVelocity() - +Deprecated, use GetAbsVelocity isntead. GetWaterLevel int GetWaterLevel() @@ -459,8 +463,8 @@ void SetAbsAngles(QAngle angles) Set entity pitch, yaw, roll as QAngles SetAbsVelocity -void SetAbsVelocity(Vector) -Sets the current absolute velocity velocity of the entity +void SetAbsVelocity(Vector velocity) +Sets the current absolute velocity of the entity SetAbsOrigin void SetAbsOrigin(Vector origin) @@ -468,7 +472,7 @@ Sets the absolute origin of the entity. SetAngles void SetAngles(float pitch, float yaw, float roll) -Set entity angles. +Set entity angles. Deprecated, use SetAbsAngles instead. SetAngularVelocity void SetAngularVelocity(float pitch, float yaw, float roll) @@ -524,7 +528,7 @@ void SetMoveType(EMoveType movetype, EMoveCollide movecollide) SetOrigin void SetOrigin(Vector origin) - +Deprecated, use SetAbsOrigin instead. SetOwner void SetOwner(handle entity) @@ -556,7 +560,7 @@ Sets entity team. SetVelocity void SetVelocity(Vector velocity) - +Deprecated, use SetAbsVelocity instead. SetWaterLevel SetWaterLevel(int water_level) @@ -571,15 +575,15 @@ void StopSound(string sound_name) Stops a sound on this entity. TakeDamage -void TakeDamage(float flDamage, int nDamageType, handle hAttacker) +void TakeDamage(float flDamage, Constants.FDmgType nDamageType, handle hAttacker) Deals damage to the entity. TakeDamageEx -void TakeDamageEx(handle hInflictor, handle hAttacker, handle hWeapon, Vector vecDamageForce, Vector vecDamagePosition, float flDamage, int nDamageType) +void TakeDamageEx(handle hInflictor, handle hAttacker, handle hWeapon, Vector vecDamageForce, Vector vecDamagePosition, float flDamage, Constants.FDmgType nDamageType) Extended version of TakeDamage. TakeDamageCustom -void TakeDamageCustom(handle hInflictor, handle hAttacker, handle hWeapon, Vector vecDamageForce, Vector vecDamagePosition, float flDamage, int nDamageType, Constants.ETFDmgCustom nCustomDamageType) +void TakeDamageCustom(handle hInflictor, handle hAttacker, handle hWeapon, Vector vecDamageForce, Vector vecDamagePosition, float flDamage, Constants.FDmgType nDamageType, Constants.ETFDmgCustom nCustomDamageType) Extended version of TakeDamageEx that can apply a custom damage type. Teleport @@ -596,7 +600,7 @@ ToggleFlag(int flags) ValidateScriptScope bool ValidateScriptScope() -Ensure that an entity's script scope has been created +Ensure that an entity's script scope has been created. In practice, this always returns true unless the script VM is disabled in launch options. Input bool Input() @@ -606,21 +610,25 @@ OnGameEvent_ void OnGameEvent_(table params) Called each time a game event with the specified name occurs. The name of the function needs to be OnGameEvent_ followed by the name of the game event. E.g. for the player_spawn input, it would be OnGameEvent_player_spawn. -OnPostSpawn -void OnPostSpawn() -Called after the entity spawns, which is after scripts and players have loaded. This could be used to have an entity register itself with a master script, or adjusting the entity parameters in a programmatic way. - Precache void Precache() Called after the script executes. Can be used to call precache functions for models and sounds on map load. +ConnectOutputs +void ConnectOutputs(handle scope) +Global function called after an entity with an script assigned spawns (i.e. vscripts keyvalue is not blank). Unlike OnPostSpawn, this is called immediately and therefore on map respawn, some entities may not exist during this point. + +OnPostSpawn +void OnPostSpawn() +Called after the entity spawns, which is after scripts and players have loaded. This could be used to have an entity register itself with a master script, or adjusting the entity parameters in a programmatic way. + OnTakeDamage void OnTakeDamage(handle params) Called each time an entity takes damage. The script can modify the table entries not suffixed with const, and these will be sent back to the game code DispatchAnimEvents void DispatchAnimEvents(handle entity) -Dispatch animation events to a CBaseAnimating +Dispatch animation events to a CBaseAnimating entity. FindBodygroupByName int FindBodygroupByName(string name) @@ -684,7 +692,7 @@ Get a sequence duration in seconds by sequence ID. GetSequenceName string GetSequenceName(int ID) -Get a sequence name by sequence ID. +Get a sequence name by sequence ID. Returns "Not Found!" if ID is -1, "Unknown" if the sequence doesn't exist or "No model!" if no model is assigned. GetSkin int GetSkin() @@ -792,7 +800,7 @@ Max size of clip2 GetName string GetName() -Gets the weapon's name +Gets the weapon's internal name (not the targetname!) GetPosition int GetPosition() @@ -954,13 +962,17 @@ AddAttribute void AddAttribute(string name, float value, float duration) Add an attribute to the entity. Set duration to -1 for the attribute to be applied forever. +GetAttribute +float GetAttribute(string name, float default_value) +Get an attribute float from the entity. If the attribute does not exist, returns default_value. + RemoveAttribute void RemoveAttribute(string name) -Remove an attribute to the entity +Remove an attribute to the entity. ReapplyProvision void ReapplyProvision() -Relinks attributes to provisioners, e.g. calling this on a weapon will add it's attributes to the player +Relinks attributes to provisioners, e.g. calling this on a weapon will add it's attributes to the player. AddCond void AddCond(ETFCond cond) @@ -972,7 +984,7 @@ void AddCondEx(ETFCond cond, float duration, handle provider) AddCurrency void AddCurrency(int amount) -Kaching! Give the player some cash for game modes with upgrades, ie. MvM +Kaching! Give the player some cash for game modes with upgrades, ie. MvM. The new value is bounded between 0-30000. AddCustomAttribute void AddCustomAttribute(string name, float value, float duration) @@ -1040,7 +1052,7 @@ Can the player move? DoTauntAttack void DoAttackTaunt() -Performs taunts attacks if available. Player must be already taunting and taunt must have a valid attack assigned (taunt attack name attribute) +Performs taunts attacks if available. Player must be already taunting and taunt must have a valid attack assigned ("taunt attack name" attribute) DropFlag void DropFlag(bool silent) @@ -1156,7 +1168,7 @@ Who is the medic healing? GetHudHideFlags int GetHudHideFlags() - +Gets current hidden hud elements GetInvulns int GetInvulns() @@ -1167,7 +1179,7 @@ int GetKillAssists() GetLastWeapon -GetLastWeapon() +handle GetLastWeapon() GetNextChangeClassTime @@ -1234,9 +1246,13 @@ HasItem bool HasItem() Currently holding an item? Eg. capture flag +HandleTauntCommand +void HandleTauntCommand(int taunt_slot) +Spootfs a taunt command from the player, as if they selected this taunt. + IgnitePlayer void IgnitePlayer() - +Supposed to set the player on fire, but... does nothing except play on-fire sound and voicelines. InAirDueToExplosion bool InAirDueToExplosion() @@ -1264,7 +1280,7 @@ bool IsAllowedToTaunt() IsBotOfType bool IsBotOfType(int type) - +Returns true if the player matches this bot type. Only one type of bot exists which is reserved for AI bots (not puppet bots): TF_BOT_TYPE. 0 is used for real players or puppet bots. Use IsFakeClient to check for a puppet bot instead. IsCallingForMedic bool IsCallingForMedic() @@ -1284,7 +1300,7 @@ bool IsCritBoosted() IsFakeClient bool IsFakeClient() - +Returns true if the player is a puppet or AI bot. To check if the player is a AI bot (CTFBot) specifically, use IsBotOfType instead. IsFireproof bool IsFireproof() @@ -1364,7 +1380,7 @@ Resupplies a player. If regen health/ammo is set, clears negative conds, gives b RemoveAllItems void RemoveAllItems(bool unused) - +This does not actually remove all items. It only drops the passtime ball, intelligence, disables radius healing, and hides the Spy invis watch. RemoveAllObjects void RemoveAllObjects(bool explode) @@ -1372,15 +1388,15 @@ Remove all player objects. Eg. dispensers/sentries. RemoveCond void RemoveCond(ETFCond cond) - +Removes a condition. Does not remove a condition if the minimum duration has not passed. Does nothing if the condition isn't added (interally does InCond check). RemoveCondEx void RemoveCondEx(ETFCond cond, bool ignoreDuration) - +Extended version of RemoveCond. Allows forcefully removing the condition even if minimum duration is not met. RemoveCurrency void RemoveCurrency(int amount) -Take away money from a player for reasons such as ie. spending. +Take away money from a player for reasons such as ie. spending. Lower bounded to 0. RemoveCustomAttribute void RemoveCustomAttribute(string name) @@ -1416,7 +1432,7 @@ void SetCondDuration(ETFCond cond, float duration) SetCurrency void SetCurrency(int amount) -Set player's cash for game modes with upgrades, ie. MvM +Set player's cash for game modes with upgrades, ie. MvM. Does not have any bounds checking. SetCurrentTauntMoveSpeed void SetCurrentTauntMoveSpeed(float speed) @@ -1424,7 +1440,7 @@ void SetCurrentTauntMoveSpeed(float speed) SetCustomModel void SetCustomModel(string model_name) - +Sets a custom player model without animations (model will T-pose). To enable animations, use SetCustomModelWithClassAnimations instead. SetCustomModelOffset void SetCustomModelOffset(Vector offset) @@ -1444,7 +1460,7 @@ void SetCustomModelVisibleToSelf(bool toggle) SetCustomModelWithClassAnimations void SetCustomModelWithClassAnimations(string model_name) - +Sets a custom player model with full animations. SetDisguiseAmmoCount void SetDisguiseAmmoCount(int count) @@ -1510,6 +1526,10 @@ StopTaunt void StopTaunt(bool remove_prop) Stops current taunt. If remove_prop is true, the taunt prop will be immediately deleted instead of potentially delaying +StunPlayer +void StunPlayer(float duration, float move_speed_reduction, int flags, handle attacker) +Stuns the player for a specified duration. Move speed reduction is a fraction (0 = no reduction. 1 = total reduction, no movement). Flag combinations control the stun type and behavior, see the constants page. + Taunt void Taunt(int taunt_index, int taunt_concept) Performs a taunt if allowed. For taunt index, see Constants.FTaunts. For concepts, see MP_CONCEPT List. Concept is the "voiceline" index to use with the taunt. For TAUNT_SHOW_ITEM and TAUNT_BASE_WEAPON this is set automatically. TAUNT_LONG is not supported. @@ -1540,7 +1560,7 @@ Does nothing! Weapon_Equip void Weapon_Equip(handle weapon) - +Equips a weapon in the player. This places it inside the m_hMyWeapons array. Weapon_SetLast void Weapon_SetLast(handle weapon) @@ -1552,7 +1572,7 @@ vector Weapon_ShootPosition() Weapon_Switch void Weapon_Switch(handle weapon) - +Attempts a switch to the given weapon, if present in the player's inventory (m_hMyWeapons array). AddBotAttribute void AddBotAttribute(int attribute) @@ -1582,6 +1602,10 @@ ClearAttentionFocus void ClearAttentionFocus() Clear current focus +ClearBehaviorFlag +void ClearBehaviorFlag(int flags) +clear the given behavior flag(s) for this bot. Does not work. + DelayedThreatNotice void DelayedThreatNotice(handle threat, float delay) Notice the threat after a delay in seconds @@ -1598,6 +1622,14 @@ GenerateAndWearItem void GenerateAndWearItem(string item_name) Give me an item! +GetActionPoint +handle GetActionPoint() +Get the given action point for this bot + +GetAllBotTags +void GetAllBotTags(handle table) +Get all bot tags. The key is the index, and the value is the tag + GetHomeArea handle GetHomeArea() Gets the home nav area of the bot @@ -1610,10 +1642,22 @@ GetMaxVisionRangeOverride float GetMaxVisionRangeOverride() Gets the max vision range override for the bot +GetMission +int GetMission() +Get this bot's current mission. Does not work. + +GetMissionTarget +handle GetMissionTarget() +Get this bot's current mission target + GetNearestKnownSappableTarget handle GetNearestKnownSappableTarget() Gets the nearest known sappable target +GetPrevMission +int GetPrevMission() +Get's this bot's previous mission. Does not work. + GetSpawnArea handle GetSpawnArea() Return the nav area of where we spawned @@ -1630,6 +1674,10 @@ HasBotTag bool HasBotTag(string tag) Checks if this TFBot has the given bot tag +HasMission +bool HasMission(int mission) +Return true if the given mission is this bot's current mission. Does not work. + HasWeaponRestriction bool HasWeaponRestriction(int flags) Checks if this TFBot has the given weapon restriction flags @@ -1650,6 +1698,10 @@ IsAttentionFocusedOn bool IsAttentionFocusedOn(handle entity) Is our attention focused on this entity +IsBehaviorFlagSet +bool IsBehaviorFlagSet(int flags) +Return true if the given behavior flag(s) are set for this bot. Does not work. + IsDifficulty bool IsDifficulty(int difficulty) Returns true/false if the bot's difficulty level matches. @@ -1658,6 +1710,10 @@ IsInASquad bool IsInASquad() Checks if we are in a squad +IsOnAnyMission() +bool IsOnAnyMission() +Return true if this bot has a current mission + IsWeaponRestricted bool IsWeaponRestricted(handle weapon) Checks if the given weapon is restricted for use on the bot @@ -1690,6 +1746,10 @@ RemoveWeaponRestriction void RemoveWeaponRestriction(int flags) Removes weapon restriction flags +SetActionPoint +void SetActionPoint(handle entity) +Set the given action point for this bot + SetAttentionFocus void SetAttentionFocus(handle entity) Sets our current attention focus to this entity @@ -1698,6 +1758,10 @@ SetAutoJump void SetAutoJump(float minTime, float maxTime) Sets if the bot should automatically jump +SetBehaviorFlag +void SetBehaviorFlag(int flags) +Set the given behavior flag(s) for this bot. Does not work. + SetDifficulty void SetDifficulty(int difficulty) Sets the bots difficulty level @@ -1710,6 +1774,18 @@ SetMaxVisionRangeOverride void SetMaxVisionRangeOverride(float range) Sets max vision range override for the bot +SetMission +void SetMission(int mission, bool reset_behavior) +Set this bot's current mission to the given mission. Does not work. + +SetMissionTarget +void SetMissionTarget(handle entity) +Set the bot's mission target to this given entity + +SetPrevMission +void SetPrevMission(int mission) +Set this bot's previous mission to the given mission. Does not work. + SetScaleOverride void SetScaleOverride(float scale) Sets the scale override for the bot @@ -1760,7 +1836,7 @@ Checks if the convar is allowed to be used and is in cfg/vscript_convar_allowlis SetValue void SetValue(string name, value) -Sets the value of the convar. The convar must be in cfg/vscript_convar_allowlist.txt to be set. Convars marked as cheat-only can be set even if sv_cheats is off. Supported types are bool, int, float, string. +Sets the value of the convar. The convar must be in cfg/vscript_convar_allowlist.txt to be set. Convars marked as cheat-only can be set even if sv_cheats is off. Convars marked as dev-only (i.e. not visible in console) can also be set. Supported types are bool, int, float, string. The original value of the convar is saved and is reset on map change, in other words convar changes will not persist across maps. CreateByClassname handle CreateByClassname(string classname) @@ -1815,7 +1891,7 @@ handle Next(handle previous) At the given reference of a previously-found entity, returns the next one after it in the list. AddIncomingConnection -void AddIncomingConnection(handle area, int dir) +void AddIncomingConnection(handle area, ENavDirType dir) Add areas that connect TO this area by a ONE-WAY link ClearAttributeTF @@ -1831,7 +1907,7 @@ int ComputeDirection(Vector point) Return direction from this area to the given point. ConnectTo -void ConnectTo(handle area, int dir) +void ConnectTo(handle area, ENavDirType dir) Connect this area to given area in given direction. Contains @@ -1855,15 +1931,15 @@ Vector FindRandomSpot() Get random origin within extent of area. GetAdjacentArea -handle GetAdjacentArea(int dir, int n) +handle GetAdjacentArea(ENavDirType dir, int n) Return the n'th adjacent area in the given direction. GetAdjacentAreas -void GetAdjacentAreas(int dir, handle table) +void GetAdjacentAreas(ENavDirType dir, handle table) Fills a passed in table with all adjacent areas in the given direction. GetAdjacentCount -int GetAdjacentCount(int dir) +int GetAdjacentCount(ENavDirType dir) Get the number of adjacent areas in the given direction. GetAttributes @@ -1903,7 +1979,7 @@ int GetID() Get area ID. GetIncomingConnections -void GetIncomingConnections(int dir, handle table) +void GetIncomingConnections(ENavDirType dir, handle table) Fills a passed in table with areas connected TO this area by a ONE-WAY link (ie: we have no connection back to them). GetParent @@ -1923,7 +1999,7 @@ int GetPlayerCount(int team) Return number of players of given team currently within this area (team of zero means any/all). GetRandomAdjacentArea -handle GetRandomAdjacentArea(int dir) +handle GetRandomAdjacentArea(ENavDirType dir) Return a random adjacent area in the given direction. GetSizeX @@ -1967,7 +2043,7 @@ bool IsCompletelyVisibleToTeam(int team) Return true if given area is completely visible from somewhere in this area by someone on the team. IsConnected -bool IsConnected(handle area, int dir) +bool IsConnected(handle area, ENavDirType dir) Return true if this area is connected to other area in given direction. (If you set direction to -1 or 4, it will automatically check all directions for a connection). IsCoplanar @@ -2343,12 +2419,12 @@ Vector GetFuturePosition(float x, float speed) Get a position on the track X seconds in the future. AddTemplate -void AddTemplate(string, table) -Add an entity to the template spawner +void AddTemplate(string classname, table keyvalues) +Add an entity with the given keyvalues to the template spawner, similar to SpawnEntityFromTable. The number of templates allowed is unlimited. SetGroupSpawnTables -void SetGroupSpawnTables(table) -Cache the group spawn tables +void SetGroupSpawnTables(table group, table spawn) +Unused. This only stores a reference to the two tables which is removed when the point_script_template is deleted. AddBroadcastTeamTarget void AddBroadcastTeamTarget(int index) @@ -2640,7 +2716,7 @@ Return true if the entity handle is traversable. If immediately is true, breakab IsGap bool IsGap(Vector pos, Vector forward) -Return true if there is a gap at this position. +Return true if there is a gap at this position. forward is unused. IsJumpingAcrossGap bool IsJumpingAcrossGap() @@ -2672,7 +2748,7 @@ Initiate a simple undirected jump in the air JumpAcrossGap void JumpAcrossGap(Vector goalPos, Vector goalForward) -Initiate a jump across an empty volume of space to far side +Initiate a jump across an empty volume of space to far side. goalForward is unused. OnLandOnGround void OnLandOnGround(handle ground) @@ -2916,7 +2992,7 @@ Returns the angles resulting from the rotation. AddThinkToEnt void AddThinkToEnt(handle entity, string FuncName) -Sets a function in the entity's script to rerun by itself constantly. Pass null as the function name to remove a think function. The default think interval is 0.1s, unless overridden by returning a different time interval in seconds in the think function +Sets a function in the entity's script to rerun by itself constantly. Pass null as the function name to remove a think function. The default think interval is 0.1s, unless overridden by returning a different time interval in seconds in the think function. TF2 runs at 66 ticks per second, so the lowest possible interval is 0.015 seconds. Set to -1 to think every tick. AddToScriptHelp AddToScriptHelp() @@ -2952,7 +3028,7 @@ The current level of the developer console variable. DispatchParticleEffect void DispatchParticleEffect(string name, Vector origin, Vector angles) -Dispatches a one-off particle system +Dispatches a one-off particle system. To pass angles into this, use the .Forward() method on a QAngle. Document void Document(unknown symbolOrTable, unknown itemIfSymbol = null, string descriptionIfSymbol = null) @@ -2996,11 +3072,11 @@ Play named sound only on the client for the specified player. NOTE: This only su EntFire void EntFire(string target, string action, string value = null, float delay = 0, handle activator = null) -Wrapper for DoEntFire() that setsactivator to null, but has no caller param. +Wrapper for DoEntFire() that setsactivator to null, but has nocallerparam. Negative delays are clamped to 0. EntFireByHandle void EntFireByHandle(handle entity, string action, string value, float delay, handle activator, handle caller) -Generate and entity i/o event. First parameter is an entity instance. +Generate an entity I/O event. First parameter is an entity instance. Negative delays are clamped to 0. EntIndexToHScript handle EntIndexToHScript(int entIndex) @@ -3044,7 +3120,7 @@ May a flag be captured? FrameTime float FrameTime() -Get the time spent on the server in the last frame +Get the time spent on the server in the last frame. Usually this will be 0.015 (the default tickrate) GameModeUsesCurrency bool GameModeUsesCurrency() @@ -3084,7 +3160,7 @@ float GetGravityMultiplier() GetListenServerHost handle GetListenServerHost() -Get the local player on a listen server. +Get the local player on a listen server. Returns null on dedicated servers. GetMannVsMachineAlarmStatus bool GetMannVsMachineAlarmStatus() @@ -3216,7 +3292,7 @@ No ball games. IsPlayerABot bool IsPlayerABot(handle player) -Is this player/entity a bot. +Is this player/entity a puppet or AI bot. To check if the player is a AI bot (CTFBot) specifically, use IsBotOfType instead. IsPowerupMode bool IsPowerupMode() @@ -3248,7 +3324,7 @@ bool IsWeakref() LocalTime void LocalTime(table out) -Fills out a table with the local time (second, minute, hour, day, month, year, dayofweek, dayofyear, daylightsavings) +Fills out a table with the local time (second, minute, hour, day, month, year, dayofweek, dayofyear, daylightsavings). This mirrors the tm structure in C++ MakeNamespace void MakeNamespace() @@ -3268,7 +3344,7 @@ Get the current number of max clients set by the maxplayers command. PickupObject void PickupObject(handle player, handle entity) -Object from world is put into the "Held" slot of the player. Warning: it will smoothly interpolate from where it is to the players hand - which is a bit goofy if it is on other side of level. +Object from world is put into the "Held" slot of the player. Warning: it will smoothly interpolate from where it is to the players hand - which is a bit goofy if it is on other side of level. Does nothing in Team Fortress 2 as the code is not implemented PlayerInstanceFromIndex CBasePlayer PlayerInstanceFromIndex(int index) @@ -3296,19 +3372,19 @@ Are points able to be captured? PrecacheEntityFromTable bool PrecacheEntityFromTable(table keyvalues) -Precache an entity from KeyValues in a table. Internally this function creates the entity, fire DispatchSpawn and removes it instantly. +Precache an entity from KeyValues in a table. Internally this function creates the entity, fire DispatchSpawn and removes it instantly. Returns false if the table has no classname key, if the value of classname is null or empty, or if the entity failed to be created. PrecacheModel int PrecacheModel(string filename) -Precache a model and return index of the model. +Precache a model and return index of the model. Returns -1 if null or empty filename is passed in. Missing models will still return a new index. PrecacheScriptSound bool PrecacheScriptSound(string soundName) -Preache a soundscript. +Preache a soundscript. Returns false if soundscript is missing, or if a null or empty sound name is passed in. PrecacheSound void PrecacheSound(string soundName) -Precache a raw sound. +Precache a raw sound. Returns false if a null or empty sound name is passed in. PrintHelp PrintHelp() @@ -3348,11 +3424,11 @@ Rotate the input Vector around an origin. ScreenFade void ScreenFade(handle player, int red, int green, int blue, int alpha, float fadeTime, float fadeHold, int flags) -Start a customisable screenfade. If no player is specified, the fade will apply to all players. +Start a customisable screenfade. If no player is specified, the fade will apply to all players. For a list of flags, see FFADE constants. ScreenShake void ScreenShake(Vector vecCenter, float flAmplitude, float flFrequency, float flDuration, float flRadius, int eCommand, bool bAirShake) -Start a customisable screenshake; eCommand( SHAKE_START = 0, SHAKE_STOP = 1 ). +Start a customisable screenshake. Set eCommand to 0 to start a shake, or 1 to stop an existing shake. ScriptHooksEnabled bool ScriptHooksEnabled() @@ -3416,7 +3492,7 @@ Stores a string as a file, located in the game's scriptdata folder. Time float Time() -Get the current server time +Get the current server time in seconds TraceLine float TraceLine(Vector start, Vector end, handle ignore) @@ -3503,7 +3579,7 @@ void DebugDrawClear() Try to clear all the debug overlay info. DebugDrawLine -void DebugDrawLine(Vector start, Vector end, int red, int green, int blue', bool zTest, float time) +void DebugDrawLine(Vector start, Vector end, int red, int green, int blue, bool zTest, float time) Draw a debug overlay line. DebugDrawLine_vCol @@ -3548,7 +3624,7 @@ Calling this will have the specified player send the message to chat, either to ShowMessage void ShowMessage(string message) -Print a hud message on all clients +Print a hud message on all clients. Non-functional. array array(int length, any fill = null) @@ -3719,7 +3795,7 @@ atan(num x) Returns tan^-1(x) atan2 -atan2(num y, num x) (!) +atan2(num y, num x) Returns the angle between the ray from the point (0, 0) through (x, y) and the positive x-axis, confined to (-PI, PI). Note the order of the parameters x and y! ceil @@ -3756,7 +3832,7 @@ Returns x^y rand rand() -Returns a random integer with 0 <= rand() <= RAND_MAX +Returns a random integer with 0 <= rand() <= RAND_MAX. The value of RAND_MAX is 32768 on Windows, but 2147483647 on Linux. This can cause undeterministic behavior between a server running on Windows vs Linux. Instead, use RandomInt or RandomFloat. sin sin(num x) @@ -4532,11 +4608,11 @@ GR_STATE_GAME_OVER GR_STATE_BONUS GR_STATE_BONUS -9 +9, This constant entry is missing! GR_STATE_BETWEEN_RNDS GR_STATE_BETWEEN_RNDS -10 +10, This constant entry is missing! GR_NUM_ROUND_STATES GR_NUM_ROUND_STATES @@ -5590,13 +5666,21 @@ TF_DMG_CUSTOM_AXTINGUISHER_BOOSTED TF_DMG_CUSTOM_AXTINGUISHER_BOOSTED 83 +TF_DMG_CUSTOM_KRAMPUS_MELEE +TF_DMG_CUSTOM_KRAMPUS_MELEE +84 + +TF_DMG_CUSTOM_KRAMPUS_RANGED +TF_DMG_CUSTOM_KRAMPUS_RANGED +85 + TF_DMG_CUSTOM_END TF_DMG_CUSTOM_END -84 +86 TEAM_UNASSIGNED TEAM_UNASSIGNED -0 +null, This is supposed to be 0. TEAM_SPECTATOR TEAM_SPECTATOR @@ -5928,7 +6012,7 @@ CONTENTS_HITBOX DMG_GENERIC DMG_GENERIC -0 +null, This is supposed to be 0. DMG_CRUSH DMG_CRUSH @@ -5948,7 +6032,7 @@ DMG_BURN DMG_VEHICLE DMG_VEHICLE -16 +16, Train damage. DMG_FALL DMG_FALL @@ -5996,7 +6080,7 @@ DMG_PARALYZE DMG_NERVEGAS DMG_NERVEGAS -65536 +65536, Sawblade damage. DMG_POISON DMG_POISON @@ -6012,11 +6096,11 @@ DMG_DROWNRECOVER DMG_ACID DMG_ACID -1048576 +1048576, Crit damage. DMG_SLOWBURN DMG_SLOWBURN -2097152 +2097152, Bullet falloff damage. DMG_REMOVENORAGDOLL DMG_REMOVENORAGDOLL From 82be26b2f1a180b914ca8cc3ba6a35a541140ab6 Mon Sep 17 00:00:00 2001 From: treacherousfiend Date: Wed, 21 Aug 2024 19:34:01 -0600 Subject: [PATCH 2/2] Update the actual snippets -Updated the actual vscode and sublime snippets -Also updated gameevents with new TF2 events and new events brought over from HL2 --- addendum/gameevents.json | 77 ++++++ squirrel.json | 444 +++++++++++++++++++++++-------- tf2-snippets.sublime-completions | 432 ++++++++++++++++++++++-------- 3 files changed, 739 insertions(+), 214 deletions(-) diff --git a/addendum/gameevents.json b/addendum/gameevents.json index 2f5d4dd..abc1a88 100644 --- a/addendum/gameevents.json +++ b/addendum/gameevents.json @@ -34,6 +34,13 @@ ], "description": "" }, + "void OnGameEvent_ammo_pickup()": { + "prefix": "OnGameEvent_ammo_pickup", + "body": [ + "OnGameEvent_ammo_pickup(${1:params}){\r\n\t$0\n}" + ], + "description": "" + }, "void OnGameEvent_arena_match_maxstreak()": { "prefix": "OnGameEvent_arena_match_maxstreak", "body": [ @@ -363,6 +370,13 @@ ], "description": "" }, + "void OnGameEvent_enter_vehicle()": { + "prefix": "OnGameEvent_enter_vehicle", + "body": [ + "OnGameEvent_enter_vehicle(${1:params}){\r\n\t$0\n}" + ], + "description": "" + }, "void OnGameEvent_entered_performance_mode()": { "prefix": "OnGameEvent_entered_performance_mode", "body": [ @@ -545,6 +559,13 @@ ], "description": "" }, + "void OnGameEvent_gameui_activate()": { + "prefix": "OnGameEvent_gameui_activate", + "body": [ + "OnGameEvent_gameui_activate(${1:params}){\r\n\t$0\n}" + ], + "description": "" + }, "void OnGameEvent_gameui_activated()": { "prefix": "OnGameEvent_gameui_activated", "body": [ @@ -552,6 +573,13 @@ ], "description": "" }, + "void OnGameEvent_gameui_hide()": { + "prefix": "OnGameEvent_gameui_hide", + "body": [ + "OnGameEvent_gameui_hide(${1:params}){\r\n\t$0\n}" + ], + "description": "" + }, "void OnGameEvent_gameui_hidden()": { "prefix": "OnGameEvent_gameui_hidden", "body": [ @@ -713,6 +741,13 @@ ], "description": "" }, + "void OnGameEvent_killed_ball_carrier()": { + "prefix": "OnGameEvent_killed_ball_carrier", + "body": [ + "OnGameEvent_killed_ball_carrier(${1:params}){\r\n\t$0\n}" + ], + "description": "" + }, "void OnGameEvent_killed_capping_player()": { "prefix": "OnGameEvent_killed_capping_player", "body": [ @@ -727,6 +762,13 @@ ], "description": "" }, + "void OnGameEvent_leave_vehicle()": { + "prefix": "OnGameEvent_leave_vehicle", + "body": [ + "OnGameEvent_leave_vehicle(${1:params}){\r\n\t$0\n}" + ], + "description": "" + }, "void OnGameEvent_lobby_updated()": { "prefix": "OnGameEvent_lobby_updated", "body": [ @@ -741,6 +783,13 @@ ], "description": "" }, + "void OnGameEvent_localplayer_builtobject()": { + "prefix": "OnGameEvent_localplayer_builtobject", + "body": [ + "OnGameEvent_localplayer_builtobject(${1:params}){\r\n\t$0\n}" + ], + "description": "" + }, "void OnGameEvent_localplayer_changeclass()": { "prefix": "OnGameEvent_localplayer_changeclass", "body": [ @@ -2162,6 +2211,13 @@ ], "description": "" }, + "void OnGameEvent_single_player_death()": { + "prefix": "OnGameEvent_single_player_death", + "body": [ + "OnGameEvent_single_player_death(${1:params}){\r\n\t$0\n}" + ], + "description": "" + }, "void OnGameEvent_slap_notice()": { "prefix": "OnGameEvent_slap_notice", "body": [ @@ -2232,6 +2288,20 @@ ], "description": "" }, + "void OnGameEvent_take_armor()": { + "prefix": "OnGameEvent_take_armor", + "body": [ + "OnGameEvent_take_armor(${1:params}){\r\n\t$0\n}" + ], + "description": "" + }, + "void OnGameEvent_take_health()": { + "prefix": "OnGameEvent_take_health", + "body": [ + "OnGameEvent_take_health(${1:params}){\r\n\t$0\n}" + ], + "description": "" + }, "void OnGameEvent_team_info()": { "prefix": "OnGameEvent_team_info", "body": [ @@ -2624,6 +2694,13 @@ ], "description": "" }, + "void OnGameEvent_weapon_equipped()": { + "prefix": "OnGameEvent_weapon_equipped", + "body": [ + "OnGameEvent_weapon_equipped(${1:params}){\r\n\t$0\n}" + ], + "description": "" + }, "void OnGameEvent_winlimit_changed()": { "prefix": "OnGameEvent_winlimit_changed", "body": [ diff --git a/squirrel.json b/squirrel.json index 79f372a..e0345b3 100644 --- a/squirrel.json +++ b/squirrel.json @@ -41,6 +41,13 @@ ], "description": "262144" }, + "bool AcceptInput(string input, string param, handle activator, handle caller)": { + "prefix": "AcceptInput", + "body": [ + "AcceptInput(${1:string input}, ${2:string param}, ${3:handle activator}, ${4:handle caller})$0" + ], + "description": "caller) \tGenerate a synchronous I/O event. Unlike EntFireByHandle, this is processed immediately. Returns false if input is a null/empty string, or if the input wasn't handled." + }, "void AddAttribute(string name, float value, float duration)": { "prefix": "AddAttribute", "body": [ @@ -88,7 +95,7 @@ "body": [ "AddCurrency(${1:int amount})$0" ], - "description": "Kaching! Give the player some cash for game modes with upgrades, ie. MvM" + "description": "Kaching! Give the player some cash for game modes with upgrades, ie. MvM. The new value is bounded between 0-30000." }, "void AddCustomAttribute(string name, float value, float duration)": { "prefix": "AddCustomAttribute", @@ -118,10 +125,10 @@ ], "description": "Hides a hud element based on Constants.FHideHUD" }, - "void AddIncomingConnection(handle area, int dir)": { + "void AddIncomingConnection(handle area, ENavDirType dir)": { "prefix": "AddIncomingConnection", "body": [ - "AddIncomingConnection(${1:handle area}, ${2:int dir})$0" + "AddIncomingConnection(${1:handle area}, ${2:ENavDirType dir})$0" ], "description": "Add areas that connect TO this area by a ONE-WAY link" }, @@ -139,19 +146,19 @@ ], "description": "Adds the supplied flags to the Solid Flags in the entity. (m_Collision.m_usSolidFlags datamap). See Constants.FSolid." }, - "void AddTemplate(string, table)": { + "void AddTemplate(string classname, table keyvalues)": { "prefix": "AddTemplate", "body": [ - "AddTemplate(${1:string}, ${2:table})$0" + "AddTemplate(${1:string classname}, ${2:table keyvalues})$0" ], - "description": "Add an entity to the template spawner" + "description": "Add an entity with the given keyvalues to the template spawner, similar to SpawnEntityFromTable. The number of templates allowed is unlimited." }, "void AddThinkToEnt(handle entity, string FuncName)": { "prefix": "AddThinkToEnt", "body": [ "AddThinkToEnt(${1:handle entity}, ${2:string FuncName})$0" ], - "description": "Sets a function in the entity's script to rerun by itself constantly. Pass null as the function name to remove a think function. The default think interval is 0.1s, unless overridden by returning a different time interval in seconds in the think function" + "description": "Sets a function in the entity's script to rerun by itself constantly. Pass null as the function name to remove a think function. The default think interval is 0.1s, unless overridden by returning a different time interval in seconds in the think function. TF2 runs at 66 ticks per second, so the lowest possible interval is 0.015 seconds. Set to -1 to think every tick." }, "AddToScriptHelp()": { "prefix": "AddToScriptHelp", @@ -783,6 +790,13 @@ ], "description": "Clear TF-specific area attribute bits." }, + "void ClearBehaviorFlag(int flags)": { + "prefix": "ClearBehaviorFlag", + "body": [ + "ClearBehaviorFlag(${1:int flags})$0" + ], + "description": "clear the given behavior flag(s) for this bot. Does not work." + }, "void ClearCustomModelRotation()": { "prefix": "ClearCustomModelRotation", "body": [ @@ -895,10 +909,17 @@ ], "description": "Adds an I/O connection that will call the named function when the specified output fires." }, - "void ConnectTo(handle area, int dir)": { + "void ConnectOutputs(handle scope)": { + "prefix": "ConnectOutputs", + "body": [ + "ConnectOutputs(${1:handle scope})$0" + ], + "description": "Global function called after an entity with an script assigned spawns (i.e. vscripts keyvalue is not blank). Unlike OnPostSpawn, this is called immediately and therefore on map respawn, some entities may not exist during this point." + }, + "void ConnectTo(handle area, ENavDirType dir)": { "prefix": "ConnectTo", "body": [ - "ConnectTo(${1:handle area}, ${2:int dir})$0" + "ConnectTo(${1:handle area}, ${2:ENavDirType dir})$0" ], "description": "Connect this area to given area in given direction." }, @@ -977,7 +998,7 @@ "body": [ "DMG_ACID$0" ], - "description": "1048576" + "description": "1048576, Crit damage." }, "DMG_AIRBOAT": { "prefix": "DMG_AIRBOAT", @@ -1089,14 +1110,14 @@ "body": [ "DMG_GENERIC$0" ], - "description": "0" + "description": "null, This is supposed to be 0." }, "DMG_NERVEGAS": { "prefix": "DMG_NERVEGAS", "body": [ "DMG_NERVEGAS$0" ], - "description": "65536" + "description": "65536, Sawblade damage." }, "DMG_NEVERGIB": { "prefix": "DMG_NEVERGIB", @@ -1173,7 +1194,7 @@ "body": [ "DMG_SLOWBURN$0" ], - "description": "2097152" + "description": "2097152, Bullet falloff damage." }, "DMG_SONIC": { "prefix": "DMG_SONIC", @@ -1187,7 +1208,7 @@ "body": [ "DMG_VEHICLE$0" ], - "description": "16" + "description": "16, Train damage." }, "DOWN": { "prefix": "DOWN", @@ -1238,10 +1259,10 @@ ], "description": "Draw area as a filled rect of the given color." }, - "void DebugDrawLine(Vector start, Vector end, int red, int green, int blue', bool zTest, float time)": { + "void DebugDrawLine(Vector start, Vector end, int red, int green, int blue, bool zTest, float time)": { "prefix": "DebugDrawLine", "body": [ - "DebugDrawLine(${1:Vector start}, ${2:Vector end}, ${3:int red}, ${4:int green}, ${5:int blue'}, ${6:bool zTest}, ${7:float time})$0" + "DebugDrawLine(${1:Vector start}, ${2:Vector end}, ${3:int red}, ${4:int green}, ${5:int blue}, ${6:bool zTest}, ${7:float time})$0" ], "description": "Draw a debug overlay line." }, @@ -1301,10 +1322,10 @@ ], "description": "Disconnect this area from given area." }, - "void DisconnectOutput(string, string)": { + "void DisconnectOutput(string output, string function)": { "prefix": "DisconnectOutput", "body": [ - "DisconnectOutput(${1:string}, ${2:string})$0" + "DisconnectOutput(${1:string output}, ${2:string function})$0" ], "description": "Removes a connected script function from an I/O event." }, @@ -1313,14 +1334,14 @@ "body": [ "DispatchAnimEvents(${1:handle entity})$0" ], - "description": "Dispatch animation events to a CBaseAnimating" + "description": "Dispatch animation events to a CBaseAnimating entity." }, "void DispatchParticleEffect(string name, Vector origin, Vector angles)": { "prefix": "DispatchParticleEffect", "body": [ "DispatchParticleEffect(${1:string name}, ${2:Vector origin}, ${3:Vector angles})$0" ], - "description": "Dispatches a one-off particle system" + "description": "Dispatches a one-off particle system. To pass angles into this, use the .Forward() method on a QAngle." }, "void DispatchSpawn(handle entity)": { "prefix": "DispatchSpawn", @@ -1348,7 +1369,7 @@ "body": [ "DoAttackTaunt()$0" ], - "description": "Performs taunts attacks if available. Player must be already taunting and taunt must have a valid attack assigned (taunt attack name attribute)" + "description": "Performs taunts attacks if available. Player must be already taunting and taunt must have a valid attack assigned (\\\"taunt attack name\\\" attribute)" }, "string DoUniqueString(string input)": { "prefix": "DoUniqueString", @@ -1749,10 +1770,10 @@ ], "description": "Play named sound on an entity using configurations similar to ambient_generic. Soundlevel is in decibels." }, - "void EmitSound(string)": { + "void EmitSound(string soundname)": { "prefix": "EmitSound", "body": [ - "EmitSound(${1:string})$0" + "EmitSound(${1:string soundname})$0" ], "description": "Plays a sound from this entity." }, @@ -1810,14 +1831,14 @@ "body": [ "EntFire(${1:string target}, ${2:string action}, ${3:string value = null}, ${4:float delay = 0}, ${5:handle activator = null})$0" ], - "description": "Wrapper for DoEntFire() that setsactivator to null, but has no caller param." + "description": "Wrapper for DoEntFire() that setsactivator to null, but has nocallerparam. Negative delays are clamped to 0." }, "void EntFireByHandle(handle entity, string action, string value, float delay, handle activator, handle caller)": { "prefix": "EntFireByHandle", "body": [ "EntFireByHandle(${1:handle entity}, ${2:string action}, ${3:string value}, ${4:float delay}, ${5:handle activator}, ${6:handle caller})$0" ], - "description": "Generate and entity i/o event. First parameter is an entity instance." + "description": "Generate an entity I/O event. First parameter is an entity instance. Negative delays are clamped to 0." }, "handle EntIndexToHScript(int entIndex)": { "prefix": "EntIndexToHScript", @@ -2440,7 +2461,7 @@ "body": [ "FrameTime()$0" ], - "description": "Get the time spent on the server in the last frame" + "description": "Get the time spent on the server in the last frame. Usually this will be 0.015 (the default tickrate)" }, "GO_EAST": { "prefix": "GO_EAST", @@ -2517,14 +2538,14 @@ "body": [ "GR_STATE_BETWEEN_RNDS$0" ], - "description": "10" + "description": "10, This constant entry is missing!" }, "GR_STATE_BONUS": { "prefix": "GR_STATE_BONUS", "body": [ "GR_STATE_BONUS$0" ], - "description": "9" + "description": "9, This constant entry is missing!" }, "GR_STATE_GAME_OVER": { "prefix": "GR_STATE_GAME_OVER", @@ -2638,6 +2659,13 @@ ], "description": "Returns the current absolute velocity of the entity" }, + "handle GetActionPoint()": { + "prefix": "GetActionPoint", + "body": [ + "GetActionPoint()$0" + ], + "description": "Get the given action point for this bot" + }, "handle GetActiveWeapon()": { "prefix": "GetActiveWeapon", "body": [ @@ -2645,24 +2673,24 @@ ], "description": "Get the player's current weapon" }, - "handle GetAdjacentArea(int dir, int n)": { + "handle GetAdjacentArea(ENavDirType dir, int n)": { "prefix": "GetAdjacentArea", "body": [ - "GetAdjacentArea(${1:int dir}, ${2:int n})$0" + "GetAdjacentArea(${1:ENavDirType dir}, ${2:int n})$0" ], "description": "Return the n'th adjacent area in the given direction." }, - "void GetAdjacentAreas(int dir, handle table)": { + "void GetAdjacentAreas(ENavDirType dir, handle table)": { "prefix": "GetAdjacentAreas", "body": [ - "GetAdjacentAreas(${1:int dir}, ${2:handle table})$0" + "GetAdjacentAreas(${1:ENavDirType dir}, ${2:handle table})$0" ], "description": "Fills a passed in table with all adjacent areas in the given direction." }, - "int GetAdjacentCount(int dir)": { + "int GetAdjacentCount(ENavDirType dir)": { "prefix": "GetAdjacentCount", "body": [ - "GetAdjacentCount(${1:int dir})$0" + "GetAdjacentCount(${1:ENavDirType dir})$0" ], "description": "Get the number of adjacent areas in the given direction." }, @@ -2673,6 +2701,13 @@ ], "description": "fills a passed in table of all nav areas" }, + "void GetAllBotTags(handle table)": { + "prefix": "GetAllBotTags", + "body": [ + "GetAllBotTags(${1:handle table})$0" + ], + "description": "Get all bot tags. The key is the index, and the value is the tag" + }, "Vector GetAngles()": { "prefix": "GetAngles", "body": [ @@ -2715,6 +2750,13 @@ ], "description": "Get an attachment's origin as a Vector, by ID." }, + "float GetAttribute(string name, float default_value)": { + "prefix": "GetAttribute", + "body": [ + "GetAttribute(${1:string name}, ${2:float default_value})$0" + ], + "description": "Get an attribute float from the entity. If the attribute does not exist, returns default_value." + }, "int GetAttributes()": { "prefix": "GetAttributes", "body": [ @@ -2741,7 +2783,7 @@ "body": [ "GetBaseVelocity()$0" ], - "description": "Returns any constant velocity currently being imparted onto the entity. This includes being pushed by effects like enttrigger_push and players standing on moving geometry like elevators. Should always returns a zero vector if the entity is not affected by any movement effects." + "description": "Returns any constant velocity currently being imparted onto the entity. This includes being pushed by effects like trigger_push and players standing on moving geometry like elevators. Should always returns a zero vector if the entity is not affected by any movement effects." }, "INextBotComponent GetBodyInterface()": { "prefix": "GetBodyInterface", @@ -3217,7 +3259,7 @@ "body": [ "GetHudHideFlags()$0" ], - "description": "" + "description": "Gets current hidden hud elements" }, "int GetID()": { "prefix": "GetID", @@ -3240,10 +3282,10 @@ ], "description": "Return units/second below which this actor is considered immobile" }, - "void GetIncomingConnections(int dir, handle table)": { + "void GetIncomingConnections(ENavDirType dir, handle table)": { "prefix": "GetIncomingConnections", "body": [ - "GetIncomingConnections(${1:int dir}, ${2:handle table})$0" + "GetIncomingConnections(${1:ENavDirType dir}, ${2:handle table})$0" ], "description": "Fills a passed in table with areas connected TO this area by a ONE-WAY link (ie: we have no connection back to them)." }, @@ -3310,7 +3352,7 @@ ], "description": "Return the last nav area occupied, NULL if unknown. See CTFNavArea." }, - "GetLastWeapon()": { + "handle GetLastWeapon()": { "prefix": "GetLastWeapon", "body": [ "GetLastWeapon()$0" @@ -3329,7 +3371,7 @@ "body": [ "GetListenServerHost()$0" ], - "description": "Get the local player on a listen server." + "description": "Get the local player on a listen server. Returns null on dedicated servers." }, "QAngle GetLocalAngles()": { "prefix": "GetLocalAngles", @@ -3422,6 +3464,20 @@ ], "description": "Gets the max vision range override for the bot" }, + "int GetMission()": { + "prefix": "GetMission", + "body": [ + "GetMission()$0" + ], + "description": "Get this bot's current mission. Does not work." + }, + "handle GetMissionTarget()": { + "prefix": "GetMissionTarget", + "body": [ + "GetMissionTarget()$0" + ], + "description": "Get this bot's current mission target" + }, "int GetModelIndex(string filename)": { "prefix": "GetModelIndex", "body": [ @@ -3476,7 +3532,7 @@ "body": [ "GetName()$0" ], - "description": "Gets the weapon's name" + "description": "Gets the weapon's internal name (not the targetname!)" }, "handle GetNavArea(Vector origin, float flBeneath)": { "prefix": "GetNavArea", @@ -3702,6 +3758,13 @@ ], "description": "Get the entity name stripped of template unique decoration" }, + "int GetPrevMission()": { + "prefix": "GetPrevMission", + "body": [ + "GetPrevMission()$0" + ], + "description": "Get's this bot's previous mission. Does not work." + }, "int GetPrimaryAmmoCount()": { "prefix": "GetPrimaryAmmoCount", "body": [ @@ -3835,10 +3898,10 @@ ], "description": "" }, - "handle GetRandomAdjacentArea(int dir)": { + "handle GetRandomAdjacentArea(ENavDirType dir)": { "prefix": "GetRandomAdjacentArea", "body": [ - "GetRandomAdjacentArea(${1:int dir})$0" + "GetRandomAdjacentArea(${1:ENavDirType dir})$0" ], "description": "Return a random adjacent area in the given direction." }, @@ -3959,7 +4022,7 @@ "body": [ "GetSequenceName(${1:int ID})$0" ], - "description": "Get a sequence name by sequence ID." + "description": "Get a sequence name by sequence ID. Returns \\\"Not Found!\\\" if ID is -1, \\\"Unknown\\\" if the sequence doesn't exist or \\\"No model!\\\" if no model is assigned." }, "float GetSizeX()": { "prefix": "GetSizeX", @@ -4465,6 +4528,13 @@ ], "description": "3" }, + "void HandleTauntCommand(int taunt_slot)": { + "prefix": "HandleTauntCommand", + "body": [ + "HandleTauntCommand(${1:int taunt_slot})$0" + ], + "description": "Spootfs a taunt command from the player, as if they selected this taunt." + }, "bool HasAction(handle entity, string outputName)": { "prefix": "HasAction", "body": [ @@ -4521,6 +4591,13 @@ ], "description": "Currently holding an item? Eg. capture flag" }, + "bool HasMission(int mission)": { + "prefix": "HasMission", + "body": [ + "HasMission(${1:int mission})$0" + ], + "description": "Return true if the given mission is this bot's current mission. Does not work." + }, "bool HasOutput(handle entity, string outputName)": { "prefix": "HasOutput", "body": [ @@ -4785,7 +4862,7 @@ "body": [ "IgnitePlayer()$0" ], - "description": "" + "description": "Supposed to set the player on fire, but... does nothing except play on-fire sound and voicelines." }, "bool InAirDueToExplosion()": { "prefix": "InAirDueToExplosion", @@ -4934,6 +5011,13 @@ ], "description": "Is our attention focused on this entity" }, + "bool IsBehaviorFlagSet(int flags)": { + "prefix": "IsBehaviorFlagSet", + "body": [ + "IsBehaviorFlagSet(${1:int flags})$0" + ], + "description": "Return true if the given behavior flag(s) are set for this bot. Does not work." + }, "bool IsBirthday()": { "prefix": "IsBirthday", "body": [ @@ -4953,7 +5037,7 @@ "body": [ "IsBotOfType(${1:int type})$0" ], - "description": "" + "description": "Returns true if the player matches this bot type. Only one type of bot exists which is reserved for AI bots (not puppet bots): TF_BOT_TYPE. 0 is used for real players or puppet bots. Use IsFakeClient to check for a puppet bot instead." }, "bool IsBottleneck()": { "prefix": "IsBottleneck", @@ -5011,10 +5095,10 @@ ], "description": "Checks if the convar is allowed to be used and is in cfg/vscript_convar_allowlist.txt. Please be nice with this and use it for *compatibility* if you need check support and NOT to force server owners to allow hostname to be set... or else this will simply lie and return true in future. ;-) You have been warned!" }, - "bool IsConnected(handle area, int dir)": { + "bool IsConnected(handle area, ENavDirType dir)": { "prefix": "IsConnected", "body": [ - "IsConnected(${1:handle area}, ${2:int dir})$0" + "IsConnected(${1:handle area}, ${2:ENavDirType dir})$0" ], "description": "Return true if this area is connected to other area in given direction. (If you set direction to -1 or 4, it will automatically check all directions for a connection)." }, @@ -5107,7 +5191,7 @@ "body": [ "IsFakeClient()$0" ], - "description": "" + "description": "Returns true if the player is a puppet or AI bot. To check if the player is a AI bot (CTFBot) specifically, use IsBotOfType instead." }, "bool IsFireproof()": { "prefix": "IsFireproof", @@ -5149,7 +5233,7 @@ "body": [ "IsGap(${1:Vector pos}, ${2:Vector forward})$0" ], - "description": "Return true if there is a gap at this position." + "description": "Return true if there is a gap at this position. forward is unused." }, "bool IsHolidayActive(int holiday)": { "prefix": "IsHolidayActive", @@ -5312,6 +5396,13 @@ ], "description": "Returns true if the player is in noclip mode." }, + "bool IsOnAnyMission()": { + "prefix": "IsOnAnyMission", + "body": [ + "IsOnAnyMission()$0" + ], + "description": "Return true if this bot has a current mission" + }, "bool IsOnGround()": { "prefix": "IsOnGround", "body": [ @@ -5380,7 +5471,7 @@ "body": [ "IsPlayerABot(${1:handle player})$0" ], - "description": "Is this player/entity a bot." + "description": "Is this player/entity a puppet or AI bot. To check if the player is a AI bot (CTFBot) specifically, use IsBotOfType instead." }, "bool IsPlayerSpeaking(int playerIndex)": { "prefix": "IsPlayerSpeaking", @@ -5625,7 +5716,7 @@ "body": [ "JumpAcrossGap(${1:Vector goalPos}, ${2:Vector goalForward})$0" ], - "description": "Initiate a jump across an empty volume of space to far side" + "description": "Initiate a jump across an empty volume of space to far side. goalForward is unused." }, "bool KeyValueFromFloat(string key, float value)": { "prefix": "KeyValueFromFloat", @@ -5744,7 +5835,7 @@ "body": [ "LocalTime(${1:table out})$0" ], - "description": "Fills out a table with the local time (second, minute, hour, day, month, year, dayofweek, dayofyear, daylightsavings)" + "description": "Fills out a table with the local time (second, minute, hour, day, month, year, dayofweek, dayofyear, daylightsavings). This mirrors the tm structure in C++" }, "int LookupActivity(string activity)": { "prefix": "LookupActivity", @@ -6360,7 +6451,7 @@ "body": [ "PI$0" ], - "description": "3.14158" + "description": "3.14159" }, "PLAYER_FLAG_BITS": { "prefix": "PLAYER_FLAG_BITS", @@ -6416,7 +6507,7 @@ "body": [ "PickupObject(${1:handle player}, ${2:handle entity})$0" ], - "description": "Object from world is put into the \\\"Held\\\" slot of the player. Warning: it will smoothly interpolate from where it is to the players hand - which is a bit goofy if it is on other side of level." + "description": "Object from world is put into the \\\"Held\\\" slot of the player. Warning: it will smoothly interpolate from where it is to the players hand - which is a bit goofy if it is on other side of level. Does nothing in Team Fortress 2 as the code is not implemented" }, "float Pitch()": { "prefix": "Pitch", @@ -6507,28 +6598,28 @@ "body": [ "PrecacheEntityFromTable(${1:table keyvalues})$0" ], - "description": "Precache an entity from KeyValues in a table. Internally this function creates the entity, fire DispatchSpawn and removes it instantly." + "description": "Precache an entity from KeyValues in a table. Internally this function creates the entity, fire DispatchSpawn and removes it instantly. Returns false if the table has no classname key, if the value of classname is null or empty, or if the entity failed to be created." }, "int PrecacheModel(string filename)": { "prefix": "PrecacheModel", "body": [ "PrecacheModel(${1:string filename})$0" ], - "description": "Precache a model and return index of the model." + "description": "Precache a model and return index of the model. Returns -1 if null or empty filename is passed in. Missing models will still return a new index." }, "bool PrecacheScriptSound(string soundName)": { "prefix": "PrecacheScriptSound", "body": [ "PrecacheScriptSound(${1:string soundName})$0" ], - "description": "Preache a soundscript." + "description": "Preache a soundscript. Returns false if soundscript is missing, or if a null or empty sound name is passed in." }, "void PrecacheSound(string soundName)": { "prefix": "PrecacheSound", "body": [ "PrecacheSound(${1:string soundName})$0" ], - "description": "Precache a raw sound." + "description": "Precache a raw sound. Returns false if a null or empty sound name is passed in." }, "void PrecacheSoundScript(string soundscript)": { "prefix": "PrecacheSoundScript", @@ -6598,7 +6689,7 @@ "body": [ "RAND_MAX$0" ], - "description": "32767" + "description": "Windows: 32768, Linux: 2147483647" }, "RECIPIENT_FILTER_DEFAULT": { "prefix": "RECIPIENT_FILTER_DEFAULT", @@ -6689,7 +6780,7 @@ "body": [ "ReapplyProvision()$0" ], - "description": "Relinks attributes to provisioners, e.g. calling this on a weapon will add it's attributes to the player" + "description": "Relinks attributes to provisioners, e.g. calling this on a weapon will add it's attributes to the player." }, "void Regenerate(bool refill_health_ammo)": { "prefix": "Regenerate", @@ -6738,7 +6829,7 @@ "body": [ "RemoveAllItems(${1:bool unused})$0" ], - "description": "" + "description": "This does not actually remove all items. It only drops the passtime ball, intelligence, disables radius healing, and hides the Spy invis watch." }, "void RemoveAllObjects(bool explode)": { "prefix": "RemoveAllObjects", @@ -6752,7 +6843,7 @@ "body": [ "RemoveAttribute(${1:string name})$0" ], - "description": "Remove an attribute to the entity" + "description": "Remove an attribute to the entity." }, "void RemoveAttributes(int bits)": { "prefix": "RemoveAttributes", @@ -6787,21 +6878,21 @@ "body": [ "RemoveCond(${1:ETFCond cond})$0" ], - "description": "" + "description": "Removes a condition. Does not remove a condition if the minimum duration has not passed. Does nothing if the condition isn't added (interally does InCond check)." }, "void RemoveCondEx(ETFCond cond, bool ignoreDuration)": { "prefix": "RemoveCondEx", "body": [ "RemoveCondEx(${1:ETFCond cond}, ${2:bool ignoreDuration})$0" ], - "description": "" + "description": "Extended version of RemoveCond. Allows forcefully removing the condition even if minimum duration is not met." }, "void RemoveCurrency(int amount)": { "prefix": "RemoveCurrency", "body": [ "RemoveCurrency(${1:int amount})$0" ], - "description": "Take away money from a player for reasons such as ie. spending." + "description": "Take away money from a player for reasons such as ie. spending. Lower bounded to 0." }, "void RemoveCustomAttribute(string name)": { "prefix": "RemoveCustomAttribute", @@ -7200,14 +7291,14 @@ "body": [ "ScreenFade(${1:handle player}, ${2:int red}, ${3:int green}, ${4:int blue}, ${5:int alpha}, ${6:float fadeTime}, ${7:float fadeHold}, ${8:int flags})$0" ], - "description": "Start a customisable screenfade. If no player is specified, the fade will apply to all players." + "description": "Start a customisable screenfade. If no player is specified, the fade will apply to all players. For a list of flags, see FFADE constants." }, "void ScreenShake(Vector vecCenter, float flAmplitude, float flFrequency, float flDuration, float flRadius, int eCommand, bool bAirShake)": { "prefix": "ScreenShake", "body": [ "ScreenShake(${1:Vector vecCenter}, ${2:float flAmplitude}, ${3:float flFrequency}, ${4:float flDuration}, ${5:float flRadius}, ${6:int eCommand}, ${7:bool bAirShake})$0" ], - "description": "Start a customisable screenshake; eCommand( SHAKE_START = 0, SHAKE_STOP = 1 )." + "description": "Start a customisable screenshake. Set eCommand to 0 to start a shake, or 1 to stop an existing shake." }, "void ScriptDebugAddTextFilter()": { "prefix": "ScriptDebugAddTextFilter", @@ -7277,7 +7368,7 @@ "body": [ "ScriptDebugDrawTextEnabled$0" ], - "description": "" + "description": "true" }, "void ScriptDebugDrawWatches()": { "prefix": "ScriptDebugDrawWatches", @@ -7291,7 +7382,7 @@ "body": [ "ScriptDebugDrawWatchesEnabled$0" ], - "description": "" + "description": "true" }, "void ScriptDebugDumpKeys()": { "prefix": "ScriptDebugDumpKeys", @@ -7312,7 +7403,7 @@ "body": [ "ScriptDebugInDebugDraw$0" ], - "description": "" + "description": "false" }, "void ScriptDebugIterateKeys()": { "prefix": "ScriptDebugIterateKeys", @@ -7389,7 +7480,7 @@ "body": [ "ScriptDebugTextIndent$0" ], - "description": "" + "description": "0" }, "void ScriptDebugTextPrint()": { "prefix": "ScriptDebugTextPrint", @@ -7417,7 +7508,7 @@ "body": [ "ScriptDebugTraceAllOn$0" ], - "description": "" + "description": "false" }, "ScriptDebugTraces": { "prefix": "ScriptDebugTraces", @@ -7503,19 +7594,26 @@ ], "description": "Sets the absolute origin of the entity." }, - "void SetAbsVelocity(Vector)": { + "void SetAbsVelocity(Vector velocity)": { "prefix": "SetAbsVelocity", "body": [ - "SetAbsVelocity(${1:Vector})$0" + "SetAbsVelocity(${1:Vector velocity})$0" + ], + "description": "Sets the current absolute velocity of the entity" + }, + "void SetActionPoint(handle entity)": { + "prefix": "SetActionPoint", + "body": [ + "SetActionPoint(${1:handle entity})$0" ], - "description": "Sets the current absolute velocity velocity of the entity" + "description": "Set the given action point for this bot" }, "void SetAngles(float pitch, float yaw, float roll)": { "prefix": "SetAngles", "body": [ "SetAngles(${1:float pitch}, ${2:float yaw}, ${3:float roll})$0" ], - "description": "Set entity angles." + "description": "Set entity angles. Deprecated, use SetAbsAngles instead." }, "void SetAngularVelocity(float pitch, float yaw, float roll)": { "prefix": "SetAngularVelocity", @@ -7552,6 +7650,13 @@ ], "description": "Sets if the bot should automatically jump" }, + "void SetBehaviorFlag(int flags)": { + "prefix": "SetBehaviorFlag", + "body": [ + "SetBehaviorFlag(${1:int flags})$0" + ], + "description": "Set the given behavior flag(s) for this bot. Does not work." + }, "void SetBodygroup(int ID, int value)": { "prefix": "SetBodygroup", "body": [ @@ -7592,7 +7697,7 @@ "body": [ "SetCurrency(${1:int amount})$0" ], - "description": "Set player's cash for game modes with upgrades, ie. MvM" + "description": "Set player's cash for game modes with upgrades, ie. MvM. Does not have any bounds checking." }, "void SetCurrentTauntMoveSpeed(float speed)": { "prefix": "SetCurrentTauntMoveSpeed", @@ -7606,7 +7711,7 @@ "body": [ "SetCustomModel(${1:string model_name})$0" ], - "description": "" + "description": "Sets a custom player model without animations (model will T-pose). To enable animations, use SetCustomModelWithClassAnimations instead." }, "void SetCustomModelOffset(Vector offset)": { "prefix": "SetCustomModelOffset", @@ -7641,7 +7746,7 @@ "body": [ "SetCustomModelWithClassAnimations(${1:string model_name})$0" ], - "description": "" + "description": "Sets a custom player model with full animations." }, "void SetCustomViewModel(string model_name)": { "prefix": "SetCustomViewModel", @@ -7755,12 +7860,12 @@ ], "description": "" }, - "void SetGroupSpawnTables(table)": { + "void SetGroupSpawnTables(table group, table spawn)": { "prefix": "SetGroupSpawnTables", "body": [ - "SetGroupSpawnTables(${1:table})$0" + "SetGroupSpawnTables(${1:table group}, ${2:table spawn})$0" ], - "description": "Cache the group spawn tables" + "description": "Unused. This only stores a reference to the two tables which is removed when the point_script_template is deleted." }, "void SetHealth(int health)": { "prefix": "SetHealth", @@ -7825,6 +7930,20 @@ ], "description": "Sets max vision range override for the bot" }, + "void SetMission(int mission, bool reset_behavior)": { + "prefix": "SetMission", + "body": [ + "SetMission(${1:int mission}, ${2:bool reset_behavior})$0" + ], + "description": "Set this bot's current mission to the given mission. Does not work." + }, + "void SetMissionTarget(handle entity)": { + "prefix": "SetMissionTarget", + "body": [ + "SetMissionTarget(${1:handle entity})$0" + ], + "description": "Set the bot's mission target to this given entity" + }, "void SetModel(string model_name)": { "prefix": "SetModel", "body": [ @@ -7879,7 +7998,7 @@ "body": [ "SetOrigin(${1:Vector origin})$0" ], - "description": "" + "description": "Deprecated, use SetAbsOrigin instead." }, "void SetOvertimeAllowedForCTF(bool state)": { "prefix": "SetOvertimeAllowedForCTF", @@ -7951,6 +8070,13 @@ ], "description": "Sets a pose parameter value. Returns the effective value after clamping or looping." }, + "void SetPrevMission(int mission)": { + "prefix": "SetPrevMission", + "body": [ + "SetPrevMission(${1:int mission})$0" + ], + "description": "Set this bot's previous mission to the given mission. Does not work." + }, "void SetPropBool(handle entity, string propertyName, bool value)": { "prefix": "SetPropBool", "body": [ @@ -8173,7 +8299,7 @@ "body": [ "SetValue(${1:string name}, ${2:value})$0" ], - "description": "Sets the value of the convar. The convar must be in cfg/vscript_convar_allowlist.txt to be set. Convars marked as cheat-only can be set even if sv_cheats is off. Supported types are bool, int, float, string." + "description": "Sets the value of the convar. The convar must be in cfg/vscript_convar_allowlist.txt to be set. Convars marked as cheat-only can be set even if sv_cheats is off. Convars marked as dev-only (i.e. not visible in console) can also be set. Supported types are bool, int, float, string. The original value of the convar is saved and is reset on map change, in other words convar changes will not persist across maps." }, "void SetVehicleReverseTime(float time)": { "prefix": "SetVehicleReverseTime", @@ -8187,7 +8313,7 @@ "body": [ "SetVelocity(${1:Vector velocity})$0" ], - "description": "" + "description": "Deprecated, use SetAbsVelocity instead." }, "SetWaterLevel(int water_level)": { "prefix": "SetWaterLevel", @@ -8222,7 +8348,7 @@ "body": [ "ShowMessage(${1:string message})$0" ], - "description": "Print a hud message on all clients" + "description": "Print a hud message on all clients. Non-functional." }, "void SnapEyeAngles(QAngle angles)": { "prefix": "SnapEyeAngles", @@ -8350,6 +8476,13 @@ ], "description": "Advance animation frame to some time in the future with a manual interval" }, + "void StunPlayer(float duration, float move_speed_reduction, int flags, handle attacker)": { + "prefix": "StunPlayer", + "body": [ + "StunPlayer(${1:float duration}, ${2:float move_speed_reduction}, ${3:int flags}, ${4:handle attacker})$0" + ], + "description": "Stuns the player for a specified duration. Move speed reduction is a fraction (0 = no reduction. 1 = total reduction, no movement). Flag combinations control the stun type and behavior, see the constants page." + }, "TAUNT_BASE_WEAPON": { "prefix": "TAUNT_BASE_WEAPON", "body": [ @@ -8411,7 +8544,7 @@ "body": [ "TEAM_UNASSIGNED$0" ], - "description": "0" + "description": "null, This is supposed to be 0." }, "TELEPORT_TO_HINT": { "prefix": "TELEPORT_TO_HINT", @@ -9608,7 +9741,7 @@ "body": [ "TF_DMG_CUSTOM_END$0" ], - "description": "84" + "description": "86" }, "TF_DMG_CUSTOM_EYEBALL_ROCKET": { "prefix": "TF_DMG_CUSTOM_EYEBALL_ROCKET", @@ -9680,6 +9813,20 @@ ], "description": "75" }, + "TF_DMG_CUSTOM_KRAMPUS_MELEE": { + "prefix": "TF_DMG_CUSTOM_KRAMPUS_MELEE", + "body": [ + "TF_DMG_CUSTOM_KRAMPUS_MELEE$0" + ], + "description": "84" + }, + "TF_DMG_CUSTOM_KRAMPUS_RANGED": { + "prefix": "TF_DMG_CUSTOM_KRAMPUS_RANGED", + "body": [ + "TF_DMG_CUSTOM_KRAMPUS_RANGED$0" + ], + "description": "85" + }, "TF_DMG_CUSTOM_MERASMUS_DECAPITATION": { "prefix": "TF_DMG_CUSTOM_MERASMUS_DECAPITATION", "body": [ @@ -10303,24 +10450,24 @@ ], "description": "2" }, - "void TakeDamage(float flDamage, int nDamageType, handle hAttacker)": { + "void TakeDamage(float flDamage, Constants.FDmgType nDamageType, handle hAttacker)": { "prefix": "TakeDamage", "body": [ - "TakeDamage(${1:float flDamage}, ${2:int nDamageType}, ${3:handle hAttacker})$0" + "TakeDamage(${1:float flDamage}, ${2:Constants.FDmgType nDamageType}, ${3:handle hAttacker})$0" ], "description": "Deals damage to the entity." }, - "void TakeDamageCustom(handle hInflictor, handle hAttacker, handle hWeapon, Vector vecDamageForce, Vector vecDamagePosition, float flDamage, int nDamageType, Constants.ETFDmgCustom nCustomDamageType)": { + "void TakeDamageCustom(handle hInflictor, handle hAttacker, handle hWeapon, Vector vecDamageForce, Vector vecDamagePosition, float flDamage, Constants.FDmgType nDamageType, Constants.ETFDmgCustom nCustomDamageType)": { "prefix": "TakeDamageCustom", "body": [ - "TakeDamageCustom(${1:handle hInflictor}, ${2:handle hAttacker}, ${3:handle hWeapon}, ${4:Vector vecDamageForce}, ${5:Vector vecDamagePosition}, ${6:float flDamage}, ${7:int nDamageType}, ${8:Constants.ETFDmgCustom nCustomDamageType})$0" + "TakeDamageCustom(${1:handle hInflictor}, ${2:handle hAttacker}, ${3:handle hWeapon}, ${4:Vector vecDamageForce}, ${5:Vector vecDamagePosition}, ${6:float flDamage}, ${7:Constants.FDmgType nDamageType}, ${8:Constants.ETFDmgCustom nCustomDamageType})$0" ], "description": "Extended version of TakeDamageEx that can apply a custom damage type." }, - "void TakeDamageEx(handle hInflictor, handle hAttacker, handle hWeapon, Vector vecDamageForce, Vector vecDamagePosition, float flDamage, int nDamageType)": { + "void TakeDamageEx(handle hInflictor, handle hAttacker, handle hWeapon, Vector vecDamageForce, Vector vecDamagePosition, float flDamage, Constants.FDmgType nDamageType)": { "prefix": "TakeDamageEx", "body": [ - "TakeDamageEx(${1:handle hInflictor}, ${2:handle hAttacker}, ${3:handle hWeapon}, ${4:Vector vecDamageForce}, ${5:Vector vecDamagePosition}, ${6:float flDamage}, ${7:int nDamageType})$0" + "TakeDamageEx(${1:handle hInflictor}, ${2:handle hAttacker}, ${3:handle hWeapon}, ${4:Vector vecDamageForce}, ${5:Vector vecDamagePosition}, ${6:float flDamage}, ${7:Constants.FDmgType nDamageType})$0" ], "description": "Extended version of TakeDamage." }, @@ -10357,7 +10504,7 @@ "body": [ "Time()$0" ], - "description": "Get the current server time" + "description": "Get the current server time in seconds" }, "string ToKVString()": { "prefix": "ToKVString", @@ -10546,7 +10693,7 @@ "body": [ "ValidateScriptScope()$0" ], - "description": "Ensure that an entity's script scope has been created" + "description": "Ensure that an entity's script scope has been created. In practice, this always returns true unless the script VM is disabled in launch options." }, "Vector(float x = 0, float y = 0, float z = 0)": { "prefix": "Vector", @@ -10637,7 +10784,7 @@ "body": [ "Weapon_Equip(${1:handle weapon})$0" ], - "description": "" + "description": "Equips a weapon in the player. This places it inside the m_hMyWeapons array." }, "void Weapon_SetLast(handle weapon)": { "prefix": "Weapon_SetLast", @@ -10658,7 +10805,7 @@ "body": [ "Weapon_Switch(${1:handle weapon})$0" ], - "description": "" + "description": "Attempts a switch to the given weapon, if present in the player's inventory (m_hMyWeapons array)." }, "float Yaw()": { "prefix": "Yaw", @@ -10798,7 +10945,7 @@ "body": [ "_intsize_$0" ], - "description": "4" + "description": "32-bit: 4, 64-bit: 8" }, "_version_": { "prefix": "_version_", @@ -10856,10 +11003,10 @@ ], "description": "Returns tan^-1(x)" }, - "atan2(num y, num x) (!)": { + "atan2(num y, num x)": { "prefix": "atan2", "body": [ - "atan2(${1:num y}, ${2:num x) (!})$0" + "atan2(${1:num y}, ${2:num x})$0" ], "description": "Returns the angle between the ray from the point (0, 0) through (x, y) and the positive x-axis, confined to (-PI, PI). Note the order of the parameters x and y!" }, @@ -11561,7 +11708,7 @@ "body": [ "rand()$0" ], - "description": "Returns a random integer with 0 <= rand() <= RAND_MAX" + "description": "Returns a random integer with 0 <= rand() <= RAND_MAX. The value of RAND_MAX is 32768 on Windows, but 2147483647 on Linux. This can cause undeterministic behavior between a server running on Windows vs Linux. Instead, use RandomInt or RandomFloat." }, "blob readblob(int numberOfBytes)": { "prefix": "readblob", @@ -11815,13 +11962,6 @@ ], "description": "" }, - "ent.m_iHealth": { - "prefix": "ent.m_iHealth", - "body": [ - "NetProps.GetPropInt(ent, \"m_iHealth\")" - ], - "description": "Gathers the health of a player." - }, "void OnGameEvent_achievement_earned()": { "prefix": "OnGameEvent_achievement_earned", "body": [ @@ -11857,6 +11997,13 @@ ], "description": "" }, + "void OnGameEvent_ammo_pickup()": { + "prefix": "OnGameEvent_ammo_pickup", + "body": [ + "OnGameEvent_ammo_pickup(${1:params}){\r\n\t$0\n}" + ], + "description": "" + }, "void OnGameEvent_arena_match_maxstreak()": { "prefix": "OnGameEvent_arena_match_maxstreak", "body": [ @@ -12186,6 +12333,13 @@ ], "description": "" }, + "void OnGameEvent_enter_vehicle()": { + "prefix": "OnGameEvent_enter_vehicle", + "body": [ + "OnGameEvent_enter_vehicle(${1:params}){\r\n\t$0\n}" + ], + "description": "" + }, "void OnGameEvent_entered_performance_mode()": { "prefix": "OnGameEvent_entered_performance_mode", "body": [ @@ -12368,6 +12522,13 @@ ], "description": "" }, + "void OnGameEvent_gameui_activate()": { + "prefix": "OnGameEvent_gameui_activate", + "body": [ + "OnGameEvent_gameui_activate(${1:params}){\r\n\t$0\n}" + ], + "description": "" + }, "void OnGameEvent_gameui_activated()": { "prefix": "OnGameEvent_gameui_activated", "body": [ @@ -12375,6 +12536,13 @@ ], "description": "" }, + "void OnGameEvent_gameui_hide()": { + "prefix": "OnGameEvent_gameui_hide", + "body": [ + "OnGameEvent_gameui_hide(${1:params}){\r\n\t$0\n}" + ], + "description": "" + }, "void OnGameEvent_gameui_hidden()": { "prefix": "OnGameEvent_gameui_hidden", "body": [ @@ -12536,6 +12704,13 @@ ], "description": "" }, + "void OnGameEvent_killed_ball_carrier()": { + "prefix": "OnGameEvent_killed_ball_carrier", + "body": [ + "OnGameEvent_killed_ball_carrier(${1:params}){\r\n\t$0\n}" + ], + "description": "" + }, "void OnGameEvent_killed_capping_player()": { "prefix": "OnGameEvent_killed_capping_player", "body": [ @@ -12550,6 +12725,13 @@ ], "description": "" }, + "void OnGameEvent_leave_vehicle()": { + "prefix": "OnGameEvent_leave_vehicle", + "body": [ + "OnGameEvent_leave_vehicle(${1:params}){\r\n\t$0\n}" + ], + "description": "" + }, "void OnGameEvent_lobby_updated()": { "prefix": "OnGameEvent_lobby_updated", "body": [ @@ -12564,6 +12746,13 @@ ], "description": "" }, + "void OnGameEvent_localplayer_builtobject()": { + "prefix": "OnGameEvent_localplayer_builtobject", + "body": [ + "OnGameEvent_localplayer_builtobject(${1:params}){\r\n\t$0\n}" + ], + "description": "" + }, "void OnGameEvent_localplayer_changeclass()": { "prefix": "OnGameEvent_localplayer_changeclass", "body": [ @@ -13985,6 +14174,13 @@ ], "description": "" }, + "void OnGameEvent_single_player_death()": { + "prefix": "OnGameEvent_single_player_death", + "body": [ + "OnGameEvent_single_player_death(${1:params}){\r\n\t$0\n}" + ], + "description": "" + }, "void OnGameEvent_slap_notice()": { "prefix": "OnGameEvent_slap_notice", "body": [ @@ -14055,6 +14251,20 @@ ], "description": "" }, + "void OnGameEvent_take_armor()": { + "prefix": "OnGameEvent_take_armor", + "body": [ + "OnGameEvent_take_armor(${1:params}){\r\n\t$0\n}" + ], + "description": "" + }, + "void OnGameEvent_take_health()": { + "prefix": "OnGameEvent_take_health", + "body": [ + "OnGameEvent_take_health(${1:params}){\r\n\t$0\n}" + ], + "description": "" + }, "void OnGameEvent_team_info()": { "prefix": "OnGameEvent_team_info", "body": [ @@ -14447,6 +14657,13 @@ ], "description": "" }, + "void OnGameEvent_weapon_equipped()": { + "prefix": "OnGameEvent_weapon_equipped", + "body": [ + "OnGameEvent_weapon_equipped(${1:params}){\r\n\t$0\n}" + ], + "description": "" + }, "void OnGameEvent_winlimit_changed()": { "prefix": "OnGameEvent_winlimit_changed", "body": [ @@ -14467,5 +14684,12 @@ "OnGameEvent_world_status_changed(${1:params}){\r\n\t$0\n}" ], "description": "" + }, + "ent.m_iHealth": { + "prefix": "ent.m_iHealth", + "body": [ + "NetProps.GetPropInt(ent, \"m_iHealth\")" + ], + "description": "Gathers the health of a player." } } \ No newline at end of file diff --git a/tf2-snippets.sublime-completions b/tf2-snippets.sublime-completions index bdba32c..4e4a3f6 100644 --- a/tf2-snippets.sublime-completions +++ b/tf2-snippets.sublime-completions @@ -43,6 +43,13 @@ "kind": "keyword", "details": "262144" }, + { + "trigger": "AcceptInput", + "annotation": "bool AcceptInput(string input, string param, handle activator, handle caller)", + "contents": "AcceptInput(${1:string input}, ${2:string param}, ${3:handle activator}, ${4:handle caller})$0", + "kind": "keyword", + "details": "caller) \tGenerate a synchronous I/O event. Unlike EntFireByHandle, this is processed immediately. Returns false if input is a null/empty string, or if the input wasn't handled." + }, { "trigger": "AddAttribute", "annotation": "void AddAttribute(string name, float value, float duration)", @@ -90,7 +97,7 @@ "annotation": "void AddCurrency(int amount)", "contents": "AddCurrency(${1:int amount})$0", "kind": "keyword", - "details": "Kaching! Give the player some cash for game modes with upgrades, ie. MvM" + "details": "Kaching! Give the player some cash for game modes with upgrades, ie. MvM. The new value is bounded between 0-30000." }, { "trigger": "AddCustomAttribute", @@ -122,8 +129,8 @@ }, { "trigger": "AddIncomingConnection", - "annotation": "void AddIncomingConnection(handle area, int dir)", - "contents": "AddIncomingConnection(${1:handle area}, ${2:int dir})$0", + "annotation": "void AddIncomingConnection(handle area, ENavDirType dir)", + "contents": "AddIncomingConnection(${1:handle area}, ${2:ENavDirType dir})$0", "kind": "keyword", "details": "Add areas that connect TO this area by a ONE-WAY link" }, @@ -143,17 +150,17 @@ }, { "trigger": "AddTemplate", - "annotation": "void AddTemplate(string, table)", - "contents": "AddTemplate(${1:string}, ${2:table})$0", + "annotation": "void AddTemplate(string classname, table keyvalues)", + "contents": "AddTemplate(${1:string classname}, ${2:table keyvalues})$0", "kind": "keyword", - "details": "Add an entity to the template spawner" + "details": "Add an entity with the given keyvalues to the template spawner, similar to SpawnEntityFromTable. The number of templates allowed is unlimited." }, { "trigger": "AddThinkToEnt", "annotation": "void AddThinkToEnt(handle entity, string FuncName)", "contents": "AddThinkToEnt(${1:handle entity}, ${2:string FuncName})$0", "kind": "keyword", - "details": "Sets a function in the entity's script to rerun by itself constantly. Pass null as the function name to remove a think function. The default think interval is 0.1s, unless overridden by returning a different time interval in seconds in the think function" + "details": "Sets a function in the entity's script to rerun by itself constantly. Pass null as the function name to remove a think function. The default think interval is 0.1s, unless overridden by returning a different time interval in seconds in the think function. TF2 runs at 66 ticks per second, so the lowest possible interval is 0.015 seconds. Set to -1 to think every tick." }, { "trigger": "AddToScriptHelp", @@ -785,6 +792,13 @@ "kind": "keyword", "details": "Clear TF-specific area attribute bits." }, + { + "trigger": "ClearBehaviorFlag", + "annotation": "void ClearBehaviorFlag(int flags)", + "contents": "ClearBehaviorFlag(${1:int flags})$0", + "kind": "keyword", + "details": "clear the given behavior flag(s) for this bot. Does not work." + }, { "trigger": "ClearCustomModelRotation", "annotation": "void ClearCustomModelRotation()", @@ -897,10 +911,17 @@ "kind": "keyword", "details": "Adds an I/O connection that will call the named function when the specified output fires." }, + { + "trigger": "ConnectOutputs", + "annotation": "void ConnectOutputs(handle scope)", + "contents": "ConnectOutputs(${1:handle scope})$0", + "kind": "keyword", + "details": "Global function called after an entity with an script assigned spawns (i.e. vscripts keyvalue is not blank). Unlike OnPostSpawn, this is called immediately and therefore on map respawn, some entities may not exist during this point." + }, { "trigger": "ConnectTo", - "annotation": "void ConnectTo(handle area, int dir)", - "contents": "ConnectTo(${1:handle area}, ${2:int dir})$0", + "annotation": "void ConnectTo(handle area, ENavDirType dir)", + "contents": "ConnectTo(${1:handle area}, ${2:ENavDirType dir})$0", "kind": "keyword", "details": "Connect this area to given area in given direction." }, @@ -979,7 +1000,7 @@ "annotation": "DMG_ACID", "contents": "DMG_ACID$0", "kind": "keyword", - "details": "1048576" + "details": "1048576, Crit damage." }, { "trigger": "DMG_AIRBOAT", @@ -1091,14 +1112,14 @@ "annotation": "DMG_GENERIC", "contents": "DMG_GENERIC$0", "kind": "keyword", - "details": "0" + "details": "null, This is supposed to be 0." }, { "trigger": "DMG_NERVEGAS", "annotation": "DMG_NERVEGAS", "contents": "DMG_NERVEGAS$0", "kind": "keyword", - "details": "65536" + "details": "65536, Sawblade damage." }, { "trigger": "DMG_NEVERGIB", @@ -1175,7 +1196,7 @@ "annotation": "DMG_SLOWBURN", "contents": "DMG_SLOWBURN$0", "kind": "keyword", - "details": "2097152" + "details": "2097152, Bullet falloff damage." }, { "trigger": "DMG_SONIC", @@ -1189,7 +1210,7 @@ "annotation": "DMG_VEHICLE", "contents": "DMG_VEHICLE$0", "kind": "keyword", - "details": "16" + "details": "16, Train damage." }, { "trigger": "DOWN", @@ -1242,8 +1263,8 @@ }, { "trigger": "DebugDrawLine", - "annotation": "void DebugDrawLine(Vector start, Vector end, int red, int green, int blue', bool zTest, float time)", - "contents": "DebugDrawLine(${1:Vector start}, ${2:Vector end}, ${3:int red}, ${4:int green}, ${5:int blue'}, ${6:bool zTest}, ${7:float time})$0", + "annotation": "void DebugDrawLine(Vector start, Vector end, int red, int green, int blue, bool zTest, float time)", + "contents": "DebugDrawLine(${1:Vector start}, ${2:Vector end}, ${3:int red}, ${4:int green}, ${5:int blue}, ${6:bool zTest}, ${7:float time})$0", "kind": "keyword", "details": "Draw a debug overlay line." }, @@ -1305,8 +1326,8 @@ }, { "trigger": "DisconnectOutput", - "annotation": "void DisconnectOutput(string, string)", - "contents": "DisconnectOutput(${1:string}, ${2:string})$0", + "annotation": "void DisconnectOutput(string output, string function)", + "contents": "DisconnectOutput(${1:string output}, ${2:string function})$0", "kind": "keyword", "details": "Removes a connected script function from an I/O event." }, @@ -1315,14 +1336,14 @@ "annotation": "void DispatchAnimEvents(handle entity)", "contents": "DispatchAnimEvents(${1:handle entity})$0", "kind": "keyword", - "details": "Dispatch animation events to a CBaseAnimating" + "details": "Dispatch animation events to a CBaseAnimating entity." }, { "trigger": "DispatchParticleEffect", "annotation": "void DispatchParticleEffect(string name, Vector origin, Vector angles)", "contents": "DispatchParticleEffect(${1:string name}, ${2:Vector origin}, ${3:Vector angles})$0", "kind": "keyword", - "details": "Dispatches a one-off particle system" + "details": "Dispatches a one-off particle system. To pass angles into this, use the .Forward() method on a QAngle." }, { "trigger": "DispatchSpawn", @@ -1350,7 +1371,7 @@ "annotation": "void DoAttackTaunt()", "contents": "DoAttackTaunt()$0", "kind": "keyword", - "details": "Performs taunts attacks if available. Player must be already taunting and taunt must have a valid attack assigned (taunt attack name attribute)" + "details": "Performs taunts attacks if available. Player must be already taunting and taunt must have a valid attack assigned (\\\"taunt attack name\\\" attribute)" }, { "trigger": "DoUniqueString", @@ -1753,8 +1774,8 @@ }, { "trigger": "EmitSound", - "annotation": "void EmitSound(string)", - "contents": "EmitSound(${1:string})$0", + "annotation": "void EmitSound(string soundname)", + "contents": "EmitSound(${1:string soundname})$0", "kind": "keyword", "details": "Plays a sound from this entity." }, @@ -1812,14 +1833,14 @@ "annotation": "void EntFire(string target, string action, string value = null, float delay = 0, handle activator = null)", "contents": "EntFire(${1:string target}, ${2:string action}, ${3:string value = null}, ${4:float delay = 0}, ${5:handle activator = null})$0", "kind": "keyword", - "details": "Wrapper for DoEntFire() that setsactivator to null, but has no caller param." + "details": "Wrapper for DoEntFire() that setsactivator to null, but has nocallerparam. Negative delays are clamped to 0." }, { "trigger": "EntFireByHandle", "annotation": "void EntFireByHandle(handle entity, string action, string value, float delay, handle activator, handle caller)", "contents": "EntFireByHandle(${1:handle entity}, ${2:string action}, ${3:string value}, ${4:float delay}, ${5:handle activator}, ${6:handle caller})$0", "kind": "keyword", - "details": "Generate and entity i/o event. First parameter is an entity instance." + "details": "Generate an entity I/O event. First parameter is an entity instance. Negative delays are clamped to 0." }, { "trigger": "EntIndexToHScript", @@ -2442,7 +2463,7 @@ "annotation": "float FrameTime()", "contents": "FrameTime()$0", "kind": "keyword", - "details": "Get the time spent on the server in the last frame" + "details": "Get the time spent on the server in the last frame. Usually this will be 0.015 (the default tickrate)" }, { "trigger": "GO_EAST", @@ -2519,14 +2540,14 @@ "annotation": "GR_STATE_BETWEEN_RNDS", "contents": "GR_STATE_BETWEEN_RNDS$0", "kind": "keyword", - "details": "10" + "details": "10, This constant entry is missing!" }, { "trigger": "GR_STATE_BONUS", "annotation": "GR_STATE_BONUS", "contents": "GR_STATE_BONUS$0", "kind": "keyword", - "details": "9" + "details": "9, This constant entry is missing!" }, { "trigger": "GR_STATE_GAME_OVER", @@ -2640,6 +2661,13 @@ "kind": "keyword", "details": "Returns the current absolute velocity of the entity" }, + { + "trigger": "GetActionPoint", + "annotation": "handle GetActionPoint()", + "contents": "GetActionPoint()$0", + "kind": "keyword", + "details": "Get the given action point for this bot" + }, { "trigger": "GetActiveWeapon", "annotation": "handle GetActiveWeapon()", @@ -2649,22 +2677,22 @@ }, { "trigger": "GetAdjacentArea", - "annotation": "handle GetAdjacentArea(int dir, int n)", - "contents": "GetAdjacentArea(${1:int dir}, ${2:int n})$0", + "annotation": "handle GetAdjacentArea(ENavDirType dir, int n)", + "contents": "GetAdjacentArea(${1:ENavDirType dir}, ${2:int n})$0", "kind": "keyword", "details": "Return the n'th adjacent area in the given direction." }, { "trigger": "GetAdjacentAreas", - "annotation": "void GetAdjacentAreas(int dir, handle table)", - "contents": "GetAdjacentAreas(${1:int dir}, ${2:handle table})$0", + "annotation": "void GetAdjacentAreas(ENavDirType dir, handle table)", + "contents": "GetAdjacentAreas(${1:ENavDirType dir}, ${2:handle table})$0", "kind": "keyword", "details": "Fills a passed in table with all adjacent areas in the given direction." }, { "trigger": "GetAdjacentCount", - "annotation": "int GetAdjacentCount(int dir)", - "contents": "GetAdjacentCount(${1:int dir})$0", + "annotation": "int GetAdjacentCount(ENavDirType dir)", + "contents": "GetAdjacentCount(${1:ENavDirType dir})$0", "kind": "keyword", "details": "Get the number of adjacent areas in the given direction." }, @@ -2675,6 +2703,13 @@ "kind": "keyword", "details": "fills a passed in table of all nav areas" }, + { + "trigger": "GetAllBotTags", + "annotation": "void GetAllBotTags(handle table)", + "contents": "GetAllBotTags(${1:handle table})$0", + "kind": "keyword", + "details": "Get all bot tags. The key is the index, and the value is the tag" + }, { "trigger": "GetAngles", "annotation": "Vector GetAngles()", @@ -2717,6 +2752,13 @@ "kind": "keyword", "details": "Get an attachment's origin as a Vector, by ID." }, + { + "trigger": "GetAttribute", + "annotation": "float GetAttribute(string name, float default_value)", + "contents": "GetAttribute(${1:string name}, ${2:float default_value})$0", + "kind": "keyword", + "details": "Get an attribute float from the entity. If the attribute does not exist, returns default_value." + }, { "trigger": "GetAttributes", "annotation": "int GetAttributes()", @@ -2743,7 +2785,7 @@ "annotation": "Vector GetBaseVelocity()", "contents": "GetBaseVelocity()$0", "kind": "keyword", - "details": "Returns any constant velocity currently being imparted onto the entity. This includes being pushed by effects like enttrigger_push and players standing on moving geometry like elevators. Should always returns a zero vector if the entity is not affected by any movement effects." + "details": "Returns any constant velocity currently being imparted onto the entity. This includes being pushed by effects like trigger_push and players standing on moving geometry like elevators. Should always returns a zero vector if the entity is not affected by any movement effects." }, { "trigger": "GetBodyInterface", @@ -3219,7 +3261,7 @@ "annotation": "int GetHudHideFlags()", "contents": "GetHudHideFlags()$0", "kind": "keyword", - "details": "" + "details": "Gets current hidden hud elements" }, { "trigger": "GetID", @@ -3244,8 +3286,8 @@ }, { "trigger": "GetIncomingConnections", - "annotation": "void GetIncomingConnections(int dir, handle table)", - "contents": "GetIncomingConnections(${1:int dir}, ${2:handle table})$0", + "annotation": "void GetIncomingConnections(ENavDirType dir, handle table)", + "contents": "GetIncomingConnections(${1:ENavDirType dir}, ${2:handle table})$0", "kind": "keyword", "details": "Fills a passed in table with areas connected TO this area by a ONE-WAY link (ie: we have no connection back to them)." }, @@ -3314,7 +3356,7 @@ }, { "trigger": "GetLastWeapon", - "annotation": "GetLastWeapon()", + "annotation": "handle GetLastWeapon()", "contents": "GetLastWeapon()$0", "kind": "keyword", "details": "" @@ -3331,7 +3373,7 @@ "annotation": "handle GetListenServerHost()", "contents": "GetListenServerHost()$0", "kind": "keyword", - "details": "Get the local player on a listen server." + "details": "Get the local player on a listen server. Returns null on dedicated servers." }, { "trigger": "GetLocalAngles", @@ -3424,6 +3466,20 @@ "kind": "keyword", "details": "Gets the max vision range override for the bot" }, + { + "trigger": "GetMission", + "annotation": "int GetMission()", + "contents": "GetMission()$0", + "kind": "keyword", + "details": "Get this bot's current mission. Does not work." + }, + { + "trigger": "GetMissionTarget", + "annotation": "handle GetMissionTarget()", + "contents": "GetMissionTarget()$0", + "kind": "keyword", + "details": "Get this bot's current mission target" + }, { "trigger": "GetModelIndex", "annotation": "int GetModelIndex(string filename)", @@ -3478,7 +3534,7 @@ "annotation": "string GetName()", "contents": "GetName()$0", "kind": "keyword", - "details": "Gets the weapon's name" + "details": "Gets the weapon's internal name (not the targetname!)" }, { "trigger": "GetNavArea", @@ -3704,6 +3760,13 @@ "kind": "keyword", "details": "Get the entity name stripped of template unique decoration" }, + { + "trigger": "GetPrevMission", + "annotation": "int GetPrevMission()", + "contents": "GetPrevMission()$0", + "kind": "keyword", + "details": "Get's this bot's previous mission. Does not work." + }, { "trigger": "GetPrimaryAmmoCount", "annotation": "int GetPrimaryAmmoCount()", @@ -3839,8 +3902,8 @@ }, { "trigger": "GetRandomAdjacentArea", - "annotation": "handle GetRandomAdjacentArea(int dir)", - "contents": "GetRandomAdjacentArea(${1:int dir})$0", + "annotation": "handle GetRandomAdjacentArea(ENavDirType dir)", + "contents": "GetRandomAdjacentArea(${1:ENavDirType dir})$0", "kind": "keyword", "details": "Return a random adjacent area in the given direction." }, @@ -3961,7 +4024,7 @@ "annotation": "string GetSequenceName(int ID)", "contents": "GetSequenceName(${1:int ID})$0", "kind": "keyword", - "details": "Get a sequence name by sequence ID." + "details": "Get a sequence name by sequence ID. Returns \\\"Not Found!\\\" if ID is -1, \\\"Unknown\\\" if the sequence doesn't exist or \\\"No model!\\\" if no model is assigned." }, { "trigger": "GetSizeX", @@ -4467,6 +4530,13 @@ "kind": "keyword", "details": "3" }, + { + "trigger": "HandleTauntCommand", + "annotation": "void HandleTauntCommand(int taunt_slot)", + "contents": "HandleTauntCommand(${1:int taunt_slot})$0", + "kind": "keyword", + "details": "Spootfs a taunt command from the player, as if they selected this taunt." + }, { "trigger": "HasAction", "annotation": "bool HasAction(handle entity, string outputName)", @@ -4523,6 +4593,13 @@ "kind": "keyword", "details": "Currently holding an item? Eg. capture flag" }, + { + "trigger": "HasMission", + "annotation": "bool HasMission(int mission)", + "contents": "HasMission(${1:int mission})$0", + "kind": "keyword", + "details": "Return true if the given mission is this bot's current mission. Does not work." + }, { "trigger": "HasOutput", "annotation": "bool HasOutput(handle entity, string outputName)", @@ -4787,7 +4864,7 @@ "annotation": "void IgnitePlayer()", "contents": "IgnitePlayer()$0", "kind": "keyword", - "details": "" + "details": "Supposed to set the player on fire, but... does nothing except play on-fire sound and voicelines." }, { "trigger": "InAirDueToExplosion", @@ -4936,6 +5013,13 @@ "kind": "keyword", "details": "Is our attention focused on this entity" }, + { + "trigger": "IsBehaviorFlagSet", + "annotation": "bool IsBehaviorFlagSet(int flags)", + "contents": "IsBehaviorFlagSet(${1:int flags})$0", + "kind": "keyword", + "details": "Return true if the given behavior flag(s) are set for this bot. Does not work." + }, { "trigger": "IsBirthday", "annotation": "bool IsBirthday()", @@ -4955,7 +5039,7 @@ "annotation": "bool IsBotOfType(int type)", "contents": "IsBotOfType(${1:int type})$0", "kind": "keyword", - "details": "" + "details": "Returns true if the player matches this bot type. Only one type of bot exists which is reserved for AI bots (not puppet bots): TF_BOT_TYPE. 0 is used for real players or puppet bots. Use IsFakeClient to check for a puppet bot instead." }, { "trigger": "IsBottleneck", @@ -5015,8 +5099,8 @@ }, { "trigger": "IsConnected", - "annotation": "bool IsConnected(handle area, int dir)", - "contents": "IsConnected(${1:handle area}, ${2:int dir})$0", + "annotation": "bool IsConnected(handle area, ENavDirType dir)", + "contents": "IsConnected(${1:handle area}, ${2:ENavDirType dir})$0", "kind": "keyword", "details": "Return true if this area is connected to other area in given direction. (If you set direction to -1 or 4, it will automatically check all directions for a connection)." }, @@ -5109,7 +5193,7 @@ "annotation": "bool IsFakeClient()", "contents": "IsFakeClient()$0", "kind": "keyword", - "details": "" + "details": "Returns true if the player is a puppet or AI bot. To check if the player is a AI bot (CTFBot) specifically, use IsBotOfType instead." }, { "trigger": "IsFireproof", @@ -5151,7 +5235,7 @@ "annotation": "bool IsGap(Vector pos, Vector forward)", "contents": "IsGap(${1:Vector pos}, ${2:Vector forward})$0", "kind": "keyword", - "details": "Return true if there is a gap at this position." + "details": "Return true if there is a gap at this position. forward is unused." }, { "trigger": "IsHolidayActive", @@ -5314,6 +5398,13 @@ "kind": "keyword", "details": "Returns true if the player is in noclip mode." }, + { + "trigger": "IsOnAnyMission", + "annotation": "bool IsOnAnyMission()", + "contents": "IsOnAnyMission()$0", + "kind": "keyword", + "details": "Return true if this bot has a current mission" + }, { "trigger": "IsOnGround", "annotation": "bool IsOnGround()", @@ -5382,7 +5473,7 @@ "annotation": "bool IsPlayerABot(handle player)", "contents": "IsPlayerABot(${1:handle player})$0", "kind": "keyword", - "details": "Is this player/entity a bot." + "details": "Is this player/entity a puppet or AI bot. To check if the player is a AI bot (CTFBot) specifically, use IsBotOfType instead." }, { "trigger": "IsPlayerSpeaking", @@ -5627,7 +5718,7 @@ "annotation": "void JumpAcrossGap(Vector goalPos, Vector goalForward)", "contents": "JumpAcrossGap(${1:Vector goalPos}, ${2:Vector goalForward})$0", "kind": "keyword", - "details": "Initiate a jump across an empty volume of space to far side" + "details": "Initiate a jump across an empty volume of space to far side. goalForward is unused." }, { "trigger": "KeyValueFromFloat", @@ -5746,7 +5837,7 @@ "annotation": "void LocalTime(table out)", "contents": "LocalTime(${1:table out})$0", "kind": "keyword", - "details": "Fills out a table with the local time (second, minute, hour, day, month, year, dayofweek, dayofyear, daylightsavings)" + "details": "Fills out a table with the local time (second, minute, hour, day, month, year, dayofweek, dayofyear, daylightsavings). This mirrors the tm structure in C++" }, { "trigger": "LookupActivity", @@ -6362,7 +6453,7 @@ "annotation": "PI", "contents": "PI$0", "kind": "keyword", - "details": "3.14158" + "details": "3.14159" }, { "trigger": "PLAYER_FLAG_BITS", @@ -6418,7 +6509,7 @@ "annotation": "void PickupObject(handle player, handle entity)", "contents": "PickupObject(${1:handle player}, ${2:handle entity})$0", "kind": "keyword", - "details": "Object from world is put into the \\\"Held\\\" slot of the player. Warning: it will smoothly interpolate from where it is to the players hand - which is a bit goofy if it is on other side of level." + "details": "Object from world is put into the \\\"Held\\\" slot of the player. Warning: it will smoothly interpolate from where it is to the players hand - which is a bit goofy if it is on other side of level. Does nothing in Team Fortress 2 as the code is not implemented" }, { "trigger": "Pitch", @@ -6509,28 +6600,28 @@ "annotation": "bool PrecacheEntityFromTable(table keyvalues)", "contents": "PrecacheEntityFromTable(${1:table keyvalues})$0", "kind": "keyword", - "details": "Precache an entity from KeyValues in a table. Internally this function creates the entity, fire DispatchSpawn and removes it instantly." + "details": "Precache an entity from KeyValues in a table. Internally this function creates the entity, fire DispatchSpawn and removes it instantly. Returns false if the table has no classname key, if the value of classname is null or empty, or if the entity failed to be created." }, { "trigger": "PrecacheModel", "annotation": "int PrecacheModel(string filename)", "contents": "PrecacheModel(${1:string filename})$0", "kind": "keyword", - "details": "Precache a model and return index of the model." + "details": "Precache a model and return index of the model. Returns -1 if null or empty filename is passed in. Missing models will still return a new index." }, { "trigger": "PrecacheScriptSound", "annotation": "bool PrecacheScriptSound(string soundName)", "contents": "PrecacheScriptSound(${1:string soundName})$0", "kind": "keyword", - "details": "Preache a soundscript." + "details": "Preache a soundscript. Returns false if soundscript is missing, or if a null or empty sound name is passed in." }, { "trigger": "PrecacheSound", "annotation": "void PrecacheSound(string soundName)", "contents": "PrecacheSound(${1:string soundName})$0", "kind": "keyword", - "details": "Precache a raw sound." + "details": "Precache a raw sound. Returns false if a null or empty sound name is passed in." }, { "trigger": "PrecacheSoundScript", @@ -6600,7 +6691,7 @@ "annotation": "RAND_MAX", "contents": "RAND_MAX$0", "kind": "keyword", - "details": "32767" + "details": "Windows: 32768, Linux: 2147483647" }, { "trigger": "RECIPIENT_FILTER_DEFAULT", @@ -6691,7 +6782,7 @@ "annotation": "void ReapplyProvision()", "contents": "ReapplyProvision()$0", "kind": "keyword", - "details": "Relinks attributes to provisioners, e.g. calling this on a weapon will add it's attributes to the player" + "details": "Relinks attributes to provisioners, e.g. calling this on a weapon will add it's attributes to the player." }, { "trigger": "Regenerate", @@ -6740,7 +6831,7 @@ "annotation": "void RemoveAllItems(bool unused)", "contents": "RemoveAllItems(${1:bool unused})$0", "kind": "keyword", - "details": "" + "details": "This does not actually remove all items. It only drops the passtime ball, intelligence, disables radius healing, and hides the Spy invis watch." }, { "trigger": "RemoveAllObjects", @@ -6754,7 +6845,7 @@ "annotation": "void RemoveAttribute(string name)", "contents": "RemoveAttribute(${1:string name})$0", "kind": "keyword", - "details": "Remove an attribute to the entity" + "details": "Remove an attribute to the entity." }, { "trigger": "RemoveAttributes", @@ -6789,21 +6880,21 @@ "annotation": "void RemoveCond(ETFCond cond)", "contents": "RemoveCond(${1:ETFCond cond})$0", "kind": "keyword", - "details": "" + "details": "Removes a condition. Does not remove a condition if the minimum duration has not passed. Does nothing if the condition isn't added (interally does InCond check)." }, { "trigger": "RemoveCondEx", "annotation": "void RemoveCondEx(ETFCond cond, bool ignoreDuration)", "contents": "RemoveCondEx(${1:ETFCond cond}, ${2:bool ignoreDuration})$0", "kind": "keyword", - "details": "" + "details": "Extended version of RemoveCond. Allows forcefully removing the condition even if minimum duration is not met." }, { "trigger": "RemoveCurrency", "annotation": "void RemoveCurrency(int amount)", "contents": "RemoveCurrency(${1:int amount})$0", "kind": "keyword", - "details": "Take away money from a player for reasons such as ie. spending." + "details": "Take away money from a player for reasons such as ie. spending. Lower bounded to 0." }, { "trigger": "RemoveCustomAttribute", @@ -7202,14 +7293,14 @@ "annotation": "void ScreenFade(handle player, int red, int green, int blue, int alpha, float fadeTime, float fadeHold, int flags)", "contents": "ScreenFade(${1:handle player}, ${2:int red}, ${3:int green}, ${4:int blue}, ${5:int alpha}, ${6:float fadeTime}, ${7:float fadeHold}, ${8:int flags})$0", "kind": "keyword", - "details": "Start a customisable screenfade. If no player is specified, the fade will apply to all players." + "details": "Start a customisable screenfade. If no player is specified, the fade will apply to all players. For a list of flags, see FFADE constants." }, { "trigger": "ScreenShake", "annotation": "void ScreenShake(Vector vecCenter, float flAmplitude, float flFrequency, float flDuration, float flRadius, int eCommand, bool bAirShake)", "contents": "ScreenShake(${1:Vector vecCenter}, ${2:float flAmplitude}, ${3:float flFrequency}, ${4:float flDuration}, ${5:float flRadius}, ${6:int eCommand}, ${7:bool bAirShake})$0", "kind": "keyword", - "details": "Start a customisable screenshake; eCommand( SHAKE_START = 0, SHAKE_STOP = 1 )." + "details": "Start a customisable screenshake. Set eCommand to 0 to start a shake, or 1 to stop an existing shake." }, { "trigger": "ScriptDebugAddTextFilter", @@ -7279,7 +7370,7 @@ "annotation": "ScriptDebugDrawTextEnabled", "contents": "ScriptDebugDrawTextEnabled$0", "kind": "keyword", - "details": "" + "details": "true" }, { "trigger": "ScriptDebugDrawWatches", @@ -7293,7 +7384,7 @@ "annotation": "ScriptDebugDrawWatchesEnabled", "contents": "ScriptDebugDrawWatchesEnabled$0", "kind": "keyword", - "details": "" + "details": "true" }, { "trigger": "ScriptDebugDumpKeys", @@ -7314,7 +7405,7 @@ "annotation": "ScriptDebugInDebugDraw", "contents": "ScriptDebugInDebugDraw$0", "kind": "keyword", - "details": "" + "details": "false" }, { "trigger": "ScriptDebugIterateKeys", @@ -7391,7 +7482,7 @@ "annotation": "ScriptDebugTextIndent", "contents": "ScriptDebugTextIndent$0", "kind": "keyword", - "details": "" + "details": "0" }, { "trigger": "ScriptDebugTextPrint", @@ -7419,7 +7510,7 @@ "annotation": "ScriptDebugTraceAllOn", "contents": "ScriptDebugTraceAllOn$0", "kind": "keyword", - "details": "" + "details": "false" }, { "trigger": "ScriptDebugTraces", @@ -7507,17 +7598,24 @@ }, { "trigger": "SetAbsVelocity", - "annotation": "void SetAbsVelocity(Vector)", - "contents": "SetAbsVelocity(${1:Vector})$0", + "annotation": "void SetAbsVelocity(Vector velocity)", + "contents": "SetAbsVelocity(${1:Vector velocity})$0", "kind": "keyword", - "details": "Sets the current absolute velocity velocity of the entity" + "details": "Sets the current absolute velocity of the entity" + }, + { + "trigger": "SetActionPoint", + "annotation": "void SetActionPoint(handle entity)", + "contents": "SetActionPoint(${1:handle entity})$0", + "kind": "keyword", + "details": "Set the given action point for this bot" }, { "trigger": "SetAngles", "annotation": "void SetAngles(float pitch, float yaw, float roll)", "contents": "SetAngles(${1:float pitch}, ${2:float yaw}, ${3:float roll})$0", "kind": "keyword", - "details": "Set entity angles." + "details": "Set entity angles. Deprecated, use SetAbsAngles instead." }, { "trigger": "SetAngularVelocity", @@ -7554,6 +7652,13 @@ "kind": "keyword", "details": "Sets if the bot should automatically jump" }, + { + "trigger": "SetBehaviorFlag", + "annotation": "void SetBehaviorFlag(int flags)", + "contents": "SetBehaviorFlag(${1:int flags})$0", + "kind": "keyword", + "details": "Set the given behavior flag(s) for this bot. Does not work." + }, { "trigger": "SetBodygroup", "annotation": "void SetBodygroup(int ID, int value)", @@ -7594,7 +7699,7 @@ "annotation": "void SetCurrency(int amount)", "contents": "SetCurrency(${1:int amount})$0", "kind": "keyword", - "details": "Set player's cash for game modes with upgrades, ie. MvM" + "details": "Set player's cash for game modes with upgrades, ie. MvM. Does not have any bounds checking." }, { "trigger": "SetCurrentTauntMoveSpeed", @@ -7608,7 +7713,7 @@ "annotation": "void SetCustomModel(string model_name)", "contents": "SetCustomModel(${1:string model_name})$0", "kind": "keyword", - "details": "" + "details": "Sets a custom player model without animations (model will T-pose). To enable animations, use SetCustomModelWithClassAnimations instead." }, { "trigger": "SetCustomModelOffset", @@ -7643,7 +7748,7 @@ "annotation": "void SetCustomModelWithClassAnimations(string model_name)", "contents": "SetCustomModelWithClassAnimations(${1:string model_name})$0", "kind": "keyword", - "details": "" + "details": "Sets a custom player model with full animations." }, { "trigger": "SetCustomViewModel", @@ -7759,10 +7864,10 @@ }, { "trigger": "SetGroupSpawnTables", - "annotation": "void SetGroupSpawnTables(table)", - "contents": "SetGroupSpawnTables(${1:table})$0", + "annotation": "void SetGroupSpawnTables(table group, table spawn)", + "contents": "SetGroupSpawnTables(${1:table group}, ${2:table spawn})$0", "kind": "keyword", - "details": "Cache the group spawn tables" + "details": "Unused. This only stores a reference to the two tables which is removed when the point_script_template is deleted." }, { "trigger": "SetHealth", @@ -7827,6 +7932,20 @@ "kind": "keyword", "details": "Sets max vision range override for the bot" }, + { + "trigger": "SetMission", + "annotation": "void SetMission(int mission, bool reset_behavior)", + "contents": "SetMission(${1:int mission}, ${2:bool reset_behavior})$0", + "kind": "keyword", + "details": "Set this bot's current mission to the given mission. Does not work." + }, + { + "trigger": "SetMissionTarget", + "annotation": "void SetMissionTarget(handle entity)", + "contents": "SetMissionTarget(${1:handle entity})$0", + "kind": "keyword", + "details": "Set the bot's mission target to this given entity" + }, { "trigger": "SetModel", "annotation": "void SetModel(string model_name)", @@ -7881,7 +8000,7 @@ "annotation": "void SetOrigin(Vector origin)", "contents": "SetOrigin(${1:Vector origin})$0", "kind": "keyword", - "details": "" + "details": "Deprecated, use SetAbsOrigin instead." }, { "trigger": "SetOvertimeAllowedForCTF", @@ -7953,6 +8072,13 @@ "kind": "keyword", "details": "Sets a pose parameter value. Returns the effective value after clamping or looping." }, + { + "trigger": "SetPrevMission", + "annotation": "void SetPrevMission(int mission)", + "contents": "SetPrevMission(${1:int mission})$0", + "kind": "keyword", + "details": "Set this bot's previous mission to the given mission. Does not work." + }, { "trigger": "SetPropBool", "annotation": "void SetPropBool(handle entity, string propertyName, bool value)", @@ -8175,7 +8301,7 @@ "annotation": "void SetValue(string name, value)", "contents": "SetValue(${1:string name}, ${2:value})$0", "kind": "keyword", - "details": "Sets the value of the convar. The convar must be in cfg/vscript_convar_allowlist.txt to be set. Convars marked as cheat-only can be set even if sv_cheats is off. Supported types are bool, int, float, string." + "details": "Sets the value of the convar. The convar must be in cfg/vscript_convar_allowlist.txt to be set. Convars marked as cheat-only can be set even if sv_cheats is off. Convars marked as dev-only (i.e. not visible in console) can also be set. Supported types are bool, int, float, string. The original value of the convar is saved and is reset on map change, in other words convar changes will not persist across maps." }, { "trigger": "SetVehicleReverseTime", @@ -8189,7 +8315,7 @@ "annotation": "void SetVelocity(Vector velocity)", "contents": "SetVelocity(${1:Vector velocity})$0", "kind": "keyword", - "details": "" + "details": "Deprecated, use SetAbsVelocity instead." }, { "trigger": "SetWaterLevel", @@ -8224,7 +8350,7 @@ "annotation": "void ShowMessage(string message)", "contents": "ShowMessage(${1:string message})$0", "kind": "keyword", - "details": "Print a hud message on all clients" + "details": "Print a hud message on all clients. Non-functional." }, { "trigger": "SnapEyeAngles", @@ -8352,6 +8478,13 @@ "kind": "keyword", "details": "Advance animation frame to some time in the future with a manual interval" }, + { + "trigger": "StunPlayer", + "annotation": "void StunPlayer(float duration, float move_speed_reduction, int flags, handle attacker)", + "contents": "StunPlayer(${1:float duration}, ${2:float move_speed_reduction}, ${3:int flags}, ${4:handle attacker})$0", + "kind": "keyword", + "details": "Stuns the player for a specified duration. Move speed reduction is a fraction (0 = no reduction. 1 = total reduction, no movement). Flag combinations control the stun type and behavior, see the constants page." + }, { "trigger": "TAUNT_BASE_WEAPON", "annotation": "TAUNT_BASE_WEAPON", @@ -8413,7 +8546,7 @@ "annotation": "TEAM_UNASSIGNED", "contents": "TEAM_UNASSIGNED$0", "kind": "keyword", - "details": "0" + "details": "null, This is supposed to be 0." }, { "trigger": "TELEPORT_TO_HINT", @@ -9610,7 +9743,7 @@ "annotation": "TF_DMG_CUSTOM_END", "contents": "TF_DMG_CUSTOM_END$0", "kind": "keyword", - "details": "84" + "details": "86" }, { "trigger": "TF_DMG_CUSTOM_EYEBALL_ROCKET", @@ -9682,6 +9815,20 @@ "kind": "keyword", "details": "75" }, + { + "trigger": "TF_DMG_CUSTOM_KRAMPUS_MELEE", + "annotation": "TF_DMG_CUSTOM_KRAMPUS_MELEE", + "contents": "TF_DMG_CUSTOM_KRAMPUS_MELEE$0", + "kind": "keyword", + "details": "84" + }, + { + "trigger": "TF_DMG_CUSTOM_KRAMPUS_RANGED", + "annotation": "TF_DMG_CUSTOM_KRAMPUS_RANGED", + "contents": "TF_DMG_CUSTOM_KRAMPUS_RANGED$0", + "kind": "keyword", + "details": "85" + }, { "trigger": "TF_DMG_CUSTOM_MERASMUS_DECAPITATION", "annotation": "TF_DMG_CUSTOM_MERASMUS_DECAPITATION", @@ -10307,22 +10454,22 @@ }, { "trigger": "TakeDamage", - "annotation": "void TakeDamage(float flDamage, int nDamageType, handle hAttacker)", - "contents": "TakeDamage(${1:float flDamage}, ${2:int nDamageType}, ${3:handle hAttacker})$0", + "annotation": "void TakeDamage(float flDamage, Constants.FDmgType nDamageType, handle hAttacker)", + "contents": "TakeDamage(${1:float flDamage}, ${2:Constants.FDmgType nDamageType}, ${3:handle hAttacker})$0", "kind": "keyword", "details": "Deals damage to the entity." }, { "trigger": "TakeDamageCustom", - "annotation": "void TakeDamageCustom(handle hInflictor, handle hAttacker, handle hWeapon, Vector vecDamageForce, Vector vecDamagePosition, float flDamage, int nDamageType, Constants.ETFDmgCustom nCustomDamageType)", - "contents": "TakeDamageCustom(${1:handle hInflictor}, ${2:handle hAttacker}, ${3:handle hWeapon}, ${4:Vector vecDamageForce}, ${5:Vector vecDamagePosition}, ${6:float flDamage}, ${7:int nDamageType}, ${8:Constants.ETFDmgCustom nCustomDamageType})$0", + "annotation": "void TakeDamageCustom(handle hInflictor, handle hAttacker, handle hWeapon, Vector vecDamageForce, Vector vecDamagePosition, float flDamage, Constants.FDmgType nDamageType, Constants.ETFDmgCustom nCustomDamageType)", + "contents": "TakeDamageCustom(${1:handle hInflictor}, ${2:handle hAttacker}, ${3:handle hWeapon}, ${4:Vector vecDamageForce}, ${5:Vector vecDamagePosition}, ${6:float flDamage}, ${7:Constants.FDmgType nDamageType}, ${8:Constants.ETFDmgCustom nCustomDamageType})$0", "kind": "keyword", "details": "Extended version of TakeDamageEx that can apply a custom damage type." }, { "trigger": "TakeDamageEx", - "annotation": "void TakeDamageEx(handle hInflictor, handle hAttacker, handle hWeapon, Vector vecDamageForce, Vector vecDamagePosition, float flDamage, int nDamageType)", - "contents": "TakeDamageEx(${1:handle hInflictor}, ${2:handle hAttacker}, ${3:handle hWeapon}, ${4:Vector vecDamageForce}, ${5:Vector vecDamagePosition}, ${6:float flDamage}, ${7:int nDamageType})$0", + "annotation": "void TakeDamageEx(handle hInflictor, handle hAttacker, handle hWeapon, Vector vecDamageForce, Vector vecDamagePosition, float flDamage, Constants.FDmgType nDamageType)", + "contents": "TakeDamageEx(${1:handle hInflictor}, ${2:handle hAttacker}, ${3:handle hWeapon}, ${4:Vector vecDamageForce}, ${5:Vector vecDamagePosition}, ${6:float flDamage}, ${7:Constants.FDmgType nDamageType})$0", "kind": "keyword", "details": "Extended version of TakeDamage." }, @@ -10359,7 +10506,7 @@ "annotation": "float Time()", "contents": "Time()$0", "kind": "keyword", - "details": "Get the current server time" + "details": "Get the current server time in seconds" }, { "trigger": "ToKVString", @@ -10548,7 +10695,7 @@ "annotation": "bool ValidateScriptScope()", "contents": "ValidateScriptScope()$0", "kind": "keyword", - "details": "Ensure that an entity's script scope has been created" + "details": "Ensure that an entity's script scope has been created. In practice, this always returns true unless the script VM is disabled in launch options." }, { "trigger": "Vector", @@ -10639,7 +10786,7 @@ "annotation": "void Weapon_Equip(handle weapon)", "contents": "Weapon_Equip(${1:handle weapon})$0", "kind": "keyword", - "details": "" + "details": "Equips a weapon in the player. This places it inside the m_hMyWeapons array." }, { "trigger": "Weapon_SetLast", @@ -10660,7 +10807,7 @@ "annotation": "void Weapon_Switch(handle weapon)", "contents": "Weapon_Switch(${1:handle weapon})$0", "kind": "keyword", - "details": "" + "details": "Attempts a switch to the given weapon, if present in the player's inventory (m_hMyWeapons array)." }, { "trigger": "Yaw", @@ -10800,7 +10947,7 @@ "annotation": "_intsize_", "contents": "_intsize_$0", "kind": "keyword", - "details": "4" + "details": "32-bit: 4, 64-bit: 8" }, { "trigger": "_version_", @@ -10860,8 +11007,8 @@ }, { "trigger": "atan2", - "annotation": "atan2(num y, num x) (!)", - "contents": "atan2(${1:num y}, ${2:num x) (!})$0", + "annotation": "atan2(num y, num x)", + "contents": "atan2(${1:num y}, ${2:num x})$0", "kind": "keyword", "details": "Returns the angle between the ray from the point (0, 0) through (x, y) and the positive x-axis, confined to (-PI, PI). Note the order of the parameters x and y!" }, @@ -11563,7 +11710,7 @@ "annotation": "rand()", "contents": "rand()$0", "kind": "keyword", - "details": "Returns a random integer with 0 <= rand() <= RAND_MAX" + "details": "Returns a random integer with 0 <= rand() <= RAND_MAX. The value of RAND_MAX is 32768 on Windows, but 2147483647 on Linux. This can cause undeterministic behavior between a server running on Windows vs Linux. Instead, use RandomInt or RandomFloat." }, { "trigger": "readblob", @@ -11852,6 +11999,13 @@ "kind": "keyword", "details": "" }, + { + "trigger": "OnGameEvent_ammo_pickup", + "annotation": "void OnGameEvent_ammo_pickup()", + "contents": "OnGameEvent_ammo_pickup(${1:params}){\r\n\t$0\n}", + "kind": "keyword", + "details": "" + }, { "trigger": "OnGameEvent_arena_match_maxstreak", "annotation": "void OnGameEvent_arena_match_maxstreak()", @@ -12181,6 +12335,13 @@ "kind": "keyword", "details": "" }, + { + "trigger": "OnGameEvent_enter_vehicle", + "annotation": "void OnGameEvent_enter_vehicle()", + "contents": "OnGameEvent_enter_vehicle(${1:params}){\r\n\t$0\n}", + "kind": "keyword", + "details": "" + }, { "trigger": "OnGameEvent_entered_performance_mode", "annotation": "void OnGameEvent_entered_performance_mode()", @@ -12363,6 +12524,13 @@ "kind": "keyword", "details": "" }, + { + "trigger": "OnGameEvent_gameui_activate", + "annotation": "void OnGameEvent_gameui_activate()", + "contents": "OnGameEvent_gameui_activate(${1:params}){\r\n\t$0\n}", + "kind": "keyword", + "details": "" + }, { "trigger": "OnGameEvent_gameui_activated", "annotation": "void OnGameEvent_gameui_activated()", @@ -12370,6 +12538,13 @@ "kind": "keyword", "details": "" }, + { + "trigger": "OnGameEvent_gameui_hide", + "annotation": "void OnGameEvent_gameui_hide()", + "contents": "OnGameEvent_gameui_hide(${1:params}){\r\n\t$0\n}", + "kind": "keyword", + "details": "" + }, { "trigger": "OnGameEvent_gameui_hidden", "annotation": "void OnGameEvent_gameui_hidden()", @@ -12531,6 +12706,13 @@ "kind": "keyword", "details": "" }, + { + "trigger": "OnGameEvent_killed_ball_carrier", + "annotation": "void OnGameEvent_killed_ball_carrier()", + "contents": "OnGameEvent_killed_ball_carrier(${1:params}){\r\n\t$0\n}", + "kind": "keyword", + "details": "" + }, { "trigger": "OnGameEvent_killed_capping_player", "annotation": "void OnGameEvent_killed_capping_player()", @@ -12545,6 +12727,13 @@ "kind": "keyword", "details": "" }, + { + "trigger": "OnGameEvent_leave_vehicle", + "annotation": "void OnGameEvent_leave_vehicle()", + "contents": "OnGameEvent_leave_vehicle(${1:params}){\r\n\t$0\n}", + "kind": "keyword", + "details": "" + }, { "trigger": "OnGameEvent_lobby_updated", "annotation": "void OnGameEvent_lobby_updated()", @@ -12559,6 +12748,13 @@ "kind": "keyword", "details": "" }, + { + "trigger": "OnGameEvent_localplayer_builtobject", + "annotation": "void OnGameEvent_localplayer_builtobject()", + "contents": "OnGameEvent_localplayer_builtobject(${1:params}){\r\n\t$0\n}", + "kind": "keyword", + "details": "" + }, { "trigger": "OnGameEvent_localplayer_changeclass", "annotation": "void OnGameEvent_localplayer_changeclass()", @@ -13980,6 +14176,13 @@ "kind": "keyword", "details": "" }, + { + "trigger": "OnGameEvent_single_player_death", + "annotation": "void OnGameEvent_single_player_death()", + "contents": "OnGameEvent_single_player_death(${1:params}){\r\n\t$0\n}", + "kind": "keyword", + "details": "" + }, { "trigger": "OnGameEvent_slap_notice", "annotation": "void OnGameEvent_slap_notice()", @@ -14050,6 +14253,20 @@ "kind": "keyword", "details": "" }, + { + "trigger": "OnGameEvent_take_armor", + "annotation": "void OnGameEvent_take_armor()", + "contents": "OnGameEvent_take_armor(${1:params}){\r\n\t$0\n}", + "kind": "keyword", + "details": "" + }, + { + "trigger": "OnGameEvent_take_health", + "annotation": "void OnGameEvent_take_health()", + "contents": "OnGameEvent_take_health(${1:params}){\r\n\t$0\n}", + "kind": "keyword", + "details": "" + }, { "trigger": "OnGameEvent_team_info", "annotation": "void OnGameEvent_team_info()", @@ -14442,6 +14659,13 @@ "kind": "keyword", "details": "" }, + { + "trigger": "OnGameEvent_weapon_equipped", + "annotation": "void OnGameEvent_weapon_equipped()", + "contents": "OnGameEvent_weapon_equipped(${1:params}){\r\n\t$0\n}", + "kind": "keyword", + "details": "" + }, { "trigger": "OnGameEvent_winlimit_changed", "annotation": "void OnGameEvent_winlimit_changed()", @@ -14466,7 +14690,7 @@ { "trigger": "ent.m_iHealth", "annotation": "ent.m_iHealth", - "contents": "NetProps.GetPropInt(ent, 'm_iHealth')", + "contents": "NetProps.GetPropInt(ent, \"m_iHealth\")", "kind": "keyword", "details": "Gathers the health of a player." }