Bot generator: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Updated keyvalues to match FGD (seriously, valve had better documentation) and add some stuff that was missing from the FGD as well. I kept some descriptions from the previous version because they were better.)
m (→‎Keyvalues: Add minor editor comment for the Team KV)
Line 6: Line 6:
==Keyvalues==
==Keyvalues==
{{KV|Team|intn=team|choices|Which team this generator is for.}}
{{KV|Team|intn=team|choices|Which team this generator is for.}}
<!--doesn't seem to use the same values as other ent's Team KVs. Technically, the team KV supports more values than this, but they're just aliases for other values -fiend-->
:* auto : Any
:* auto : Any
:* red : Red
:* red : Red

Revision as of 19:16, 2 May 2024

bot_generator is an e0 available in Team Fortress 2 Team Fortress 2.

Warning.pngWarning:
  • The {{{game}}} parameter is inconsistent with the name defined by the {{tf2}} template. This can most likely be fixed by setting the value of the {{{game}}} parameter to Team Fortress 2.
    If a parameter is consistent but you're still seeing this warning, it may be an issue with the template itself. Please discuss it on the template's talk page.

Entity description

bot_generator generates bots.

Keyvalues

Team (team) <choices>
Which team this generator is for.
  • auto : Any
  • red : Red
  • blue : Blue
  • spectate : Spectator !FGD
Class (class) <choices>
Pick the class to spawn. Picking a specific class will override bot_roster restrictions.
  • auto : Any
  • scout : Scout
  • sniper : Sniper
  • soldier : Soldier
  • demoman : Demoman
  • medic : Medic
  • heavyweapons : Heavy
  • pyro : Pyro
  • spy : Spy
  • engineer : Engineer
Count (count) <integer>
The maximum number of bots to spawn from this generator.
Note.pngNote:values <= 0 will cause an infinite amount of bots to spawn.
Max Active (maxActive) <integer>
Maximum number of bots from this generator that can be active at once from this generator.
Interval (interval) <float>
Number of seconds between bots spawning from this generator.
Action Point (action_point) <targetname>
Set this to have the bot travel to a specific bot_action_point upon spawning if the proper Spawn Command to be set.
Initial Command (initial_command) <choices>
Command the bot should execute upon spawning. No command is executed if left blank
  • goto action point : Go to specified Action Point
  • taunt : Taunt
  • despawn : Leave the game
  • cloak : If Spy, Cloak
  • uncloak : If Spy, Uncloak
  • attack sentry at next action point : Attack sentry gun at next action point
  • disguise : If Spy, Disguse
Suppress Fire (suppressFire) <boolean>
Setting this to Yes will make the bots not attack.
Disable Dodging (disableDodge) <boolean>
Setting this to Yes will prevent the bots from making erratic movements in an effort to dodge.
Action on Death (actionOnDeath) <integer>
When a bot dies, it will do one of these.
  • 0 : Respawn as usual
  • 1 : Remove self
  • 2 : Move to Spectator team
Move to Spectator Team on Death? (spectateOnDeath) <boolean> Obsolete
Deprecated.
This has been superseded by "Action on Death", and is no longer functional.
Use Team Spawn Point (useTeamSpawnPoint) <boolean>
Setting this to Yes will make the bots spawn from an info_player_teamspawn instead of this generator.
Retain Buildings After Disconnect (retainBuildings) <boolean>
If set, any buildings (sentries, sappers, etc) built by bots from this generator will not be destroyed when their owners are removed.
Difficulty (difficulty) <choices>
Set the generated bots' difficulty to this value.
  • -1 : Default
  • 0 : Easy
  • 1 : Normal
  • 2 : Hard
  • 3 : Expert
Don't spawn bots unless triggered (spawnOnlyWhenTriggered) <boolean>
If this is set, you must use the SpawnBot input to have any bots spawn.


Flags

Spawned Bots Ignore Enemy Scouts : [1]
Spawned Bots Ignore Enemy Soldiers : [2]
Spawned Bots Ignore Enemy Pyros : [4]
Spawned Bots Ignore Enemy Demomen : [8]
Spawned Bots Ignore Enemy Heavies : [16]
Spawned Bots Ignore Enemy Medics : [32]
Spawned Bots Ignore Enemy Engineers : [64]
Spawned Bots Ignore Enemy Snipers : [128]
Spawned Bots Ignore Enemy Spies : [256]
Spawned Bots Ignore Enemy Sentry Guns : [512]
Spawned Bots Ignore Scenario Goals : [1024]

Inputs

SetSuppressFire <booleanRedirectInput/boolean>
Set whether spawned TFBots should attack.
SetDisableDodge <booleanRedirectInput/boolean>
Set whether spawned TFBots should dodge.
SetDifficulty <integerRedirectInput/integer>
Change the skill level of spawned TFBots.
CommandGoToActionPoint <targetnameRedirectInput/string>
Commands all bots spawned by this generator to go to the specified bot_action_point.
SetAttentionFocus <targetnameRedirectInput/string>
All bots spawned by this generator will focus exclusively on this entity. If the entity is a bot_action_point, entities within that point's radius will be attended to.
ClearAttentionFocus <targetnameRedirectInput/string>
Remove attention focus restrictions from bots spawned by this generator.
Note.pngNote:Despite claiming to require a target, the input does not use it or require it.
SpawnBot
Attempt to spawn a bot within the rules specified.
RemoveBots
Force remove any bots this entity spawned.
Icon-Bug.pngBug:Appears to only remove half of the bots spawned?  [todo tested in ?]


SetTeam <integerRedirectInput/integer>
Changes the entity's team.

EnableDisable:

Enable / Disable
Enable/disable this entity from performing its task. It might also disappear from view.


Outputs

OnSpawned
Sent when the bot generator has spawned a TFBot,
OnExpended
Sent when the bot generator has reached its limit of the bots it can create.
OnBotKilled
Sent when a bot associated with this bot generator is killed.