### LambdaOnBeginMove Source: https://github.com/icystarfrost/lambda-players/wiki/Hooks Called when a Lambda Player starts moving to a position. This hook is server-side. ```APIDOC ## LambdaOnBeginMove ### Description Called when a Lambda Player starts moving to a position. ### Parameters - **lambda** (Entity) - The Lambda Player entity. - **goalposition** (Vector) - The target position the Lambda Player is moving to. - **isonnavmesh** (Bool) - Indicates if the movement is on the navigation mesh. ``` -------------------------------- ### LambdaOnStuck Source: https://github.com/icystarfrost/lambda-players/wiki/Hooks Called when a Lambda Player gets stuck. This hook can be used to make a custom unstuck function. Return "stop" to make the Lambda Player give up in their path or return "continue" to make the Lambda Player continue down their path. This hook is server-side. ```APIDOC ## LambdaOnStuck ### Description Called when a Lambda Player gets stuck. This hook can be used to make a custom unstuck function. Return "stop" to make the Lambda Player give up in their path or return "continue" to make the Lambda Player continue down their path. ### Parameters - **lambda** (Entity) - The Lambda Player entity. - **stucktimes** (Number) - The number of times the Lambda Player got stuck within the last 10 seconds. ``` -------------------------------- ### CreateLambdaConsoleCommand Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Creates a console command that can be registered with Lambda Players, optionally appearing in the Spawn Menu. ```APIDOC ## CreateLambdaConsoleCommand ### Description Creates a console command that can be registered with Lambda Players, optionally appearing in the Spawn Menu. ### Method `CreateLambdaConsoleCommand( name, func, isclient, helptext, settingstbl )` ### Parameters #### Path Parameters - **name** (string) - The Console Command name - **func** (function) - The function that will be called. See https://wiki.facepunch.com/gmod/concommand.Add for function args - **isclient** (bool) - If the Console Command should be Client-Side only - **helptext** (string) - The description of the Console Command - **settingstbl** (Table) - The table to build settings with ### Parameters for settingstbl #### Path Parameters - **name** (String) - Pretty name - **category** (String) - The Lambda Settings category to place the convar into. Will create one if one doesn't exist already ``` -------------------------------- ### Create Lambda Console Command Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Creates a console command that can be registered with Lambda Players, with options for client-side execution and Spawn Menu integration. ```lua CreateLambdaConsoleCommand( name, func, isclient, helptext, settingstbl ) name | string | The Console Command name func | function | The function that will be called See https://wiki.facepunch.com/gmod/concommand.Add for function args isclient | bool | If the Console Command should be Client-Side only helptext | string | The description of the Console Command settingstbl | Table | The table to build settings with ``` -------------------------------- ### Create Lambda Convar Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Creates a ConVar with customizable settings for the Spawn Menu. Use this to add new configurable options to your addon. ```lua CreateLambdaConvar( name, val, shouldsave, isclient, userinfo, desc, min, max, settingstbl ) name | String | The name of the Convar val | String | The default value of the Convar shouldsave | Bool | If the Convar should save isclient | Bool | If the Convar should be client-side only userinfo | Bool | If the server can access the client-side Convar desc | String | The description of the Convar min | Number | The minimum number the Convar can go max | Number | The maximum number the Convar can go settingstbl | Table | The table to build settings with ``` -------------------------------- ### Add Custom Lambda Tool Gun Tool Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Allows adding custom tools that Lambda Players can use with their tool gun. Best combined with Entity Limits if the tool creates entities. ```lua AddToolFunctionToLambdaTools( toolname, func ) toolname | string | The name of the tool. Example, Light. This must have no spaces! func( Entity lambda, Entity targetent ) | function | The function that will be called when a Lambda Player wants to use this tool. First arg is the Lambda using this tool. Second arg is the entity the Lambda wants to use the tool on this is completely optional. ``` -------------------------------- ### Lambda Console Command Settings Table Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Defines variables for the settingstbl to configure console command appearance in the Spawn Menu. ```lua -- Possible settingstbl variables -- These are variables you will have to use in the settingstbl Table. This will build the spawn menu settings name | String | Pretty name category | String | The Lambda Settings category to place the convar into. Will create one if one doesn't exist already ``` -------------------------------- ### VMT File Content Source: https://github.com/icystarfrost/lambda-players/wiki/Coding-Side Create a .vmt file to define the properties of your custom kill icon. The '$baseTexture' should point to your VTF file's path relative to the materials folder, excluding the extension. ```lua UnlitGeneric { "$baseTexture" "PATHTOVTF" "$vertexcolor" 1 "$vertexalpha" 1 "$nolod" 1 "$additive" 1 // hldm style! } ``` -------------------------------- ### Importing Names from TXT File Source: https://github.com/icystarfrost/lambda-players/wiki/Adding-Custom-Content This demonstrates the expected format for a plain text file containing names to be imported into Lambda Players. Ensure the file is placed in the specified data directory. ```plaintext Garry Sora Breen ``` -------------------------------- ### Create Custom Profile Panel Setting Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Allows adding custom variables to the Lambda Player's profile panel for saving and editing. Specify the panel class, variable name, category, and a callback function for panel creation. ```Lua LambdaCreateProfileSetting( panelclass, variablename, category, callback ) ``` -------------------------------- ### LambdaAIInitialize Source: https://github.com/icystarfrost/lambda-players/wiki/Hooks Called when a Lambda Player's AI Initializes and begins to run their states. Called after LambdaOnInitialize. This hook is server-side. ```APIDOC ## LambdaAIInitialize ### Description Called when a Lambda Player's AI Initializes and begins to run their states. Called after LambdaOnInitialize. ### Parameters - **lambda** (Entity) - The Lambda Player entity. ``` -------------------------------- ### Lambda Player Permission Check Source: https://github.com/icystarfrost/lambda-players/blob/master/README.md This snippet demonstrates how Lambda Players check for permission to edit something, highlighting its cleaner and more optimized internal code compared to Zeta Players. ```Lua if not self.Owner:SteamID() or self.Owner:SteamID() == "" then return end ``` -------------------------------- ### Basic Weapon Template Source: https://github.com/icystarfrost/lambda-players/wiki/Coding-Side This is a fundamental template for defining a new weapon within the Lambda Players framework. It includes essential variables for weapon properties. ```lua table.Merge( _LAMBDAPLAYERSWEAPONS, { CLASSNAME = { model = "models/hunter/plates/plate.mdl", origin = "", prettyname = "", holdtype = "", islethal = false, } }) ``` -------------------------------- ### Adding Attack Sound Variable Source: https://github.com/icystarfrost/lambda-players/wiki/Coding-Side This snippet demonstrates adding the 'attack' variable to a weapon definition, which is necessary for the weapon's firing sound. ```lua table.Merge( _LAMBDAPLAYERSWEAPONS, { CLASSNAME = { model = "models/hunter/plates/plate.mdl", origin = "", prettyname = "", holdtype = "", islethal = false, attack = "sound/weapons/pistol_fire.wav", } }) ``` -------------------------------- ### Update Key-Value File Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Updates or creates a file with key-value table data. The type should be 'json' or 'compressed' for encoding the table content. ```lua LAMBDAFS:UpdateKeyValueFile( filename, addcontent, type ) ``` -------------------------------- ### LambdaOnInitialize Source: https://github.com/icystarfrost/lambda-players/wiki/Hooks Called when a Lambda Player initializes. This hook can be used to add onto the ENT:Initialize() hook each Lambda Player has. This hook is server-side and client-side. ```APIDOC ## LambdaOnInitialize ### Description Called when a Lambda Player initializes. This hook can be used to add onto the ENT:Initialize() hook each Lambda Player has. ### Parameters - **lambda** (Entity) - The Lambda Player entity. - **lambdaWeaponEntity** (Entity) - The Lambda Player's weapon entity. ``` -------------------------------- ### LambdaCreateProfileSetting Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Allows adding custom settings to the Profile Panel for Lambda Profiles. You can define custom variables that can be saved and edited. ```APIDOC ## LambdaCreateProfileSetting ### Description Allows adding custom settings to the Profile Panel for Lambda Profiles. You can define custom variables that can be saved and edited. ### Method LambdaCreateProfileSetting( panelclass, variablename, category, callback ) ### Parameters #### Path Parameters - **panelclass** (String) - Required - The classname of the panel to add to the profile panel. Supported values: DTextEntry, DCheckBox, DNumSlider, DColorMixer, DComboBox. - **variablename** (String) - Required - The variable name for the Lambda. For example, "testvar" will add a variable accessible as .testvar on the Lambda Entity. - **category** (String) - Required - The panel category to place the setting in. Settings in the same category will be grouped together. - **callback** (Function) - Required - A function called when the panel is created. It receives the created panel and the category panel as arguments: `callback( createdpanel, parentpanel )`. ``` -------------------------------- ### Zeta Player Permission Check Source: https://github.com/icystarfrost/lambda-players/blob/master/README.md This snippet shows the Find function used in Zeta Players for permission checks, illustrating a less optimized approach compared to Lambda Players. ```Lua function Find( ply ) for i,v in pairs(player.GetAll()) do if v.SteamID == ply.SteamID then return v end end end ``` -------------------------------- ### CreateLambdaColorConvar Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Creates a color convar with customizable settings, which can also appear in the Spawn Menu. ```APIDOC ## CreateLambdaColorConvar ### Description Creates a color convar with customizable settings, which can also appear in the Spawn Menu. This generally has the same args as CreateLambdaConvar(). ### Method `CreateLambdaColorConvar( name, defaultcolor, isclient, userinfo, desc, settingstbl )` ### Parameters #### Path Parameters - **name** (String) - The name of the Convar - **defaultcolor** (Color) - The default Color - **isclient** (Bool) - If the Convar should be client-side only - **userinfo** (Bool) - If the server can access the client-side Convar - **desc** (String) - The description of the Convar - **settingstbl** (Table) - The table to build settings with ### Parameters for settingstbl #### Path Parameters - **type** (String) - Must be one of the following: Slider, Bool, Text, Combo. For Colors, you must use CreateLambdaColorConvar() - **name** (String) - Pretty name - **category** (String) - The Lambda Settings category to place the convar into. Will create one if one doesn't exist already - **decimals** (Number) - Slider only! How much decimals the slider should have - **options** (Table) - Combo only! A table with its keys being the text and values being the data ``` -------------------------------- ### Weapon Table Configuration Source: https://github.com/icystarfrost/lambda-players/wiki/Coding-Side Add the 'killicon' key-value pair to your weapon table to specify the kill icon. This can be an existing icon's entity classname or a custom file path. ```lua killicon | String | The file path to a material ( without the file extension ) to use as the kill icon for this weapon or the alias name of a existing kill icon, example weapon_ar2 is a existing kill icon ``` -------------------------------- ### LambdaAddTextChatKeyWord Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Adds a keyword that will be detected and replaced before a message is sent by a Lambda Player. The replacement is determined by a provided function. ```APIDOC ## LambdaAddTextChatKeyWord ### Description Adds a keyword that will be detected and replaced before a message is sent by a Lambda Player. The replacement is determined by a provided function. ### Method LambdaAddTextChatKeyWord( keyword, replacefunction ) ### Parameters #### Path Parameters - **keyword** (string) - Required - The word that will be detected and replaced. - **replacefunction** (function) - Required - A function that returns the string to replace the keyword with. It receives the Lambda Player as an argument: `replacefunction( Entity lambda )`. ``` -------------------------------- ### Add Custom Lambda Build Function Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Allows adding custom build functions that are called when a Lambda Player intends to build or spawn an item. This is commonly used for functionalities like prop spawning. ```lua AddBuildFunctionToLambdaBuildingFunctions( spawnname, settingname, desc, func ) spawnname | string | The name of this spawn function. This must have no spaces! settingname | string | The name to show in the settings. Example, Allow Prop Spawning desc | string | The description of this build function func( Entity lambda ) | function | The function that will be called when a Lambda Player uses this build function. First arg is the Lambda that used this build function ``` -------------------------------- ### Update Sequential File Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Updates or creates a file with sequential table data. The type should be 'json' or 'compressed' for encoding the table content. ```lua LAMBDAFS:UpdateSequentialFile( filename, addcontent, type ) ``` -------------------------------- ### Read File Content Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Reads content from a file, supporting 'json' or 'compressed' types for direct table return, or nil for raw text. Optionally searches from a specified game path. ```lua LAMBDAFS:ReadFile( filename, type, path ) ``` -------------------------------- ### Lambda Convar Settings Table Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Defines variables for the settingstbl to configure ConVar appearance and behavior in the Spawn Menu. ```lua -- Possible settingstbl variables -- These are variables you will have to use in the settingstbl Table. This will build the spawn menu settings type | String | Must be one of the following: Slider, Bool, Text, Combo. For Colors, you must use CreateLambdaColorConvar() name | String | Pretty name category | String | The Lambda Settings category to place the convar into. Will create one if one doesn't exist already decimals | Number | Slider only! How much decimals the slider should have options | Table | Combo only! A table with its keys being the text and values being the data ``` -------------------------------- ### CreateLambdaConvar Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Creates a convar with customizable settings, which can also appear in the Spawn Menu. ```APIDOC ## CreateLambdaConvar ### Description Creates a convar with customizable settings, which can also appear in the Spawn Menu. ### Method `CreateLambdaConvar( name, val, shouldsave, isclient, userinfo, desc, min, max, settingstbl )` ### Parameters #### Path Parameters - **name** (String) - The name of the Convar - **val** (String) - The default value of the Convar - **shouldsave** (Bool) - If the Convar should save - **isclient** (Bool) - If the Convar should be client-side only - **userinfo** (Bool) - If the server can access the client-side Convar - **desc** (String) - The description of the Convar - **min** (Number) - The minimum number the Convar can go - **max** (Number) - The maximum number the Convar can go - **settingstbl** (Table) - The table to build settings with ### Parameters for settingstbl #### Path Parameters - **type** (String) - Must be one of the following: Slider, Bool, Text, Combo. For Colors, you must use CreateLambdaColorConvar() - **name** (String) - Pretty name - **category** (String) - The Lambda Settings category to place the convar into. Will create one if one doesn't exist already - **decimals** (Number) - Slider only! How much decimals the slider should have - **options** (Table) - Combo only! A table with its keys being the text and values being the data ``` -------------------------------- ### LAMBDAFS:WriteFile Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Writes content to a specified file. It can handle string content directly or table content encoded as JSON or compressed. ```APIDOC ## LAMBDAFS:WriteFile ### Description Writes content to a specified file. It can handle string content directly or table content encoded as JSON or compressed. ### Method `LAMBDAFS:WriteFile( filename, content, type )` ### Parameters #### Path Parameters - **filename** (String) - Required - The file path to write to. See the file.Write() function. - **content** (String or Table) - Required - The string/table content that will be written. If string, you must set the type to nil! If table, you must set the type to either json or compressed! - **type** (string) - Optional - How the provided table should be written. Values are "json" or "compressed". If the content is a string, set this to nil. ``` -------------------------------- ### LAMBDAFS:ReadFile Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Reads content from a specified file. It supports reading files as raw text, JSON, or compressed data, and allows specifying a search path. ```APIDOC ## LAMBDAFS:ReadFile ### Description Reads content from a specified file. It supports reading files as raw text, JSON, or compressed data, and allows specifying a search path. ### Method `LAMBDAFS:ReadFile( filename, type, path )` ### Parameters #### Path Parameters - **filename** (String) - Required - The file path to read from. See the file.Read() function. - **type** (string) - Optional - How should the file be read and returned. Values are "json" or "compressed". For example, if the file you are reading from is a json, input "json" and this function will return the table the json has. Likewise for compressed. Leave nil if you just want the raw text. - **path** (string) - Optional - The Game path to search from. See File Search Paths. Leave nil for the DATA path. ``` -------------------------------- ### Register Custom Voice Type Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Enables the registration of custom voice types for Lambda Players. This function defines a voice type name, its default sound path, and a description for its usage. ```Lua LambdaRegisterVoiceType( voicetypename, defaultpath, voicetypedescription ) ``` -------------------------------- ### LambdaOnLandOnGround Source: https://github.com/icystarfrost/lambda-players/wiki/Hooks Called when a Lambda Player lands on the ground. This hook is server-side. ```APIDOC ## LambdaOnLandOnGround ### Description Called when a Lambda Player lands on the ground. ### Parameters - **lambda** (Entity) - The Lambda Player entity. - **ent** (Entity) - The entity the Lambda Player landed on. ``` -------------------------------- ### Setting Rate of Fire Source: https://github.com/icystarfrost/lambda-players/wiki/Coding-Side This snippet demonstrates setting the 'rateoffire' variable to control how frequently the weapon can be fired. A value of 0.3 means it can fire every 0.3 seconds. ```lua table.Merge( _LAMBDAPLAYERSWEAPONS, { CLASSNAME = { model = "models/hunter/plates/plate.mdl", origin = "", prettyname = "", holdtype = "", islethal = false, attack = "sound/weapons/pistol_fire.wav", spread = 0.02, rateoffire = 0.3, } }) ``` -------------------------------- ### Check if File Key is Valid Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Checks if a specified key exists within a file. The type should be 'json' or 'compressed' for decoding the table. ```lua LAMBDAFS:FileKeyIsValid( filename, key, type ) ``` -------------------------------- ### LAMBDAFS:UpdateSequentialFile Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Updates or creates a new file containing a sequential table. Content is added to the table and encoded as JSON or compressed. ```APIDOC ## LAMBDAFS:UpdateSequentialFile ### Description Updates or creates a new file containing a sequential table. Content is added to the table and encoded as JSON or compressed. ### Method `LAMBDAFS:UpdateSequentialFile( filename, addcontent, type )` ### Parameters #### Path Parameters - **filename** (String) - Required - The file path to write to. See the file.Write() function. - **addcontent** (any) - Required - The content to add to the table. - **type** (string) - Required - How the table should be encoded. Values are "json" or "compressed". ``` -------------------------------- ### LAMBDAFS:UpdateKeyValueFile Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Updates or creates a new file containing a table that uses strings as keys. A key-value pair is added and encoded as JSON or compressed. ```APIDOC ## LAMBDAFS:UpdateKeyValueFile ### Description Updates or creates a new file containing a table that uses strings as keys. A key-value pair is added and encoded as JSON or compressed. ### Method `LAMBDAFS:UpdateKeyValueFile( filename, addcontent, type )` ### Parameters #### Path Parameters - **filename** (String) - Required - The file path to write to. See the file.Write() function. - **addcontent** (table) - Required - A table with a key and a value. The key will be the key written to the file's table which will contain the value of the addcontent table. - **type** (string) - Required - How the table should be encoded. Values are "json" or "compressed". ``` -------------------------------- ### LambdaPlayers_AddItemPickup Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Specifies a function to be called when a Lambda Player 'picks up' a specific entity class. This is used for actions like healing or gaining armor. ```APIDOC ## LambdaPlayers_AddItemPickup ### Description Specifies a function to be called when a Lambda Player 'picks up' a specific entity class. This is used for actions like healing or gaining armor. ### Method LambdaPlayers_AddItemPickup( class, func ) ### Parameters #### Path Parameters - **class** (string) - Required - The entity class to associate the pickup function with. - **func** (function) - Required - The function to be called when the entity is picked up. It receives the Lambda Player and the picked up entity as arguments: `func( Entity lambda, Entity pickedupent )`. ``` -------------------------------- ### Create Lambda Color Convar Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Creates a ConVar specifically for color values, with options for Spawn Menu integration. This is a specialized version of CreateLambdaConvar. ```lua CreateLambdaColorConvar( name, defaultcolor, isclient, userinfo, desc, settingstbl ) defaultcolor | Color | The default Color This generally has the same args as CreateLambdaConvar() ``` -------------------------------- ### Add Entity Pickup Functionality Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Associates a function to be called when a Lambda Player picks up a specific entity class. This is used for actions like healing or gaining armor. ```Lua LambdaPlayers_AddItemPickup( class, func ) ``` -------------------------------- ### Add Custom Text Chat Keyword Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Allows the addition of custom keywords that are replaced before a message is sent by a Lambda Player. A replacement function is provided to determine the replacement string. ```Lua LambdaAddTextChatKeyWord( keyword, replacefunction ) ``` -------------------------------- ### Write File Content Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Writes string or table content to a specified file. For string content, the type must be nil. For table content, the type must be 'json' or 'compressed'. ```lua LAMBDAFS:WriteFile( filename, content, type ) ``` -------------------------------- ### LambdaFootStep Source: https://github.com/icystarfrost/lambda-players/wiki/Hooks This hook is called before a Lambda Player plays their footstep sound. Returning true will block the default footstep sounds. ```APIDOC ## LambdaFootStep( Entity lambda, Vector steppos, Number mattype ) ### Description Called before a Lambda Player plays their footstep sound. Return true to block the default footstep sounds. ### Method Server-Side Hook ### Parameters #### Path Parameters - **lambda** (Entity) - The Lambda Player entity. - **steppos** (Vector) - The position of the footstep. - **mattype** (Number) - The material type of the footstep. See https://wiki.facepunch.com/gmod/Enums/MAT for details. ``` -------------------------------- ### AddUActionToLambdaUA Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Adds a Universal Action to Lambda Players' list of UActions, which can be randomly called during runtime. ```APIDOC ## AddUActionToLambdaUA ### Description Adds a Universal Action to Lambda Players' list of UActions, which can be randomly called during runtime. The provided function will be called with a Lambda Player as its first argument. ### Method `AddUActionToLambdaUA( func( Entity lambda ) )` ### Parameters #### Path Parameters - **func** (function) - The function to be executed as a Universal Action. It receives the Lambda Player entity as its only argument. ``` -------------------------------- ### LambdaPostRecreated Source: https://github.com/icystarfrost/lambda-players/wiki/Hooks This hook is called after a Lambda Player has been recreated. It is invoked after the LambdaPreRecreated hook. ```APIDOC ## LambdaPostRecreated( Entity newlambda ) ### Description Called after a Lambda Player is recreated. ### Method Server-Side Hook ### Parameters #### Path Parameters - **newlambda** (Entity) - Description of the newly recreated Lambda Player entity. ``` -------------------------------- ### LambdaOnLeaveGround Source: https://github.com/icystarfrost/lambda-players/wiki/Hooks Called when a Lambda Player leaves the ground. This hook is server-side. ```APIDOC ## LambdaOnLeaveGround ### Description Called when a Lambda Player leaves the ground. ### Parameters - **lambda** (Entity) - The Lambda Player entity. - **ent** (Entity) - The entity the Lambda Player left the ground from. ``` -------------------------------- ### Create Custom Lambda Entity Limit Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Enables the creation of custom entity limits to restrict specific entity types or ranges. This is useful for managing entities spawned by tool gun tools or build functions. ```lua CreateLambdaEntLimit( name, default, max ) name | string | The name of this limit. This must have no spaces! default | number | The default number this limit should be at max | number | The highest this limit can be set at ``` -------------------------------- ### Create Custom Lambda Personality Type Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Enables the creation of custom personality types for Lambda Players, which are functions with ordered chances that determine actions like building or fighting when the player is idle. ```lua LambdaCreatePersonalityType( personalityname, func ) personalityname | string | The name of this personality. This must have no spaces! func( Entity lambda ) | function | The function that will be called if this personality's chance succeeds a test. First arg is the Lambda who had this personality run ``` -------------------------------- ### LambdaOnRespawn Source: https://github.com/icystarfrost/lambda-players/wiki/Hooks This hook is called when a Lambda Player respawns. ```APIDOC ## LambdaOnRespawn( Entity lambda ) ### Description Called when a Lambda player respawns. ### Method Server-Side Hook ### Parameters #### Path Parameters - **lambda** (Entity) - The Lambda Player entity that is respawning. ``` -------------------------------- ### LambdaOnSwitchWeapon Source: https://github.com/icystarfrost/lambda-players/wiki/Hooks This hook is called when a Lambda Player switches to a new weapon. ```APIDOC ## LambdaOnSwitchWeapon( Entity lambda, Entity wepent, Table weapondata ) ### Description Called when a Lambda switches to a new weapon. ### Method Server-Side Hook ### Parameters #### Path Parameters - **lambda** (Entity) - The Lambda Player entity switching weapons. - **wepent** (Entity) - The weapon entity being switched to. - **weapondata** (Table) - Data associated with the weapon. ``` -------------------------------- ### Add Universal Action to Lambda Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Adds a custom function to Lambda Players' list of Universal Actions, which are randomly called during runtime. ```lua AddUActionToLambdaUA( func( Entity lambda ) ) The function you provide first arg will be a Lambda Player who used your Universal Action ``` -------------------------------- ### Reloading Addon Source: https://github.com/icystarfrost/lambda-players/wiki/Coding-Side Use this command in the developer console to force a reload of your custom weapon addon, useful when Lua files are not automatically refreshed. ```lua lambdaplayers_dev_reloadaddon ``` -------------------------------- ### LambdaAddConditionalKeyWord Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Adds a conditional keyword that tests specific conditions before allowing a text line containing the keyword to be used. ```APIDOC ## LambdaAddConditionalKeyWord ### Description Adds a conditional keyword that tests specific conditions before allowing a text line containing the keyword to be used. ### Method LambdaAddConditionalKeyWord( keyword, conditionfunc ) ### Parameters #### Path Parameters - **keyword** (string) - Required - The word that will be detected. - **conditionfunc** (function) - Required - A function that returns true to allow the text line to be used. It receives the Lambda Player as an argument: `conditionfunc ( Entity lambda )`. ``` -------------------------------- ### LambdaOnPickupEnt Source: https://github.com/icystarfrost/lambda-players/wiki/Hooks This hook is called when a Lambda Player picks up an entity, such as a medkit or armor battery. ```APIDOC ## LambdaOnPickupEnt( Entity lambda, Entity pickupent ) ### Description Called when a Lambda picks up a entity such as picking up a medkit and healing or picking up a armor battery and gaining armor. ### Method Server-Side Hook ### Parameters #### Path Parameters - **lambda** (Entity) - The Lambda Player entity picking up the item. - **pickupent** (Entity) - The entity being picked up. ``` -------------------------------- ### Adding Spread Variable Source: https://github.com/icystarfrost/lambda-players/wiki/Coding-Side This snippet shows how to add the 'spread' variable to a weapon definition to control its accuracy. A lower value results in tighter spread. ```lua table.Merge( _LAMBDAPLAYERSWEAPONS, { CLASSNAME = { model = "models/hunter/plates/plate.mdl", origin = "", prettyname = "", holdtype = "", islethal = false, attack = "sound/weapons/pistol_fire.wav", spread = 0.02, } }) ``` -------------------------------- ### LambdaOnNoclip Source: https://github.com/icystarfrost/lambda-players/wiki/Hooks Called when a Lambda Player wants to change their NoClip state. If DesiredState = true, the Lambda Player wants to noclip. If false, the Lambda Player wants to exit noclip. Return true to completely block the event. This hook is server-side. ```APIDOC ## LambdaOnNoclip ### Description Called when a Lambda Player wants to change their NoClip state. If DesiredState = true, the Lambda Player wants to noclip. If false, the Lambda Player wants to exit noclip. Return true to completely block the event. ### Parameters - **lambda** (Entity) - The Lambda Player entity. - **DesiredState** (Bool) - The desired NoClip state (true to enable, false to disable). ``` -------------------------------- ### Add Conditional Text Chat Keyword Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Enables the addition of keywords that trigger text line usage only if certain conditions are met. A condition function determines whether the text line is allowed. ```Lua LambdaAddConditionalKeyWord( keyword, conditionfunc ) ``` -------------------------------- ### Referencing VMT in Weapon Lua Source: https://github.com/icystarfrost/lambda-players/wiki/Coding-Side Update the 'killicon' field in your weapon's Lua file to reference the VMT file. Provide the path relative to the materials folder, without the file extension. ```lua killicon = "lambdaplayers/killicons/baby" ``` -------------------------------- ### LambdaOnThink Source: https://github.com/icystarfrost/lambda-players/wiki/Hooks Called when a Lambda's ENT:Think() hook runs. This hook can be used to add onto the ENT:Think() hook each Lambda Player has. This hook is server-side and client-side. ```APIDOC ## LambdaOnThink ### Description Called when a Lambda's ENT:Think() hook runs. This hook can be used to add onto the ENT:Think() hook each Lambda Player has. ### Parameters - **lambda** (Entity) - The Lambda Player entity. - **lambdaWeaponEntity** (Entity) - The Lambda Player's weapon entity. - **isDead** (Bool) - Indicates if the Lambda Player is dead. ``` -------------------------------- ### LambdaOnJump Source: https://github.com/icystarfrost/lambda-players/wiki/Hooks This hook is called when a Lambda Player is attempting to jump. Returning true will prevent the Lambda from jumping. ```APIDOC ## LambdaOnJump( Entity lambda ) ### Description Called when a Lambda is attempting to jump. Return true to prevent Lambda from jumping. ### Method Server-Side Hook ### Parameters #### Path Parameters - **lambda** (Entity) - The Lambda Player entity attempting to jump. ``` -------------------------------- ### LambdaPreRecreated Source: https://github.com/icystarfrost/lambda-players/wiki/Hooks Called before a Lambda Player is gonna be removed and recreated. Return true to prevent a copy of the lambda from spawning. Called before LambdaPostRecreated. This hook is server-side. ```APIDOC ## LambdaPreRecreated ### Description Called before a Lambda Player is gonna be removed and recreated. Return true to prevent a copy of the lambda from spawning. Called before LambdaPostRecreated. ### Parameters - **lambda** (Entity) - The Lambda Player entity. ``` -------------------------------- ### LambdaRegisterVoiceType Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Allows registering custom Voice Types that can be used with the `:GetVoiceLine( voicetype )` method. ```APIDOC ## LambdaRegisterVoiceType ### Description Allows registering custom Voice Types that can be used with the `:GetVoiceLine( voicetype )` method. ### Method LambdaRegisterVoiceType( voicetypename, defaultpath, voicetypedescription ) ### Parameters #### Path Parameters - **voicetypename** (string) - Required - The name of the voice type. Should be lowercase letters only, with no spaces. - **defaultpath** (string) - Required - The default directory relative to the "sound" folder for this voice type. Example: `lambdaplayers/vo/taunt`. - **voicetypedescription** (string) - Required - A description of when this voice type is typically used. ``` -------------------------------- ### LambdaOnAttackTarget Source: https://github.com/icystarfrost/lambda-players/wiki/Hooks This hook is called when a Lambda Player begins to attack someone. Returning true will prevent the Lambda from attacking. ```APIDOC ## LambdaOnAttackTarget( Entity lambda, Entity target ) ### Description Called when a Lambda begins to attack someone. Return true to prevent Lambda from attacking. ### Method Server-Side Hook ### Parameters #### Path Parameters - **lambda** (Entity) - The Lambda Player entity initiating the attack. - **target** (Entity) - The entity being targeted for attack. ``` -------------------------------- ### LAMBDAFS:RemoveVarFromKVFile Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Removes a key from a file containing a table that uses strings as keys. The file is expected to be encoded as JSON or compressed. ```APIDOC ## LAMBDAFS:RemoveVarFromKVFile ### Description Removes a key from a file containing a table that uses strings as keys. The file is expected to be encoded as JSON or compressed. ### Method `LAMBDAFS:RemoveVarFromKVFile( filename, key, type )` ### Parameters #### Path Parameters - **filename** (String) - Required - The file path to write to. See the file.Write() function. - **key** (any) - Required - The key to remove from the table. - **type** (string) - Required - How the table should be encoded. Values are "json" or "compressed". ``` -------------------------------- ### LambdaCanSwitchWeapon Source: https://github.com/icystarfrost/lambda-players/wiki/Hooks Called when a Lambda Player wants to switch to a certain weapon. Return true to prevent them from switching to the provided weaponclass. This is only called by SwitchToRandomWeapon() and SwitchToLethalWeapon(). This hook is server-side. ```APIDOC ## LambdaCanSwitchWeapon ### Description Called when a Lambda Player wants to switch to a certain weapon. Return true to prevent them from switching to the provided weaponclass. ### Parameters - **lambda** (Entity) - The Lambda Player entity. - **weaponclass** (String) - The class of the weapon the Lambda Player wants to switch to. - **weapondata** (Table) - Data associated with the weapon. ``` -------------------------------- ### LAMBDAFS:FileKeyIsValid Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Checks if a specified key exists within a file's table. The function requires the file path and the key to check, along with the file's encoding type. ```APIDOC ## LAMBDAFS:FileKeyIsValid ### Description Checks if a specified key exists within a file's table. The function requires the file path and the key to check, along with the file's encoding type. ### Method `LAMBDAFS:FileKeyIsValid( filename, key, type )` ### Parameters #### Path Parameters - **filename** (String) - Required - The file path to write to. See the file.Write() function. - **key** (any) - Required - The key to check. - **type** (string) - Required - How the table is encoded. Values are "json" or "compressed". ``` -------------------------------- ### Check if File Contains Value Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Checks if a file, containing a sequential table, has a specific value. The type should be 'json' or 'compressed' for decoding the table. ```lua LAMBDAFS:FileHasValue( filename, value, type ) ``` -------------------------------- ### LAMBDAFS:RemoveVarFromSQFile Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Removes a value from a file containing a sequential table. The file is expected to be encoded as JSON or compressed. ```APIDOC ## LAMBDAFS:RemoveVarFromSQFile ### Description Removes a value from a file containing a sequential table. The file is expected to be encoded as JSON or compressed. ### Method `LAMBDAFS:RemoveVarFromSQFile( filename, var, type )` ### Parameters #### Path Parameters - **filename** (String) - Required - The file path to write to. See the file.Write() function. - **var** (any) - Required - The value to remove from the table. - **type** (string) - Required - How the table should be encoded. Values are "json" or "compressed". ``` -------------------------------- ### LambdaOnChangeState Source: https://github.com/icystarfrost/lambda-players/wiki/Hooks This hook is called when a Lambda Player is trying to change its state. Returning true will prevent the Lambda from changing state. ```APIDOC ## LambdaOnChangeState( Entity lambda, String oldState, String newState ) ### Description Called when a Lambda is trying to change its state. Return true to prevent Lambda from changing state. ### Method Server-Side Hook ### Parameters #### Path Parameters - **lambda** (Entity) - The Lambda Player entity changing state. - **oldState** (String) - The previous state of the Lambda. - **newState** (String) - The new state the Lambda is changing to. ``` -------------------------------- ### Remove Key from Key-Value File Source: https://github.com/icystarfrost/lambda-players/wiki/Functions Removes a specific key from a file containing a key-value table. The type should be 'json' or 'compressed' for decoding the table. ```lua LAMBDAFS:RemoveVarFromKVFile( filename, key, type ) ``` -------------------------------- ### LambdaCanTarget Source: https://github.com/icystarfrost/lambda-players/wiki/Hooks Called when a Lambda Player wants to know if they can attack someone. Return true to make them not attack the target. This hook is server-side. ```APIDOC ## LambdaCanTarget ### Description Called when a Lambda Player wants to know if they can attack someone. Return true to make them not attack the target. ### Parameters - **Lambda** (Entity) - The Lambda Player entity. - **Target** (Entity) - The potential target entity. ``` -------------------------------- ### LambdaOnOtherInjured Source: https://github.com/icystarfrost/lambda-players/wiki/Hooks Called when someone that is not the Lambda Player takes damage. This hook is server-side. ```APIDOC ## LambdaOnOtherInjured ### Description Called when someone that is not the Lambda Player takes damage. ### Parameters - **lambda** (Entity) - The Lambda Player entity. - **victim** (Entity) - The entity that took damage. - **info** (CTakeDamageInfo) - Information about the damage taken. - **tookdamage** (Bool) - Indicates if the victim actually took damage. ``` -------------------------------- ### LambdaOnRemove Source: https://github.com/icystarfrost/lambda-players/wiki/Hooks Called when a Lambda Player is removed from the game. This hook is server-side and client-side. ```APIDOC ## LambdaOnRemove ### Description Called when a Lambda Player is removed from the game. ### Parameters - **lambda** (Entity) - The Lambda Player entity. ```