Custom Entities: Difference between revisions

From SigMod
Jump to navigation Jump to search
(new entities)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:


== $tf_bot_spawn ==
== $tf_bot_spawn ==
Tries to spawn a tf_bot at its location. If spawning succeds, deletes itself, otherwise tries again next tick. Uses the robot player pool, and is affected by RobotLimit keyvalue. The spawned bot inherits this entity targetname, all its custom outputs and variables, teamnum, angles, velocity. If this entity is parented, the spawned player will be [[Entity Modules|fake parented]] to this entity parent.
Tries to spawn a tf_bot with given TFBot keyvalues at its location. If spawning succeds, deletes itself, otherwise tries again next tick. Uses the robot player pool, and is affected by RobotLimit keyvalue. The spawned bot inherits this entity targetname, all its custom outputs and variables, teamnum, angles, velocity. If this entity is parented, the spawned player will be [[Entity Modules|fake parented]] to this entity parent.


=== Inputs ===
=== Inputs ===
Line 7: Line 7:
** Spawns a bot, used when manual bot spawning is enabled.
** Spawns a bot, used when manual bot spawning is enabled.
===Keyvalues===
===Keyvalues===
* =(keyvalue) <value>
** Sets a TFBot spawner keyvalue. Only simple key value pairs are allowed
*$spawnlimit <int>
*$spawnlimit <int>
**A maximum number of bots spawned from $tf_bot_spawn entities active at one. By default there is no limit
**A maximum number of bots spawned from $tf_bot_spawn entities active at one. By default there is no limit
Line 32: Line 36:


== $tf_bot ==
== $tf_bot ==
Creates a new tf_bot directly, if player limit is not reached. The classname is changed to player after spawning. Inherits all player Inputs/Outputs. The bot is kicked when the entity is removed
Creates a new tf_bot with given TFBot keyvalues directly, if player limit is not reached. The classname is changed to player after spawning. Inherits all player Inputs/Outputs. The bot is kicked when the entity is removed


===Keyvalues===
===Keyvalues===
* =(keyvalue) <value>
** Sets a TFBot spawner keyvalue. Only simple key value pairs are allowed
*$kickafterdeathdelay <float>
*$kickafterdeathdelay <float>
**Kicks the bot after specified delay. If the bot is not kicked after death, it will be send to spectator and used in a robot player pool
**Kicks the bot after specified delay. If the bot is not kicked after death, it will be send to spectator and used in a robot player pool

Latest revision as of 10:17, 22 November 2023

$tf_bot_spawn[edit | edit source]

Tries to spawn a tf_bot with given TFBot keyvalues at its location. If spawning succeds, deletes itself, otherwise tries again next tick. Uses the robot player pool, and is affected by RobotLimit keyvalue. The spawned bot inherits this entity targetname, all its custom outputs and variables, teamnum, angles, velocity. If this entity is parented, the spawned player will be fake parented to this entity parent.

Inputs[edit | edit source]

  • $Spawn
    • Spawns a bot, used when manual bot spawning is enabled.

Keyvalues[edit | edit source]

  • =(keyvalue) <value>
    • Sets a TFBot spawner keyvalue. Only simple key value pairs are allowed
  • $spawnlimit <int>
    • A maximum number of bots spawned from $tf_bot_spawn entities active at one. By default there is no limit
  • $spawnlimitname <string>
    • If set, $spawnlimit only counts bots spawned by $tf_bot_spawn entities, that also have the same spawn limit name
  • $spawnlimitaction <string>
    • What to do when a $spawnlimit is reached. By default, the additional bot refuses to spawn. Possible values:
      • killoldest - Kills the oldest bot spawned by $tf_bot_spawn
      • specoldest - Send the oldest bot spawned by $tf_bot_spawn to spectator team
  • $disallowspawnstuck <1/0> (Default: 0)
    • Prevent the bot from being spawned if there is no room for the spawned bot
  • $nospawnbetwenenwaves <1/0> (Default: 0)
    • Prevent the bot from being spawned if the wave is not running
  • $failspawnnoretry <1/0> (Default: 0)
    • If spawning fails, remove itself
  • $manualspawn <1/0> (Default: 0)
    • Do not spawn a bot automatically, require $Spawn input to spawn a bot

Output[edit | edit source]

  • $onbotspawn
    • Called when the bot is spawned. The spawned bot is the !activator
  • $onbotspawnfail
    • Called every time this entity fails to spawn a bot

$tf_bot[edit | edit source]

