Advertisement
henke37

tf/scripts/population/example/example.pop

Aug 16th, 2012
530
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.00 KB | None | 0 0
  1. // This .pop file defines a Population, and is usually owned and
  2. // controlled by the tf_populator entity.
  3. //
  4. // Populations consist of one or more Populators.
  5. // All Populators in a .pop file run simultaneously unless stated otherwise.
  6. // For example, if you have three PeriodicSpawn populators, all three
  7. // will be spawning entities according to their parameters.
  8. //
  9. // In general, Populators contain one Spawner. When a Spawner is invoked,
  10. // it actually spawns one or more entities into the world.
  11.  
  12. // NOTE: This particular .pop file is for documentation purposes, and
  13. // tries to show all available features, not necessarily a useful population.
  14. //
  15.  
  16. // Available Global Options (specified outside Populators):
  17. //
  18. // StartingCurrency <amount>
  19. // Specifies the amount of currency that players should start with
  20. //
  21.  
  22. // Templates are specified in a separate block of Templates, and then referenced
  23. // inside WaveSpawn or TFBot entries.
  24.  
  25. // Available Populators:
  26. //
  27. // RandomPlacement
  28. // A RandomPlacement Populator is invoked once at the start
  29. // of each round, and spawns entities at random locations
  30. // throughout the map. For example, a RandomPlacement might
  31. // place random Sentry guns throughout a map.
  32. //
  33. // PeriodicSpawn
  34. // A PeriodicSpawn Populator invokes its Spawner periodically.
  35. // For example, a PeriodicSpawn might spawn a TFBot every 30 seconds.
  36. //
  37. // WaveSpawn
  38. // A WaveSpawn Populator spawns a "wave" of N entities, and has
  39. // the special property that only ONE WaveSpawn at a time in a
  40. // .pop file is active - the first one. Once that WaveSpawn is
  41. // finished, it shuts off and the next WaveSpawn in the file
  42. // becomes active, and so on.
  43. //
  44.  
  45.  
  46. // Available Spawners:
  47. //
  48. // TFBot
  49. // Spawns TFBots of a specified class and skill.
  50. //
  51. // SentryGun
  52. // Spawns unowned Sentry guns at a specified upgrade level.
  53. //
  54. // RandomChoice
  55. // Contains a set of spawners and invokes one at random.
  56. //
  57. // Squad
  58. // Contains a set of spawners, all are invoked and collected into a "squad".
  59. //
  60. // Mob
  61. // Spawns N instances of the spawner it contains, ie: 15 TFBots.
  62. //
  63.  
  64.  
  65. ExamplePopulation
  66. {
  67. // Global options
  68. StartingCurrency 100 // Players start with 100 bucks
  69. RespawnWaveTime 12 // Override default respawn time as if it was being set with entity i/o
  70. CanBotsAttackWhileInSpawnRoom no // Default if omitted is "yes". Set to "no" to prevent bots from attacking while invulnerable in their spawn rooms
  71. AddSentryBusterWhenDamageDealtExceeds 3000 // Default is ommited is 3000 points of damage inflicted by your sentry gun. Set this to override the threshold at which a Sentry Buster will be dispatched.
  72. AddSentryBusterWhenKillCountExceeds 15 // Default is ommited is 15 kills inflicted by your sentry gun. Set this to override the threshold at which a Sentry Buster will be dispatched.
  73. Advanced 1 // Flags this experienced as difficult. Things like achievements look for this.
  74.  
  75. Templates
  76. {
  77. // A template for a TFBot entry that creates a Natascha wielding Heavy.
  78. T_TFBot_NataschaHeavy
  79. {
  80. Class HeavyWeapons
  81. Skill Easy
  82. Attributes RemoveOnDeath
  83. Item "Natascha"
  84. Item "Football Helmet"
  85. }
  86.  
  87. // A template for a WaveSpawn creates 5 Natascha wielding Heavies.
  88. // - Note that you can reference other templates inside templates.
  89. // - In this example, the wave spawn template overrides the skill of the Heavies to be Normal (which the Template has initialized as Easy)
  90. T_WaveSpawn_Heavies
  91. {
  92. TotalCount 5
  93. MaxActive 1
  94. WaveDoneWhen AllDead
  95.  
  96. TFBot
  97. {
  98. Template T_TFBot_NataschaHeavy
  99. Skill Normal
  100. }
  101. }
  102.  
  103. // A template for a WaveSpawn that creates Pyros, and drops lots of money.
  104. T_WaveSpawn_MoneyPyros
  105. {
  106. Template T_WaveSpawn_Heavies
  107.  
  108. TotalCurrency 2000
  109.  
  110. // WARNING NOTE: This block overrides the entire TFBot block in T_WaveSpawn_Heavies.
  111. // i.e. this will NOT result in Pyros wielding natachas & helmets & being restricted to melee only.
  112. TFBot
  113. {
  114. Class Pyro
  115. }
  116. }
  117. }
  118.  
  119. // A "mission" defines a set of TFBots that the "AI Director" can send in to accomplish certain context-specific goals
  120. Mission
  121. {
  122. Objective Sniper // The mission objective. Available missions: "Sniper" (add harassing snipers), "Spy" (add harassing spies), and "DestroySentries" (send in bots who focus on killing overly successful sentry guns)
  123.  
  124. Where spawn_sniper_mission // Where the mission bots will spawn
  125.  
  126. BeginAtWave 4 // The wave number (1 to N) at which this mission becomes active
  127. RunForThisManyWaves 3 // How many waves this mission is active. This example would have snipers active for waves 4, 5, and 6
  128.  
  129. CooldownTime 90 // The minimum time between spawning mission sorties
  130. DesiredCount 2 // How many copies of the spawner should be sent in
  131.  
  132. TFBot // The mission payload
  133. {
  134. Class Sniper
  135. Skill Hard
  136. Name Sniper
  137. }
  138. }
  139.  
  140.  
  141. // this populator places 30 idling, bat-wielding Scouts scattered throughout the map
  142. RandomPlacement
  143. {
  144. Count 30 // the number of times to invoke the given spawner
  145.  
  146. MinimumSeparation 750 // the minimum distance between entities spawned
  147.  
  148. TFBot // a Spawner that spawns a TFBot
  149. {
  150. Name "Badass Bot" // (player) name, which will be displayed in-game. will default to the class name if not specified.
  151. Class Scout // class can be: Scout, Soldier, Demoman, Heavyweapons, Pyro, Medic, Sniper, Spy, Engineer
  152. Skill Easy // skill can be: Easy, Normal, Hard, or Expert
  153. Health <value> // if specified, overrides the normal starting health of this bot
  154. Scale <value> // if specified, sets the model scale of this bot (overrides the default scale for minibosses)
  155. Item <item definition name> // if specified, gives the bot the item. Multiple items can be listed. Each item will remove any
  156. // existing item in its loadout slot, so if you specify multiple items in the same loadout slot,
  157. // only the last one will be left on the bot.
  158. Attributes RemoveOnDeath // attributes can be:
  159. // RemoveOnDeath (kick this bot from the game when it dies)
  160. // Aggressive (make this bot "aggressive" - behavior dependant)
  161. // SuppressFire (don't allow this bot to fire its weapon)
  162. // DisableDodge (don't allow this bot to dodge left/right in combat)
  163. // BecomeSpectatorOnDeath (send this bot to the spectator team when it dies)
  164. // RetainBuildings (any buildings built by this bot should not blow up if this bot is removed)
  165. // SpawnWithFullCharge (any weapons that build up a charge over time will spawn fully charged)
  166. // AlwaysCrit (all shots will be critical hits)
  167. // HoldFireUntilFullReload (dont fire until our weapon is fully reloaded after a barrage - for rocket launchers, grenade launchers, shotguns, etc)
  168.  
  169. WeaponRestrictions MeleeOnly // if specified, restricts the weapons this bot is allowed to use. Restrictions can be: MeleeOnly, PrimaryOnly, or SecondaryOnly
  170. BehaviorModifiers Idler // if specified, sets this bot's initial behavior. Allowed values:
  171. // Idler (stands around idle until a player gets close or injures them)
  172. // Mobber (picks a random player and chases them down, regardless of where they run)
  173. CharacterAttributes // same attributes as those listed in items_master.txt
  174. {
  175. "move speed bonus" "3"
  176. "dmg from sentry reduced" "0.8"
  177. }
  178. Tag <custom tag> // if specified, adds the given custom tag (no internal spaces) to the bot's set of tags. Bots will pay attention to func_nav_avoid or func_nav_prefer entities with matching tags.
  179. MaxVisionRange <range> // if specified, sets the farthest range at which this bot can see enemies
  180. }
  181. }
  182.  
  183.  
  184. // this populator places 10 level three sentry guns scattered throughout the map, but only on navigation areas marked as SENTRY_SPOT
  185. RandomPlacement
  186. {
  187. Count 10
  188.  
  189. MinimumSeparation 750
  190.  
  191. NavAreaFilter SENTRY_SPOT // when collecting potential nav areas to spawn, only consider areas that have the SENTRY_SPOT flag
  192.  
  193. SentryGun // a Spawner that spawns a Sentry gun
  194. {
  195. Level 3 // ... a level 3 Sentry gun (can be 1 or 2 as well)
  196. }
  197. }
  198.  
  199.  
  200. // every 60 to 90 seconds, spawn either a melee-only mob of TFBots that chase down the players
  201. // or spawn a squad of 4 TFBots that move together and attack the players
  202. PeriodicSpawn
  203. {
  204. Where Behind // find a nearby hidden spot behind the players to spawn
  205.  
  206. When // specify how often our Spawner is invoked. In this case, we pick a random
  207. { // interval between 60 and 90 seconds. Alternatively, we could also say
  208. MinInterval 60 // "When 30" to invoke our Spawner every 30 seconds.
  209. MaxInterval 90
  210. }
  211.  
  212. // our Spawner is a RandomChoice, which picks at random from the Spawners it contains
  213. RandomChoice
  214. {
  215. Squad // choice 1: a Squad Spawner which, in this case, creates a squad of 4 TFBots: Soldier, Pyro, Demoman, and Heavyweapons
  216. {
  217. TFBot
  218. {
  219. Class Soldier
  220. Skill Easy
  221. }
  222.  
  223. TFBot
  224. {
  225. Class Pyro
  226. Skill Easy
  227. }
  228.  
  229. TFBot
  230. {
  231. Class Demoman
  232. Skill Easy
  233. }
  234.  
  235. TFBot
  236. {
  237. Class HeavyWeapons
  238. Skill Easy
  239. }
  240. }
  241.  
  242. Mob // choice 2: a Mob Spawner which will create a mob of 15 bat-wielding Scout mobbers
  243. {
  244. Count 15
  245.  
  246. TFBot
  247. {
  248. Class Scout
  249. WeaponRestrictions MeleeOnly
  250. BehaviorModifiers Mobber
  251. }
  252. }
  253.  
  254. Mob // choice 3: a Mob Spawner which will create a mob of 15 fist-wielding Heavy mobbers
  255. {
  256. Count 15
  257.  
  258. TFBot
  259. {
  260. Class HeavyWeapons
  261. WeaponRestrictions MeleeOnly
  262. BehaviorModifiers Mobber
  263. }
  264. }
  265.  
  266. Mob // choice 4: a Mob Spawner which will create a mob of 15 axe-wielding Pyro mobbers
  267. {
  268. Count 15
  269.  
  270. TFBot
  271. {
  272. Class Pyro
  273. WeaponRestrictions MeleeOnly
  274. BehaviorModifiers Mobber
  275. }
  276. }
  277.  
  278. Mob // choice 5: a Mob Spawner which will create a mob of 15 knife-wielding Spy mobbers
  279. {
  280. Count 15
  281.  
  282. TFBot
  283. {
  284. Class Spy
  285. WeaponRestrictions MeleeOnly
  286. BehaviorModifiers Mobber
  287. }
  288. }
  289. }
  290. }
  291.  
  292.  
  293. // every 30 seconds, throw in a Spy or a Sniper to keep the players on their toes
  294. PeriodicSpawn
  295. {
  296. Where Anywhere // find a nearby hidden spot spawn
  297.  
  298. When 30 // spawn every 30 seconds
  299.  
  300. RandomChoice
  301. {
  302. TFBot
  303. {
  304. Class Sniper
  305. Skill Normal
  306. Attributes RemoveOnDeath
  307. }
  308.  
  309. TFBot
  310. {
  311. Class Spy
  312. Skill Normal
  313. Attributes RemoveOnDeath
  314. }
  315. }
  316. }
  317.  
  318. // a single wave can contain multiple WaveSpawns
  319. Wave
  320. {
  321. Description "Lots of bad guys in this wave!" // the given description text will be displayed in the HUD when the prior Wave is counting down its 'WaitWhenDone' timer, and thereafter.
  322. Sound "Announcer.IncomingMob" // the given sound will be played when this Wave starts
  323. WaitWhenDone 25 // specifies a delay, in seconds, to wait after this wave is "done"
  324.  
  325. StartWaveOutput // when this Wave becomes active, fire an output to the given target entity
  326. {
  327. Target MyNamedEntity // the mapper-specified name of an entity
  328. Action OnTrigger // the action to send to the entity
  329. }
  330.  
  331. DoneOutput // when this Wave is done, after the WaitWhenDone timer elapses
  332. {
  333. Target MyNamedEntity
  334. Action OnTrigger
  335. }
  336.  
  337. WaveSpawn
  338. {
  339. Name "FIRST WAVE" // Name of the wave. Not required, but if another wave is waiting for this wave, this wave needs a name.
  340. Where wave_spawn_here // Defines where this wave will spawn into the environment.
  341. // In this case, an entity name of "wave_spawn_here" was given.
  342. // All entities in the map with that name will be collected
  343. // and one picked at random as the location to spawn from.
  344. // Alternatively, these special Where locations can be used:
  345. // AHEAD (spawns wave somewhere nearby ahead of the players, just out of sight)
  346. // BEHIND (spawns wave somewhere nearby behind the players, just out of sight)
  347. // ANYWHERE (spawns wave somewhere nearby the players, just out of sight)
  348.  
  349. TotalCount 16 // defines the total number of times the Spawner will be invoked in this wave
  350. MaxActive 8 // defines the maximum number of entities from this WaveSpawn that can be alive at the same time
  351. SpawnCount 4 // defines the number of entities to spawn at a time as a group. Default is 1.
  352. TotalCurrency 200 // Total amount of currency dropped by this wave. Should be cleanly divisible by TotalCount, so bots all drop the same amount.
  353.  
  354. WaitBeforeStarting 5 // specifies the duration in seconds to wait once this WaveSpawn becomes active
  355. // and the first time its Spawner is invoked
  356.  
  357. Support 1 // Marks this WaveSpawn as a Support wave. Support waves will keep running until all
  358. // non-Support waves are finished, even after the TotalCount is reached. Support waves
  359. // will not drop any more currency after TotalCurrency is reached.
  360.  
  361. RandomSpawn 1 // Marks the WaveSpawn as wanting to select a new "Where" spawn location for every bot that spawns.
  362. // The default is 0, which spawns the entire SpawnCount group at the same location.
  363. // The next group will pick a random "Where" spawn location for the entire group to use.
  364.  
  365. WaitBetweenSpawns 0 // specifies a delay, in seconds, between spawning SpawnCount groups of entities
  366.  
  367. // ***NOTE: Any of the sound and text warnings as well as the outputs below can be omitted. They are all listed here for completeness.
  368.  
  369. StartWaveWarningSound "Player.YouAreIt" // when this WaveSpawn becomes active (which might be before it starts spawning), emit this sound to all players
  370. StartWaveOutput // when this WaveSpawn becomes active, fire an output to the given target entity
  371. {
  372. Target MyNamedEntity // the mapper-specified name of an entity
  373. Action OnTrigger // the action to send to the entity
  374. }
  375.  
  376. FirstSpawnWarningSound "Player.YouAreIt" // when this WaveSpawn first invokes its Spawner, emit this sound to all players
  377. FirstSpawnOutput // when this WaveSpawn first invokes its Spawner, fire an output to the given target entity
  378. {
  379. Target MyNamedEntity
  380. Action OnTrigger
  381. }
  382.  
  383. LastSpawnWarningSound "Player.YouAreIt" // when this WaveSpawn invokes its Spawner for the last time, emit this sound to all players
  384. LastSpawnOutput // when this WaveSpawn invokes its Spawner for the last time, fire an output to the given target entity
  385. {
  386. Target MyNamedEntity
  387. Action OnTrigger
  388. }
  389.  
  390. DoneWarningSound "Player.YouAreIt" // when this WaveSpawn relinquishes control to the next WaveSpawn, emit this sound to all players
  391. DoneOutput // when this WaveSpawn relinquishes control to the next WaveSpawn, fire an output to the given target entity
  392. {
  393. Target MyNamedEntity
  394. Action OnTrigger
  395. }
  396.  
  397. // the Spawner for this WaveSpawn will pick one of three TFBots at random each time it is invoked
  398. RandomChoice
  399. {
  400. TFBot
  401. {
  402. Class Medic
  403. Skill Easy
  404. Attributes RemoveOnDeath
  405. }
  406. TFBot
  407. {
  408. Class Soldier
  409. Skill Easy
  410. Attributes RemoveOnDeath
  411. }
  412. TFBot
  413. {
  414. Class Demoman
  415. Skill Easy
  416. Attributes RemoveOnDeath
  417. }
  418. }
  419. }
  420.  
  421. // the next wave spits out 10 Heavies and waits for them to all die
  422. WaveSpawn
  423. {
  424. Name "HEAVY WAVE"
  425. Where wave_spawn_here
  426.  
  427. TotalCount 10
  428. MaxActive 10
  429. WaitForAllSpawned "FIRST WAVE" // waits for the wave spawn named "FIRST WAVE" to say it is done spawning all of its TFBots before starting
  430.  
  431. TFBot
  432. {
  433. Class Heavyweapons
  434. Skill Easy
  435. Attributes RemoveOnDeath
  436. }
  437. }
  438.  
  439. // the last wave brings a horde of Pyros that come out in groups of 10
  440. WaveSpawn
  441. {
  442. Where wave_spawn_here
  443.  
  444. TotalCount 30
  445. MaxActive 10
  446.  
  447. TFBot
  448. {
  449. Class Pyro
  450. Skill Normal
  451. Attributes RemoveOnDeath
  452. }
  453. }
  454.  
  455. WaveSpawn
  456. {
  457. TotalCurrency 25 // the total amount of currency dropped by all the Tanks in this wave
  458. TotalCount 1
  459.  
  460. Tank
  461. {
  462. Health 50000
  463. Speed 75
  464. Name "Sherman"
  465. Skin 0 // 0 - normal skin, 1 - final wave skin
  466. StartingPathTrackNode "boss_path_1" // if this is omitted, the Tank will find the path_track with no previous node and start there
  467.  
  468. OnKilledOutput // output sent when the Tank is killed
  469. {
  470. Target tank_died_relay
  471. Action Trigger
  472. }
  473.  
  474. OnBombDroppedOutput // output sent when the Tank drops its bomb once it reaches the end of its path
  475. {
  476. Target bomb_dropped_relay
  477. Action Trigger
  478. }
  479. }
  480. }
  481.  
  482. } // end Wave
  483. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement