Bot npc archer: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Creation of the page.)
 
m (Setting bug notice hidetested=1 param on page where the bug might not need tested in param specified)
 
(14 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:bot_npc_archer}}
{{LanguageBar}}
{{ent not in fgd}}
{{ent not in fgd}}
{{tf2 point|bot_npc_archer}}
{{this is a|model entity|game=Team Fortress 2|name=bot_npc_archer}}
{{CD|CBotNPCArcher|bot_npc_archer.cpp}}


== Entity description ==
== Entity description ==
 
This is a [[NextBot]] using the <code>models\player\sniper.mdl</code> model which wields a Huntsman.  
This is an AI-controlled entity using the <code>models\player\sniper.mdl</code> model which wields a Huntsman. This entity will move only if a valid [[Navigation Meshes|navigation mesh]] exists.
It will go into humiliation pose unless one of the following entities is present on the map:
 
* {{ent|base_boss}}
This entity is '''NOT''' a [[Server-sided Bots|bot]]. As such, it will not take any player slot.
* {{ent|eyeball_boss}}
 
* {{ent|headless_hatman}}
== Behavior ==
* {{ent|merasmus}}
 
* {{ent|tank_boss}}
Once spawned, this entity will always rejoin its original spawn point before it can attack, unless there is not any valid [[Navigation Meshes|navigation mesh]] file.
If at least one of those entities exists, the archer will shoot any BLU player which can be attacked. The NPC aims for heads and aims ahead in case a target is moving. When a BLU player is killed by a headshot from this entity, the kill feed will display an environmental headshot death icon. In the case of a bodyshot, a regular environmental death will be shown. Despite first appearances, this NPC is teamless, and can take ''and'' give damage to RED ''or'' BLU players. A similar teamless state has been seen with poor coding.
 
{{bug|hidetested=1|The entity does not compensate for gravity when shooting.}}
 
{{bug|hidetested=1|When spawned using the {{ent|ent_create|bot_npc_archer}} command, this entity will try to go to the origin of the map, if a [[NAV]] file is present. This is because the command causes the game to spawn the entity to the origin of the map, and then teleports it to where the player is looking (if possible).}}
It will go into humiliation pose unless if one of the following entities is present on the map:
* base_boss
* [[eyeball_boss]]
* [[headless_hatman]]
* [[merasmus]]
* [[tank_boss]]
 
If at least one of those entities exists, the archer will shoot any BLU player which can be attacked.
{{note|The entity aims the BLU players heads and according to the player's speed. As such, he can kill moving targets.}}
{{bug|The entity does not compensate for gravity when shooting. The archer will still attempt to shoot at very far targets but his arrows will always miss.}}
 
{{bug|When spawned using the <code>ent_create bot_npc_archer</code> command, this entity will try to rejoin the origin of the map, if a [[Navigation Meshes|navigation mesh]] file is present. This is because the command causes the game to spawn the entity to the origin of the map, and then teleports it to where the player is looking (if possible).}}
 
 
{{note|When a BLU player is killed by a headshot from this entity, the kill feed will display an environmental headshot death icon. In the case of a bodyshot, a regular environmental death will be shown.}}


== Dedicated console variables ==
== Dedicated console variables ==
{{varcom|start}}
{{varcom|tf_bot_npc_archer_arrow_damage|75|arbitrary [[float]]|Determines the arrow damage of NPC archer arrows.}}
{{varcom|tf_bot_npc_archer_health|100|arbitrary [[integer]]|Determines the health of NPC archer bots.}}
{{varcom|tf_bot_npc_archer_shoot_interval|2|arbitrary [[float]]|Determines the interval at which NPC archer bots fire.}}
{{varcom|tf_bot_npc_archer_speed|100|arbitrary [[integer]]|Unused.}}
{{varcom|end}}


 
[[Category:NextBot Entities]]
* '''tf_bot_npc_archer_arrow_damage <[[integer|int]]>''' ''(Default: 75)''
The amount of damage of each arrow.
{{note|This is the amount of damage for bodyshots.}}
 
 
* '''tf_bot_npc_archer_health <[[integer|int]]>''' ''(Default: 100)''
The amount of health of the entity.
{{note|The new value is '''NOT''' applied to archers that already exist.}}
 
 
* '''tf_bot_npc_archer_shoot_interval''' <[[integer|int]]> ''(Default: 2)''
After shooting an arrow, the entity will not shoot again for this delay.
{{note|Setting a very small value will cause the entity to shoot quickly and then to wait shortly regardless of the specified value.}}
 
 
* '''tf_bot_npc_archer_speed <[[integer|int]]>''' ''(Default: 100)''
The speed of the entity when it moves.
{{bug|This variable does not work.}}
 
== Keyvalues ==
 
'''targetname <[[String|string]]>'''
 
The [[Targetname|targetname]] that other entities refer to this entity by.
 
 
'''teamnum <[[integer|int]]>'''
 
The team of the entity.
 
{{bug|This entity will never target RED players and will always target BLU players regardless of its team.}}
{{note|The skin of the entity's model is independant of its team number.}}
 
 
'''skin <[[integer|int]]>'''
 
The skin for the entity's model.
 
== Inputs ==
 
{{todo|Complete this section.}}
 
== Outputs ==
 
'''OnIgnite'''
 
Fired when this entity is ignited.

Latest revision as of 07:16, 20 May 2025

English (en)Translate (Translate)
Icon-NotInFGD.png
This entity is not in the FGD by default.
See below for instructions on making it available.

bot_npc_archer is a model entity available in Team Fortress 2 Team Fortress 2.

C++ Class hierarchy
CBotNPCArcher
NextBotCombatCharacter
CBaseCombatCharacter
CBaseFlex
CBaseAnimatingOverlay
CBaseAnimating
CBaseEntity

Entity description

This is a NextBot using the models\player\sniper.mdl model which wields a Huntsman. It will go into humiliation pose unless one of the following entities is present on the map:

If at least one of those entities exists, the archer will shoot any BLU player which can be attacked. The NPC aims for heads and aims ahead in case a target is moving. When a BLU player is killed by a headshot from this entity, the kill feed will display an environmental headshot death icon. In the case of a bodyshot, a regular environmental death will be shown. Despite first appearances, this NPC is teamless, and can take and give damage to RED or BLU players. A similar teamless state has been seen with poor coding.

Icon-Bug.pngBug:The entity does not compensate for gravity when shooting.
Icon-Bug.pngBug:When spawned using the ent_create bot_npc_archer command, this entity will try to go to the origin of the map, if a NAV file is present. This is because the command causes the game to spawn the entity to the origin of the map, and then teleports it to where the player is looking (if possible).

Dedicated console variables

Cvar/Command Parameters or default value Descriptor Effect
tf_bot_npc_archer_arrow_damage 75 arbitrary float Determines the arrow damage of NPC archer arrows.
tf_bot_npc_archer_health 100 arbitrary integer Determines the health of NPC archer bots.
tf_bot_npc_archer_shoot_interval 2 arbitrary float Determines the interval at which NPC archer bots fire.
tf_bot_npc_archer_speed 100 arbitrary integer Unused.