Creates a new tf_bot with given TFBot keyvalues directly, if player limit is not reached. The classname is changed to player after spawning. Inherits all player Inputs/Outputs. The bot is kicked when the entity is removed

Keyvalues[edit | edit source]

  • =(keyvalue) <value>
    • Sets a TFBot spawner keyvalue. Only simple key value pairs are allowed
  • $kickafterdeathdelay <float>
    • Kicks the bot after specified delay. If the bot is not kicked after death, it will be send to spectator and used in a robot player pool

$func_block_los[edit | edit source]

Blocks line of sight

Keyvalues[edit | edit source]

  • $filter <string>
    • Name of a filter that allows for blocking vision of specific bots

$trigger_detector[edit | edit source]

Checks for entities inside the trigger and the radius (if specified). The closest entity to the origin inside the trigger is marked as target. Shares inputs and outputs with trigger_multiple

Keyvalues[edit | edit source]

  • $checklineofsight <1/0> (Default: 0)
    • Should the line of sight between the detector origin and the target be clear.
  • $radius <number> (Default: 65000)
    • Maximum distance between the the detector origin and the target
  • $fov <number> (Default: 180)
    • If set, only detect entities in field of view angle defined in degrees
  • $keeptarget <1/0> (Default: 0)
    • Should the detector keep targeting the entity as long as it remains in range, even if there is another closer suitable target

Inputs[edit | edit source]

  • $TargetTest
    • Check if there is a detectable entity inside the the detector

Outputs[edit | edit source]

  • $OnNewTarget
    • Fired when a new target is being found. The new target is the !activator
  • $OnLostTarget
    • Fired when the target is no longer in range, or a new target is being choosen. The lost target is the !activator
  • $OnLostTargetAll
    • Fired when there are no more targets in range
  • $TargetTestPass
    • Fired after $TargetTest input if there is an entity in range currently detected by the detector. The detected entity is the !activator
  • $TargetTestFail
    • Fired after $TargetTest input if there are no entities in range detected by the detector

$weapon_spawner[edit | edit source]

Spawns dropped weapons

Keyvalues[edit | edit source]

  • $item <string>
    • Name of the item to spawn
  • $nomotion <1/0> (Default: 0)
    • Spawn items without gravity
  • $ammo <number> (Default: -1)
    • Spawn with this much ammo
  • $clip <number> (Default: -1)
    • Spawn with this much ammo in the clip
  • $energy <number>
    • Spawn with custom amount of energy in (0-1) range
  • $charge <number>
    • Spawn with custom medigun charge amount in (0-1) range
  • $lifetime <number> (Default: 30)
    • Lifetime of the dropped weapon in seconds

Inputs[edit | edit source]

  • $DropWeapon
    • Drop weapon

Outputs[edit | edit source]

  • $OnPickup
    • Fired when a player picks up the weapon. The player is the !activator

$entity_spawn_detector[edit | edit source]

Detects if an entity with a specified classname had spawned

Keyvalues[edit | edit source]

  • $name <string>
    • Name of the classname to check

Outputs[edit | edit source]

  • $OnEntitySpawned
    • Fired when an entity with the specified classname spawns. The spawned entity is the !activator

$filter_keyvalue[edit | edit source]

Custom filter that lets you filter entities matching the key value. Shares inputs with filter_base entity

Keyvalues[edit | edit source]

  • $name <string>
    • Name of the key to compare, example: health
  • $value <any>
    • Value to compare against
  • $compare <string>
    • The condition for passing the filter. Should only be set for numeric values.
    • Possible values:
      • equal
      • less than
      • greater than
      • less than or equal
      • greater than or equal

$filter_variable[edit | edit source]

Custom filter that lets you filter entities matching the custom entity variable (declared by firing $SetVar$variablename input of the entity). Shares inputs with filter_base entity

Keyvalues[edit | edit source]

  • $name <string>
    • Name of the variable to compare, example: myvar
  • $value <any>
    • Value to compare against
  • $compare <string>
    • The condition for passing the filter. Should only be set for numeric values.
    • Possible values:
      • equal
      • less than
      • greater than
      • less than or equal
      • greater than or equal

$filter_datamap[edit | edit source]

Custom filter that lets you filter entities matching the datamap prop. Shares inputs with filter_base entity

Keyvalues[edit | edit source]

  • $name <string>
    • Name of the variable to compare, example: m_iHealth
  • $value <any>
    • Value to compare against
  • $compare <string>
    • The condition for passing the filter. Should only be set for numeric values.
    • Possible values:
      • equal
      • less than
      • greater than
      • less than or equal
      • greater than or equal

$filter_sendprop[edit | edit source]

