Func tow: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created page with "350px|right {{this is a|brush entity|name=func_tow|game=Black Mesa}} This is {{WP|BGM-71 TOW}} used by the HECU. Can be used by player and HECU sold...")
 
No edit summary
 
(14 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{CDA|CFuncTOW|CFuncTank|CBaseEntity|}}
[[File:towiimage.png|350px|right]]
[[File:towiimage.png|350px|right]]
{{this is a|brush entity|name=func_tow|game=Black Mesa}} This is {{WP|BGM-71 TOW}} used by the [[HECU]]. Can be used by player and HECU soldiers. Unlike other entities based on {{ent|func_tank}} entity, this entity needs manual reload after each shoot, the ammunition is {{ent|item_tow_missile}} (must be holded by player, simple touching of this object to {{ent|func_tow}} will not reload this weapon).
{{this is a|brush entity|name=func_tow|game=Black Mesa}} This is {{WP|BGM-71 TOW}} used by the [[HECU]]. Can be used by player and HECU soldiers. Unlike other entities based on {{ent|func_tank}} entity, this entity needs manual reload after each shoot, the ammunition is {{ent|item_tow_missile}} (must be holded by player, simple touching of this object to {{ent|func_tow}} will not reload this weapon). All inputs, outputs and flags are same as {{ent|func_tank}}, properties as well, but some have special notes.
 
{{note|The fire, deploy and reload sounds are hardcoded. You still can change both in your {{bms|1}} mod by replacing the sounds with a blank sounds and playing your own sounds via input/output system.}}
{{note|The fire, deploy and reload sounds are hardcoded. You still can change both in your {{bms|1}} mod by replacing the sounds with a blank sounds and playing your own sounds via input/output system.}}
{{note|Only certain [[NPCs]] ({{ent|npc_human_commander}}, {{ent|npc_human_grenadier}}, {{ent|npc_human_grunt}} and {{ent|npc_human_medic}}) can use this weapon via <code>FindNPCToManTank</code> input. Other will ignore this input.}}
{{note|Only certain [[NPCs]] ({{ent|npc_human_commander}}, {{ent|npc_human_grenadier}}, {{ent|npc_human_grunt}} and {{ent|npc_human_medic}}) can use this weapon via <code>FindNPCToManTank</code> input. Other will ignore this input.}}
{{important|This entity can't be used without model combination (will not fire).}}
{{important|This entity can't be used without model combination (will not fire).}}
{{warning|It is not recommended to use enabled collision for model, it will cause missiles to explode when fired.}}
{{warning|It is not recommended to use enabled collision for model, it will cause missiles to explode when fired.}}
{{bug|NPC's weapon breaks after this gun usage. It doesn't removes, but becomes invisible and unable to shoot (NPC still reload weapon several times, for some reason). This breaks the AI ​​partially, because such NPC still thinks that it have functional weapon. This bug not in {{bms12|4}} (the mod version).}}
{{bug|hidetested=1|NPC's weapon breaks after this gun usage. It doesn't removes, but becomes invisible and unable to shoot (NPC still reload weapon several times, for some reason). This breaks the AI ​​partially, because such NPC still thinks that it have functional weapon. {{not|{{bms12}}}}}}
{{bug|This entity creates laser point. This laser point have issues with rendering, it can be seen through any object. Not in {{bms12|4}} (the mod version).
{{bug|hidetested=1|This entity creates laser point. This laser point have issues with rendering, it can be seen through any object. {{not|{{bms12}}}}
{{expand|title=The bug example.|
{{expand|title=The bug example.|
<br>
<br>
Line 14: Line 16:
}}
}}
}}
}}
{{note|In {{bms12|4}} (the mod version) this entity also have laser beam, not only laser point.
{{bug|hidetested=1|The {{ent|env_laser_dot}} disappears after save reload. {{not|{{bms12}}}}}}
{{expand|title=The bug example.|
{{note|In {{bms12|4}} this entity also have laser beam, not only laser point.
{{expand|title=Example.|
<br>
<br>
<gallery mode=packed heights=310px>
<gallery mode=packed heights=310px>
Line 23: Line 26:
}}
}}
}}
}}
==Dedicated [[ConVars]]==
{{Bms|4|nt=2}}
{{varcom|start}}
{{varcom|sk_detenator_tow_track_acceleration|300|arbitrary number|Missile acceleration.{{bug|Large values may cause missile to disappear.}}}}
{{varcom|sk_detenator_tow_max_speed|3000|arbitrary number|Max missile speed.}}
{{varcom|sk_detenator_tow_intial_speed|1500|arbitrary number|Intial missile speed.{{bug|Large values may cause missile to disappear.}}}}
{{varcom|sk_detenator_tow_plr_dmg|150|arbitrary number|Missile damage scale if it is launched by the player.}}
{{varcom|sk_detenator_tow_plr_dmg_radius|375|arbitrary number|Missile damage radius if it is launched by the player.}}
{{varcom|sk_detenator_tow_npc_dmg|150|arbitrary number|Missile damage scale if it is launched by [[NPC]].}}
{{varcom|sk_detenator_tow_npc_dmg_radius|375|arbitrary number|Missile damage radius if it is launched by [[NPC]].}}
{{varcom|end}}
{{note|All these console commands are not directly related to {{ent|func_tow}} and {{ent|func_tow_mp}}. These console commands are parameters for {{ent|grenade_tow}}.}}
{{Bms12|4}} (the mod version)
{{varcom|start}}
{{varcom|sk_plr_dmg_grenade_tow|150|arbitrary number|Missile damage scale if it is launched by the player.}}
{{varcom|sk_npc_dmg_grenade_tow|150|arbitrary number|Missile damage scale if it is launched by [[NPC]].}}
{{varcom|sk_grenade_tow_airspeed|1500|arbitrary number|Missile air speed.}}
{{varcom|sk_grenade_tow_precision|1|arbitrary number|TOW precision. Doesn't work.}}
{{varcom|end}}
{{note|All these console commands are not directly related to {{ent|func_tow}}. These console commands are parameters for {{ent|grenade_tow}}.}}
==Flags==
{{Fl BaseTank}}


==Keyvalues==
==Keyvalues==
{{KV|Control Volume|intn=control_volume|target_destination|Name of a trigger the player must be inside to control the tank.}}
{{KV|(Team) Master|intn=master|string|Not used for Source. Provided for backwards compatibility with {{ent|multisource}} or {{ent|game_team_master}}.}}
{{KV|Yaw rate|intn=yawrate|string|How fast tank can look left or right.}}
{{KV|Yaw range|intn=yawrange|string|How far tank can turn left or right.}}
{{KV|Yaw tolerance|intn=yawtolerance|string|Additional left-right range. If the gun tries to turn beyond '''Yaw range + Yaw tolerance''', the gun will snap back to the maximum '''Yaw range'''.}}
{{KV|Pitch rate|intn=pitchrate|string|How fast tank can look up or down}}
{{KV|Pitch range|intn=pitchrange|string|How far tank can turn up or down}}
{{KV|Pitch tolerance|intn=pitchtolerance|string|Additional up-down range. If the gun tries to turn beyond '''Pitch range + Pitch tolerance''', the gun will snap back to the maximum '''Pitch range'''.}}
{{KV|Barrel Length|intn=barrel|string|Solid length of the tank barrel. Any part of the barrel beyond this length may clip through objects.}}
{{KV|Barrel Horizontal|intn=barrely|string|How wide the barrel is, horizontally.}}}
{{KV|Barrel Vertical|intn=barrelz|string|How wide the barrel is, vertically.}}
{{KV|Smoke Sprite|intn=spritesmoke|sprite|Smoke sprite to emit when gun fires. {{bug|Transparency may not work.}}}}
{{KV|Flash Sprite|intn=spriteflash|sprite|Flash sprite to emit when gun fires.}}
{{KV|Sprite scale|intn=spritescale|string|Sprite scale for both sprites above.}}
{{KV|Rotate Start Sound|intn=rotatestartsound|sound|Sound to play when tank starts to turn.}}
{{KV|Rotate Loop Sound|intn=rotatesound|sound|Sound to play when tank is turning.}}
{{KV|Rotate Stop Sound|intn=rotatestopsound|sound|Sound to play when tank stops turning.}}
{{KV|Rate of Fire|intn=firerate|string|Number of bullets to fire in a second.}}
{{KV|Damage Per Bullet|intn=bullet_damage|string|How much a single bullet hurts everything except the player. If <code>0</code>, takes amount from the type of bullet/damage.
{{KV|Damage Per Bullet|intn=bullet_damage|string|How much a single bullet hurts everything except the player. If <code>0</code>, takes amount from the type of bullet/damage.
{{bug|Doesn't work. If need your own damage value - use the console commands.}}
:{{bug|hidetested=1|Doesn't work. If you need your own damage value - use the console commands.}}
}}
}}
{{KV|Damage Per Bullet Vs Player|intn=bullet_damage_vs_player|string|How much a single bullet hurts the player only. If <code>0</code>, takes amount from the type of bullet/damage.
{{KV|Damage Per Bullet Vs Player|intn=bullet_damage_vs_player|string|How much a single bullet hurts the player only. If <code>0</code>, takes amount from the type of bullet/damage.
{{bug|Doesn't work. If need your own damage value - use the console commands.}}
:{{bug|hidetested=1|Doesn't work. If you need your own damage value - use the console commands.}}
}}
}}
{{KV|Firing persistence|intn=persistence|string|How many seconds to keep firing at target's last known position after losing [[LOS]] (for NPCs).}}
{{KV|Firing persistence2|intn=persistence2|string|After '''Firing persistence''' is over, how many seconds to periodically fire at target's last known position (for NPCs).}}
{{KV|Bullet accuracy|intn=firespread|choices|How accurately the gun can fire.
{{KV|Bullet accuracy|intn=firespread|choices|How accurately the gun can fire.
:*0: Perfect Shot
:{{bug|hidetested=1|This value can't be changed, {{ent|func_tow}} will use <code>Perfect Shot</code> value in any case.}}
:*1: Small cone
:*2: Medium cone
:*3: Large cone
:*4: Extra-large cone
 
{{bug|This value can't be changed, {{ent|func_tow}} will use <code>Perfect Shot</code> value in any case.}}
}}
}}
{{KV|Minimum target range|intn=minRange|string|Minimum range to target something (for NPCs). If a target is closer than this amount, the NPC will probably switch to any weapon they have on them.}}
{{KV|Maximum target range|intn=maxRange|string|Maximum range to target something (for NPCs). {{confirm|This may actually be the distance for aim assistance instead?}}}}
{{KV|Gun Base Attachment|intn=gun_base_attach|string|If '''Parent''' is specified, this is the attachment point on the parent to aim from.}}
{{KV|Gun Barrel Attachment|intn=gun_barrel_attach|string|If '''Parent''' is specified, this is the attachment point on the parent to fire from. If you specify this, you'll want to specify the '''Gun Base Attachment''' too.}}
{{KV|Gun Yaw Pose Param|intn=gun_yaw_pose_param|string|If '''Parent''' and '''Gun Pitch Pose Param''' are specified, then the gun itself will be invisible and the tank will steer a gun on the parent using the pose parameters.}}
{{KV|Gun Yaw Pose Center|intn=gun_yaw_pose_center|float|The center yaw pose parameter of the gun on the parent.}}
{{KV|Gun Pitch Pose Param|intn=gun_pitch_pose_param|string|If '''Parent''' and '''Gun Yaw Pose Param''' are specified, then the gun itself will be invisible and the tank will steer a gun on the parent using the pose parameters.}}
{{KV|Gun Pitch Pose Center|intn=gun_pitch_pose_center|float|The center pitch pose parameter of the gun on the parent.}}
{{KV|Ammunition Count|intn=ammo_count|integer|Amount of ammo when ''player'' is using. -1 {{=}} unlimited ammo.}}
{{KV|Lead Target|intn=LeadTarget|boolean|Aim ahead to hit moving targets (for NPCs).}}
{{KV|NPC Man Point|intn=npc_man_point|target_destination|Point where NPC must stand to use.}}
{{KV|Post-NPC Attack Grace Period|intn=playergraceperiod|float|If specified, NPC's manning this func tank won't fire at the player, after firing at a non-player, for this amount of time.}}
{{KV|Ignore Grace Upto|intn=ignoregraceupto|float|The player grace period is ignored if the player is under this distance from the tank.}}
{{KV|Player Lock Time|intn=playerlocktimebeforefire|float|The tank must be aiming right on the player for this amount of time before it's allowed to fire.}}
{{KV|Effect Handling|intn=effecthandling|choices|Produce these sound and particle effects when firing.
{{KV|Effect Handling|intn=effecthandling|choices|Produce these sound and particle effects when firing.
:*0: Use Individual Settings.
:*0: Use Individual Settings.
:*1: AR2{{note|Changes the color of the fire light to blue.}}
:*1: AR2{{note|Changes the color of the fire light to blue.}}
:*2: Combine Cannon{{bug|Shooting will cause {{code|DispatchEffect: effect "ChopperMuzzleFlash" not found on client}} error message in the console.}}
:*2: Combine Cannon{{bug|hidetested=1|Shooting will cause {{code|DispatchEffect: effect "ChopperMuzzleFlash" not found on client}} error message in the console.}}
}}
}}
{{KV visiblebrush||b4l4d=1}}
{{KV BaseEntity|brush=1|base=1}}


==Inputs==
==Dedicated [[ConVars]]==
{{I BaseTank}}
See [[Grenade_tow#Dedicated_ConVars|Grenade_tow/Dedicated ConVars]].
{{I visiblebrush|b4l4d=1}}
{{note|All these console commands are not directly related to {{ent|func_tow}}. These console commands are parameters for {{ent|grenade_tow}}.}}
{{I BaseEntity}}
 
==Outputs==
{{O BaseTank}}
{{O BaseEntity}}


==See also==
==See also==

Latest revision as of 03:44, 15 June 2025

C++ Class hierarchy
CFuncTOW
CFuncTank
CBaseEntity
Towiimage.png

func_tow is a brush entity available in Black Mesa Black Mesa. This is Wikipedia icon BGM-71 TOW used by the HECU. Can be used by player and HECU soldiers. Unlike other entities based on func_tank entity, this entity needs manual reload after each shoot, the ammunition is item_tow_missile (must be holded by player, simple touching of this object to func_tow will not reload this weapon). All inputs, outputs and flags are same as func_tank, properties as well, but some have special notes.

Note.pngNote:The fire, deploy and reload sounds are hardcoded. You still can change both in your Black Mesa mod by replacing the sounds with a blank sounds and playing your own sounds via input/output system.
Note.pngNote:Only certain NPCs (npc_human_commander, npc_human_grenadier, npc_human_grunt and npc_human_medic) can use this weapon via FindNPCToManTank input. Other will ignore this input.
Icon-Important.pngImportant:This entity can't be used without model combination (will not fire).
Warning.pngWarning:It is not recommended to use enabled collision for model, it will cause missiles to explode when fired.
Icon-Bug.pngBug:NPC's weapon breaks after this gun usage. It doesn't removes, but becomes invisible and unable to shoot (NPC still reload weapon several times, for some reason). This breaks the AI ​​partially, because such NPC still thinks that it have functional weapon. (not in Black Mesa (mod))
Icon-Bug.pngBug:This entity creates laser point. This laser point have issues with rendering, it can be seen through any object. (not in Black Mesa (mod))
The bug example.


Icon-Bug.pngBug:The env_laser_dot disappears after save reload. (not in Black Mesa (mod))
Note.pngNote:In Black Mesa (mod) Black Mesa (mod) this entity also have laser beam, not only laser point.
Example.


Keyvalues

Damage Per Bullet (bullet_damage) <string>
How much a single bullet hurts everything except the player. If 0, takes amount from the type of bullet/damage.
Icon-Bug.pngBug:Doesn't work. If you need your own damage value - use the console commands.
Damage Per Bullet Vs Player (bullet_damage_vs_player) <string>
How much a single bullet hurts the player only. If 0, takes amount from the type of bullet/damage.
Icon-Bug.pngBug:Doesn't work. If you need your own damage value - use the console commands.
Bullet accuracy (firespread) <choices>
How accurately the gun can fire.
Icon-Bug.pngBug:This value can't be changed, func_tow will use Perfect Shot value in any case.
Effect Handling (effecthandling) <choices>
Produce these sound and particle effects when firing.
  • 0: Use Individual Settings.
  • 1: AR2
    Note.pngNote:Changes the color of the fire light to blue.
  • 2: Combine Cannon
    Icon-Bug.pngBug:Shooting will cause DispatchEffect: effect "ChopperMuzzleFlash" not found on client error message in the console.

Dedicated ConVars

See Grenade_tow/Dedicated ConVars.

Note.pngNote:All these console commands are not directly related to func_tow. These console commands are parameters for grenade_tow.

See also