Editing TFBot

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 13: Line 13:
MinTargetRange 50 //If set, the task activates only when the target is more than specified units away
MinTargetRange 50 //If set, the task activates only when the target is more than specified units away
</syntaxhighlight>
</syntaxhighlight>
== SpawnTemplate ==
<syntaxhighlight>
SpawnTemplate [$SIGSEGV] //Spawn custom player template
{
Name "Sentry"
Bone "bip_head" //Bone name where the template should be attached to
//Some bone names are listed here:
//bip_head
//bip_spine_2 - used by flag
//bip_hand_L
//bip_hand_R
//weapon_bone_R
//weapon_bone_L
//bip_foot_L
//bip_foot_R
}
</syntaxhighlight>Allows you to spawn [https://steamcommunity.com/sharedfiles/filedetails/?id=2289315026 PointTemplates], which will automatically be parented on the bot this block is on. Does <u>not</u> support global keyvalues. Bone names can also be found using HLMV, which is available by default in your Team Fortress 2/bin folder (which is "above" your tf/ folder).


== ExtAttr ==
== ExtAttr ==
Line 74: Line 55:
Taunt [$SIGSEGV]  //Taunt periodically
Taunt [$SIGSEGV]  //Taunt periodically
{
{
Delay 10 //Time before the first taunt starts (Default: 10)
Cooldown 1 //Time between each taunt (Default: 10)
Repeats 1 //How many times the bot should taunt in total (Default: 0 - Infinite)
Duration 5 //Duration of a looping taunt (Default: 0.1)
Duration 5 //Duration of a looping taunt (Default: 0.1)
Name "Taunt: Kazotsky Kick" //If set, uses this item taunt instead of default
Name "Taunt: Kazotsky Kick" //If set, uses this item taunt instead of default
Line 84: Line 68:
VoiceCommand [$SIGSEGV]  //Periodically uses voice commands
VoiceCommand [$SIGSEGV]  //Periodically uses voice commands
{
{
Delay 8 //Time before the first voice command starts (Default: 10)
Cooldown 5 //Time between each voice command (Default: 10)
Repeats 55 //How many times should bot use the voice command in total (Default: 0 - Infinite)
Type "Medic" //Type of voice command. Possible values:
Type "Medic" //Type of voice command. Possible values:
//Medic
//Medic
Line 117: Line 104:
ChangeAttributes [$SIGSEGV]  //Periodically changes bot attributes, defined in EventChangeAttributes{}
ChangeAttributes [$SIGSEGV]  //Periodically changes bot attributes, defined in EventChangeAttributes{}
{
{
Delay 10 //Time before the first bot attribute change (Default: 10)
Cooldown 10 //Time between each bot attribute change (Default: 10)
Repeats 1 //How many times should bot change attributes in total (Default: 0 - Infinite)
Name "Attr1" //Name of the bot attributes block listed in EventChangeAttributes{}
Name "Attr1" //Name of the bot attributes block listed in EventChangeAttributes{}
}
}
Line 129: Line 119:
// "build 0/1/2/3" - Build dispenser / teleporter entrance / sentry / teleporter exit
// "build 0/1/2/3" - Build dispenser / teleporter entrance / sentry / teleporter exit
// "destroy 0/1/2/3" - Destroy dispenser / teleporter entrance / sentry / teleporter exit
// "destroy 0/1/2/3" - Destroy dispenser / teleporter entrance / sentry / teleporter exit
Delay 1 //Time before the first execution of the task (Default: 10)
Cooldown 5 //Time between each execution of the task (Default: 10)
Repeats 12 //How many times should the task be executed in total (Default: 0 - Infinite)
}
}


Line 204: Line 197:
}
}


</syntaxhighlight>Alternatively, use "custom item model" as a [[List of custom attributes|custom attribute]]. The model has to be precached if it isn't part of the current map. Double-check this if you end up with ERROR models.
</syntaxhighlight>Alternatively, use "custom item model" as a [[List of custom attributes|custom attribute]]. The model has to be precached if it isn't part of the base game.
 
== FireWeapon ==
<syntaxhighlight>
FireWeapon [$SIGSEGV]  //Periodically fires weapon
{
Duration 0.5 //How long should the button be pressed (Default: 0.1)
Type "Secondary" // Type of fire input, Possible values:
//Primary
//Secondary
//Special - MOUSE3
//Reload
//Jump
//Crouch - requires NoCrouchButtonRelease 1 in TFBot
//Action
}
 
</syntaxhighlight>A FireWeapon{} block with <code>Type "Action"</code> can be paired with <code>ExtAttr SuppressCanteenUse</code> to time canteen usage.
 
A FireWeapon{} block with <code>Type "Primary"</code> can be paired with <code>Attributes SuppressFire</code> to control when a bot attacks.
 
== ItemColor ==
<syntaxhighlight>
ItemColor [$SIGSEGV] //Set item color
{
ItemName "The Gunboats"
Red 255
Green 0
Blue 0
}
 
</syntaxhighlight>Note: global keyvalues may not work in this block.
 
== AddCond ==
<syntaxhighlight>
AddCond [$SIGSEGV] //Adds conditions to bots
{
Name "TF_COND_REPROGRAMMED" // Condition to apply.
//Index 43 //Condition index can be used instead
Delay 3 // Delay before the condition activates (Default: 0)
Duration 99 // Duration of the condition effect (Default: -1 - infinite duration)
}
</syntaxhighlight>Note that the default Delay value is 0.
 
Available condition values and names can be found on the [https://wiki.teamfortress.com/wiki/Cheats#addcond TF2 wiki].
 
== DamageAppliesCond ==
<syntaxhighlight>
DamageAppliesCond [$SIGSEGV] //Adds conditions to players on hit
{
Name "TF_COND_URINE" // Condition to apply.
//Index 43 //Condition index can be used instead
Duration 3 // Duration of the condition effect (Default: -1 - infinite duration)
}
 
</syntaxhighlight>Available condition values and names can be found on the [https://wiki.teamfortress.com/wiki/Cheats#addcond TF2 wiki]. Alternatively, use the "add cond on hit" set of [[List of custom attributes|custom attributes]], which can be specified per weapon.
 
== Stripping items ==
<syntaxhighlight>
StripItemSlot 1 [$SIGSEGV] //If set, weapon in specified slot is stripped
//Valid loadout positions:
//0 - LOADOUT_POSITION_PRIMARY
//1 - LOADOUT_POSITION_SECONDARY
//2 - LOADOUT_POSITION_MELEE
//3 - LOADOUT_POSITION_UTILITY
//4 - LOADOUT_POSITION_BUILDING
//5 - LOADOUT_POSITION_PDA
//6 - LOADOUT_POSITION_PDA2
StripItem "Zombie Spy" [$SIGSEGV] // Remove item by name. This can be used to remove cosmetics including zombie cosmetics
 
</syntaxhighlight>
 
== FireInput ==
<syntaxhighlight>
FireInput [$SIGSEGV] // Fires an input to an entity. Target !self and !activator refer to target the bot this block is on.
{
Target "random_color_case*" //Entity name to use
Action "PickRandom" //Input to fire
Param "" //Parameter to use
}
 
</syntaxhighlight>Keep in mind that <code>Repeats</code> defaults to 0, infinite. Specify it as 1 to only fire an input once. The bot will be considered the !activator.
 
== Add- & RemoveAttribute ==
<syntaxhighlight>
AddAttribute [$SIGSEGV]
{
Item "TF_WEAPON_KNIFE" // Item name to which add the attribute, or Player for player attribute, or Active for active weapon
Name "damage bonus" // Attribute name
Value 2 // Attribute value
}
RemoveAttribute [$SIGSEGV]
{
Item "TF_WEAPON_KNIFE" // Item name from which remove the attribute, or Player for player attribute, or Active for active weapon
Name "damage bonus" // Attribute name
}
 
</syntaxhighlight>If multiple attributes should be added or removed at once, it may be preferable to use <code>EventChangeAttributes{}</code> with <code>ChangeAttributes{}</code> instead.
 
== Message ==
<syntaxhighlight>
Message //Displays message in the chat
{
Name "{red}Hello!" //Message in the chat displayed
}
 
</syntaxhighlight>Text colour can also accept hex codes without #, such as <code>FF0000</code> for red.
 
== Sequence ==
<syntaxhighlight>
Sequence [$SIGSEGV]  // Display a sequence animation with a name. Not every animation is supported
{
Name "Run_MELEE" // Name of the sequence
}
 
</syntaxhighlight>Sequence names can be found using HLMV, which is available by default in your Team Fortress 2/bin folder (which is "above" your tf/ folder), or in the Hammer++ Model Browser tool.
 
== WeaponSwitch ==
<syntaxhighlight>
WeaponSwitch [$SIGSEGV]  //Periodically switches weapon
{
Type "Primary" // Weapon slot, possible values:
//Primary
//Secondary
//Melee
//PDA
//Building
}
</syntaxhighlight>


== Visual changes ==
== Visual changes ==
Please note that all contributions to SigMod are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see SigMod:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)