Custom filter that lets you filter entities matching the send prop. Shares inputs with filter_base entity

Keyvalues[edit | edit source]

  • $name <string>
    • Name of the variable to compare, example: m_nCurrency
  • $value <any>
    • Value to compare against
  • $compare <string>
    • The condition for passing the filter. Should only be set for numeric values.
    • Possible values:
      • equal
      • less than
      • greater than
      • less than or equal
      • greater than or equal

$filter_proximity[edit | edit source]

Custom filter that lets you filter entities by proximity to the target entity

Keyvalues[edit | edit source]

  • $target <string>
    • Name of the target entity, or coordinates in x y z format
  • $range <number>
    • Maximum distance to pass the filter

$filter_bbox[edit | edit source]

Custom filter that lets you filter entities inside a bounding box

Keyvalues[edit | edit source]

  • $target <string>
    • Name of the target entity or coordinates in x y z format
  • $min <vector>
    • the negative box bounds in x y z format
  • $max <vector>
    • the positive box bounds in x y z format

$filter_itemname[edit | edit source]

Custom damage filter that filters damage by the weapon item name and others

Keyvalues[edit | edit source]

  • $item <string>
    • Name of the weapon to filter against
  • $type <string>
    • What to test against. Possible values:
      • ItemName (default)
      • Classname
      • SimilarToItem
      • ItemSlot
      • DefIndex

$filter_specialdamagetype[edit | edit source]

Custom damage filter that filters damage by the existence of "special damage type" attribute of the weapon

Keyvalues[edit | edit source]

  • $type <number>
    • Number of the special damage type required to pass the trigger

$script_manager[edit | edit source]

Executes lua scripts. single $script_manager entity with targetname popscript is created when a mission includes lua code. When created manually, this entity persists after map reset, and executes scripts after spawn

Keyvalues[edit | edit source]

  • $scriptfile <string>
    • Script files separated by comma to be executed when this entity spawns
  • $scrips <string>
    • Script to be executed when this entity spawns

Inputs[edit | edit source]

  • $ExecuteScript <string>
    • Executes script provided in the string
  • $ExecuteFile <string>
    • Executes script file
  • $<function name> <any>
    • Calls a named global function with parameters: provided value, activator, caller

$bot_npc[edit | edit source]

Customizable npc bot that does not consume bot slots

Keyvalues[edit | edit source]

  • $class <string>
    • Mimic a given player class (sniper by default)
  • $movespeed <float>
  • $duckmovespeed <float>
  • $acceleration <float>
  • $deceleration <float>
  • $jumpheight <float>
  • $gravity <float>
  • $skill <easy/normal/hard/expert>
  • $aimtrackinginterval <float>
  • $aimleadtime <float>
  • $headrotatespeed <float>
  • $autojumpmintime <float>
  • $autojumpmaxtime <float>
  • $forceduck <1/0>
  • $forceshoot <1/0>
  • $disableshoot <1/0>
  • $freeze <1/0>
  • $ignoreenemies <1/0>
  • $dodge <1/0>
  • $notsolidtoplayers <1/0>
  • $ignoreclips <1/0>
  • $allowtakefriendlyfire <1/0>
  • $handattackdamage <float>
  • $handattacktime <float>
  • $handattackrange <float>
  • $handattacksize <float>
  • $handattackforce <float>
  • $handattacksmacktime <float>
  • $handattackcleave <1/0>
  • $handattackicon <string>
  • $handattacksound <string>
  • $handattacksoundmiss <string>
  • $crits <1/0>
  • $hurtsound <1/0>
  • $deathsound <string>
  • $nofootsteps <1/0>
  • $footstepsound <string>
  • $waituntilfullreload <1/0>
  • $deatheffecttype <gib/ragdoll/default/none>
  • $robot <1/0>
  • $zombie <1/0>
  • $giant <1/0>
  • $model <string>
  • $useplayercollisionbounds <1/0>

Inputs[edit | edit source]

  • $GiveWeapon <string/entity>
    • Give item with given name, or give item entity directly
  • $RemoveWeapon <string/entity>
    • Remove item with given name, or give item entity directly
  • $RemoveAllWeapons
  • $SetHealth
  • $SetMaxHealth
  • $StartActivity <string>
  • $StartSequence <string>
  • $AddGestureActivity <string>
  • $RestartGestureActivity <string>
  • $AddGestureSequence <string>
  • $RemoveGesture <string>
  • $RemoveAllGesture
  • $StopActivityOrSequence
  • $SwitchClass <string>
  • $BotCommand <string>