Skip to content

Instantly share code, notes, and snippets.

@kimoto
Created August 26, 2012 22:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kimoto/3483882 to your computer and use it in GitHub Desktop.
Save kimoto/3483882 to your computer and use it in GitHub Desktop.
TF2のMvMのPopulationファイルの書き方
// この.popファイルは集団の特性を定義します。
// そしてこれはtf_populator entityによって操作します (tf_populatorというentityがMapに存在しているらしい
//
// 集団はひとつかそれ以上のPopulatorによって構成されます。
// すべてのPopulatorは.popファイル内で同時に実行されます。一部の状態を除いて。
// たとえば、もしあなたが3つのPeriodicSpawn populators、それらすべては
// 同時に沸くことになります
//
// 一般的に、Populatorは一つのSpawnerを含みます。Spawnerが発動されたときに
// それは世界に1つかそれ以上のエンティティが湧きます (何が起きるかはSpawnerの種類によると)
// 注意: この特殊な.popファイルは説明するために文書化したもので、
// すべての存在する機能を紹介しようとした。しかしそれはpopulationを使う上で必須ではないものもある。
//
// グローバルオプション一覧 (Populatorsの定義の外に記述するもの):
//
// StartingCurrency <amount>
// ゲームスタート時にプレイヤーが持っているお金
//
// Templatesブロック は、WaveSpawn か TFBot エンティティの中で参照されるテンプレートです
// (※訳注 Templatesブロックはもうちょいすると出てくる)
// Populators一覧
//
// RandomPlacement
// RandomPlacement Populatorは、ラウンドの開始時に一度だけ発動する
// そして、マップの中のランダムな位置にエンティティを生成することができる
// たとえば RandomPlacement はおそらくランダムな位置にセントリーガンを置くために使える (あとで記載方法が出てくるが、公式のMvMマップにはない、無人セントリーガン(誰の所有物でもない)を作れるらしい。そのときに使える)
//
//
// PeriodicSpawn
// PeriodicSpawn Populator は、指定されたSpawnerを一定の間隔で発動する
// たとえば PeriodicSpawn は TFBotを30秒に一回生成するために使える
//
// WaveSpawn
// WaveSpawn Populator spawns a "wave" of N entities, and has
// the special property that only ONE WaveSpawn at a time in a
// .pop file is active - the first one. Once that WaveSpawn is
// finished, it shuts off and the next WaveSpawn in the file
// becomes active, and so on.
//
// Spawners一覧
//
// TFBot
// 指定したclassとskillの TFBots を沸かせる
//
// SentryGun
// 指定された場所とLevelのセントリーガンを誰の所有物でもない状態で生成する
//
// RandomChoice
// 指定された複数のSpawnerのうちどれか一つをランダムに発動させる
//
// Squad
// 指定された複数のSpawnerを同時に発動させる
//
// Mob
// Spawnerのインスタンスを指定された数だけ生成する
//
// 設定サンプル
ExamplePopulation
{
// 全体的なオプション
StartingCurrency 100 // プレイヤーは100$からスタート
RespawnWaveTime 12 // entityのi/oで設定された RespawnWaveTimeを上書きできます。 (おそらくマップに設定されたtf_populator のこと)
// (まぁたぶんwaveの間隔の時間ってことだよね)
CanBotsAttackWhileInSpawnRoom no // 省略した時のデフォルトは"yes"。"no" にしたときはbotはSpawnRoomにいるプレイヤーに攻撃できなくなる
AddSentryBusterWhenDamageDealtExceeds 3000 // 省略した時のデフォルトは3000 points of damage inflicted by your sentry gun. Set this to override the threshold at which a Sentry Buster will be dispatched.
AddSentryBusterWhenKillCountExceeds 15 // 省略した時のデフォルトは15キル inflicted by your sentry gun. Set this to override the threshold at which a Sentry Buster will be dispatched.
Advanced 1 // 熟練難易度のフラグ。これは実績に関係する
Templates
{
// TFBot のテンプレート。Nataschaを装備したHeavy
T_TFBot_NataschaHeavy
{
Class HeavyWeapons
Skill Easy
Attributes RemoveOnDeath
Item "Natascha"
Item "Football Helmet"
}
// 5人のNataschaを装備したHeavyのWaveSpawnのテンプレート
// - 注意: あなたはこの中で他のテンプレートを参照できます
// - この例で言えば、さっき書いたNataschaを装備したHeavyのSkillの部分だけNormalで上書きされる (さっきはSkillをEasyで定義してた)
T_WaveSpawn_Heavies
{
TotalCount 5
MaxActive 1
WaveDoneWhen AllDead
TFBot
{
Template T_TFBot_NataschaHeavy
Skill Normal
}
}
// 金持ちPyro WaveSpawnの例
T_WaveSpawn_MoneyPyros
{
Template T_WaveSpawn_Heavies
TotalCurrency 2000
// 警告!: このブロックはT_WaveSpawn_HeaviesのTFBotブロックを上書きしている。
// だからこれはPyroがNataschasを持ってるわけじゃない。TFBotブロックを上書きしたので前に設定したTFBotの内容は全部消えたってことですね
TFBot
{
Class Pyro
}
}
}
// TFBotsの集団の定義である"mission" を定義します。これは"AI Director"が送信することが出来るコンテキスト依存のゴールです
// defines a set of TFBots that the "AI Director" can send in to accomplish certain context-specific goals
Mission
{
Objective Sniper // このミッションの目標。存在してるミッションは "Sniper" (スナイパーによるハラス), "Spy" (spyによるハラス), and "DestroySentries" (線とリーガンを壊すこと)
Where spawn_sniper_mission // どこでそのMissionのbotがspawnするか
BeginAtWave 4 // waveいくつのときにMissionがアクティブになるか
RunForThisManyWaves 3 // どのくらいのwaveこのmissionが有効になるか。この例だとwave 4,5,6で有効になる(上記行と合わせて)
CooldownTime 90 // Spawningと出撃までの最小の時間
DesiredCount 2 // How many copies of the spawner should be sent in
TFBot // missionの本体
{
Class Sniper
Skill Hard
Name Sniper
}
}
// このpopulator places 30 idling, bat-wielding Scouts scattered throughout the map
RandomPlacement
{
Count 30 // 与えられたSpawnerを発動する回数
MinimumSeparation 750 // the minimum distance between entities spawned
TFBot // a Spawner that spawns a TFBot
{
Name "Badass Bot" // (プレイヤー)の名前, ゲーム内のどこかで表示されてるだろう。 指定されなかった場合のデフォルトはclass名
Class Scout // Scout, Soldier, Demoman, Heavyweapons, Pyro, Medic, Sniper, Spy, Engineer のどれか
Skill Easy // Easy Normal Hard Expert のどれか
Health <value> // もし指定されてたらこのBOTの初期HPになる
Scale <value> // もし指定されてたらこのBOTのモデルのスケールを変更します (minibosses用のデフォルトスケールを上書きします)
Item <item definition name> // もし指定されていたらBOTにそのアイテムを与えます。複数業Itemを記載することができます。またそれぞれのアイテム
// のうち、同じload outスロットのアイテムであった場合は最後の1つのItemが採用されます (たとえば複数種類のミニガンを記載しても最後に指定ミニガンのみ有効)
Attributes RemoveOnDeath // attributesに指定できるもの
// RemoveOnDeath (死んだときにこのbotをゲームからkickする)
// Aggressive (このbotは"aggressive"ニナル - behavior dependant)
// SuppressFire (このbotがこの武器で攻撃するのを許可しない)
// DisableDodge (このbotが戦闘中に左右にゆれるのを禁止する)
// BecomeSpectatorOnDeath (死んだときにこのbotは観戦者チームに移動する)
// RetainBuildings (any buildings built by this bot should not blow up if this bot is removed)
// SpawnWithFullCharge (spawnしたときに持ってる武器がフルチャージ状態になる)
// AlwaysCrit (常にkritz)
// HoldFireUntilFullReload (持ってる武器をフルリロードするまで使わない - たとえばrocket launchers, grenade launchers, shotguns用)
WeaponRestrictions MeleeOnly // もし指定されてたらこのbotが使うことが出来る武器を制限できる。制限はMeleeOnly, PrimaryOnly, SecondaryOnlyのどれかを指定
BehaviorModifiers Idler // もし指定されてたらそのbotの初期状態が設定できる。許可されている値は
// Idler (攻撃を受けるかプレイヤーに近づくまでidleで歩き回る)
// Mobber (ランダムにプレイヤーを選んで、彼を倒すまで追いかける)
CharacterAttributes // items_master.txtに記載されたもののうちいくつかの属性を指定
{
"move speed bonus" "3"
"dmg from sentry reduced" "0.8"
}
Tag <custom tag> // もし指定されていたらbotにカスタムタグを与える(内部に空白なし) Bots will pay attention to func_nav_avoid or func_nav_prefer entities with matching tags.
MaxVisionRange <range> // もし指定されていたら、botが視認することが出来る範囲を設定できる
}
}
// このpopulator placesは10個のlv3 sentry gunをMapのどこかにランダムに設置する。しかし、SENTRY_SPOTフラグが設定されたnavエリアでのみ機能
RandomPlacement
{
Count 10
MinimumSeparation 750 // 最短の距離間隔?
NavAreaFilter SENTRY_SPOT // SENTRY_SPOTフラグのたってるnavメッシュのみ対象とする
SentryGun // SentryGunのSpawner
{
Level 3 // LV3 (1 - 3)
}
}
// every 60 to 90 seconds, spawn either a melee-only mob of TFBots that chase down the players
// or spawn a squad of 4 TFBots that move together and attack the players
PeriodicSpawn
{
Where Behind // find a nearby hidden spot behind the players to spawn
When // specify how often our Spawner is invoked. In this case, we pick a random
{ // interval between 60 and 90 seconds. Alternatively, we could also say
MinInterval 60 // "When 30" to invoke our Spawner every 30 seconds.
MaxInterval 90
}
// our Spawner is a RandomChoice, which picks at random from the Spawners it contains
RandomChoice
{
Squad // choice 1: a Squad Spawner which, in this case, creates a squad of 4 TFBots: Soldier, Pyro, Demoman, and Heavyweapons
{
TFBot
{
Class Soldier
Skill Easy
}
TFBot
{
Class Pyro
Skill Easy
}
TFBot
{
Class Demoman
Skill Easy
}
TFBot
{
Class HeavyWeapons
Skill Easy
}
}
Mob // choice 2: a Mob Spawner which will create a mob of 15 bat-wielding Scout mobbers
{
Count 15
TFBot
{
Class Scout
WeaponRestrictions MeleeOnly
BehaviorModifiers Mobber
}
}
Mob // choice 3: a Mob Spawner which will create a mob of 15 fist-wielding Heavy mobbers
{
Count 15
TFBot
{
Class HeavyWeapons
WeaponRestrictions MeleeOnly
BehaviorModifiers Mobber
}
}
Mob // choice 4: a Mob Spawner which will create a mob of 15 axe-wielding Pyro mobbers
{
Count 15
TFBot
{
Class Pyro
WeaponRestrictions MeleeOnly
BehaviorModifiers Mobber
}
}
Mob // choice 5: a Mob Spawner which will create a mob of 15 knife-wielding Spy mobbers
{
Count 15
TFBot
{
Class Spy
WeaponRestrictions MeleeOnly
BehaviorModifiers Mobber
}
}
}
}
// every 30 seconds, throw in a Spy or a Sniper to keep the players on their toes
PeriodicSpawn
{
Where Anywhere // find a nearby hidden spot spawn
When 30 // spawn every 30 seconds
RandomChoice
{
TFBot
{
Class Sniper
Skill Normal
Attributes RemoveOnDeath
}
TFBot
{
Class Spy
Skill Normal
Attributes RemoveOnDeath
}
}
}
// a single wave can contain multiple WaveSpawns
Wave
{
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.
Sound "Announcer.IncomingMob" // the given sound will be played when this Wave starts
WaitWhenDone 25 // specifies a delay, in seconds, to wait after this wave is "done"
StartWaveOutput // when this Wave becomes active, fire an output to the given target entity
{
Target MyNamedEntity // the mapper-specified name of an entity
Action OnTrigger // the action to send to the entity
}
DoneOutput // when this Wave is done, after the WaitWhenDone timer elapses
{
Target MyNamedEntity
Action OnTrigger
}
WaveSpawn
{
Name "FIRST WAVE" // Name of the wave. Not required, but if another wave is waiting for this wave, this wave needs a name.
Where wave_spawn_here // Defines where this wave will spawn into the environment.
// In this case, an entity name of "wave_spawn_here" was given.
// All entities in the map with that name will be collected
// and one picked at random as the location to spawn from.
// Alternatively, these special Where locations can be used:
// AHEAD (spawns wave somewhere nearby ahead of the players, just out of sight)
// BEHIND (spawns wave somewhere nearby behind the players, just out of sight)
// ANYWHERE (spawns wave somewhere nearby the players, just out of sight)
TotalCount 16 // defines the total number of times the Spawner will be invoked in this wave
MaxActive 8 // defines the maximum number of entities from this WaveSpawn that can be alive at the same time
SpawnCount 4 // defines the number of entities to spawn at a time as a group. Default is 1.
TotalCurrency 200 // Total amount of currency dropped by this wave. Should be cleanly divisible by TotalCount, so bots all drop the same amount.
WaitBeforeStarting 5 // specifies the duration in seconds to wait once this WaveSpawn becomes active
// and the first time its Spawner is invoked
Support 1 // Marks this WaveSpawn as a Support wave. Support waves will keep running until all
// non-Support waves are finished, even after the TotalCount is reached. Support waves
// will not drop any more currency after TotalCurrency is reached.
RandomSpawn 1 // Marks the WaveSpawn as wanting to select a new "Where" spawn location for every bot that spawns.
// The default is 0, which spawns the entire SpawnCount group at the same location.
// The next group will pick a random "Where" spawn location for the entire group to use.
WaitBetweenSpawns 0 // specifies a delay, in seconds, between spawning SpawnCount groups of entities
// ***NOTE: Any of the sound and text warnings as well as the outputs below can be omitted. They are all listed here for completeness.
StartWaveWarningSound "Player.YouAreIt" // when this WaveSpawn becomes active (which might be before it starts spawning), emit this sound to all players
StartWaveOutput // when this WaveSpawn becomes active, fire an output to the given target entity
{
Target MyNamedEntity // the mapper-specified name of an entity
Action OnTrigger // the action to send to the entity
}
FirstSpawnWarningSound "Player.YouAreIt" // when this WaveSpawn first invokes its Spawner, emit this sound to all players
FirstSpawnOutput // when this WaveSpawn first invokes its Spawner, fire an output to the given target entity
{
Target MyNamedEntity
Action OnTrigger
}
LastSpawnWarningSound "Player.YouAreIt" // when this WaveSpawn invokes its Spawner for the last time, emit this sound to all players
LastSpawnOutput // when this WaveSpawn invokes its Spawner for the last time, fire an output to the given target entity
{
Target MyNamedEntity
Action OnTrigger
}
DoneWarningSound "Player.YouAreIt" // when this WaveSpawn relinquishes control to the next WaveSpawn, emit this sound to all players
DoneOutput // when this WaveSpawn relinquishes control to the next WaveSpawn, fire an output to the given target entity
{
Target MyNamedEntity
Action OnTrigger
}
// the Spawner for this WaveSpawn will pick one of three TFBots at random each time it is invoked
RandomChoice
{
TFBot
{
Class Medic
Skill Easy
Attributes RemoveOnDeath
}
TFBot
{
Class Soldier
Skill Easy
Attributes RemoveOnDeath
}
TFBot
{
Class Demoman
Skill Easy
Attributes RemoveOnDeath
}
}
}
// the next wave spits out 10 Heavies and waits for them to all die
WaveSpawn
{
Name "HEAVY WAVE"
Where wave_spawn_here
TotalCount 10
MaxActive 10
WaitForAllSpawned "FIRST WAVE" // waits for the wave spawn named "FIRST WAVE" to say it is done spawning all of its TFBots before starting
TFBot
{
Class Heavyweapons
Skill Easy
Attributes RemoveOnDeath
}
}
// the last wave brings a horde of Pyros that come out in groups of 10
WaveSpawn
{
Where wave_spawn_here
TotalCount 30
MaxActive 10
TFBot
{
Class Pyro
Skill Normal
Attributes RemoveOnDeath
}
}
WaveSpawn
{
TotalCurrency 25 // the total amount of currency dropped by all the Tanks in this wave
TotalCount 1
Tank
{
Health 50000
Speed 75
Name "Sherman"
Skin 0 // 0 - normal skin, 1 - final wave skin
StartingPathTrackNode "boss_path_1" // if this is omitted, the Tank will find the path_track with no previous node and start there
OnKilledOutput // output sent when the Tank is killed
{
Target tank_died_relay
Action Trigger
}
OnBombDroppedOutput // output sent when the Tank drops its bomb once it reaches the end of its path
{
Target bomb_dropped_relay
Action Trigger
}
}
}
} // end Wave
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment